Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

LangGraph Alternatives: 9 Agent Frameworks Weighed

The main LangGraph alternatives are open-source Python agent frameworks, a TypeScript framework with a hosted platform, agent SDKs from the model vendors and lighter libraries for agents that think in code. Your language, and how much structure you want around each step, decide which type fits.

LangGraph is a graph framework for building AI agents and multi-step workflows. The alternatives trade that structure for something else: a different language, a model vendor's own tooling, a lighter library or a hosted platform on top of the code. None of those trades is free, which is why this page weighs them rather than ranking them.

What sits on the other side of the trade

The options fall into four camps. There are open-source Python frameworks, from typed-output agent libraries to modular building blocks for production systems. There's a TypeScript framework with its own paid platform. Several options are agent SDKs from the model vendors, OpenAI Agents SDK and Google ADK, while others are independent open-source projects like DSPy and AG2. Microsoft's AutoGen is in a category of its own, because its docs now mark it archived. And there are barebones libraries for agents that write and run code.

If you're still choosing your first framework rather than leaving one, the wider guide to the best AI agent frameworks starts from a blank page. This one assumes you know what a graph of agent steps feels like to build and debug, and want to know what you'd gain or give up by moving.

Pros and cons of keeping an explicit graph

The case for a graph is control. In a graph, every branch, retry and hand-off is spelled out in code, so when an agent goes somewhere odd you can point at the edge it took. That's worth a lot in a workflow with approvals, long waits or several agents passing work between them.

The cost is ceremony. A three-step agent that calls a tool and answers doesn't need nodes and edges, and building it as a graph means more code to read every time someone new joins. My view: keep the graph when the workflow has real branches you'd draw on a whiteboard, and look elsewhere when you find yourself drawing a straight line.

Python against TypeScript: strengths and weak spots

Language is the fork that decides the most and gets discussed the least. Mastra is the TypeScript framework on this list, and every other project here that names its language names Python.

The strength of staying in Python is reach: the data tooling, the notebooks and the people who already write your model code are there. The weak spot shows up when the agent has to live inside a TypeScript product, and you end up running a separate Python service just to host it. If your front end, API and agent would all be one TypeScript codebase, that's a strong pull towards the TypeScript camp; if your agent mostly talks to data pipelines, Python stays the easier home.

Model-vendor SDKs: pros and cons

An SDK from the company that makes the model is tempting. The tooling comes from the same company as the model you're calling, so there's one less party between you and the model. OpenAI's SDK, for one, lists sandbox agents among the things it covers.

The weak spot is the question of what happens when you want a different model next quarter. Before you commit, check how each SDK handles models from other providers, and how much of your code would change if you swapped one out. For a sense of how far apart the approaches can sit, here are two better-known frameworks compared side by side.

Lighter libraries against full frameworks

At one end there's smolagents, described as a barebones library for agents that think in code, a lighter alternative to graph frameworks. At the other end sit frameworks built from modular building blocks for production-ready agentic systems. Between them sit the typed-output libraries and the frameworks that treat prompts as programs.

A lighter library is quicker to read end to end and easier to bend, and you'll write more of the plumbing yourself: retries, state, memory, logging. A fuller framework hands you those pieces and asks you to work its way. If you go light, memory is one piece to plan for, and the guide to AI agent memory tools covers what to bolt on.

Open-source library only, or a framework with a hosted platform

The third fork is whether you want a library and nothing else, or a library with a company's hosted platform alongside. A library alone keeps everything in your own infrastructure and your own hands. A platform adds a company's hosted service alongside the code, at the price of a monthly plan and one more service in the chain.

Mastra is the clear example here: an open-source TypeScript framework with a paid platform on top, set out in free, Starter and Team tiers.

What the bill looks like

For the libraries, the code itself isn't where the money goes. Pydantic AI, Google ADK, AG2 and Haystack are all listed as open source. From there, I'd expect the running cost to sit in the model calls your agent makes and the servers it runs on, and that's shaped far more by how many steps a single run takes than by which framework you picked.

A hosted platform adds a monthly plan to that. On the one platform here with published tiers, the free tier sits below two paid ones, so a small team can start without a bill for the platform itself.

A worked example: a ticket triage agent

Three engineers with a Python backend and a Postgres database are building an agent that reads each incoming support ticket, looks up the customer's account, drafts a reply and sends anything about refunds to a person for approval before it goes out.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

That approval step is a real branch, with a wait in the middle that can last hours. It's exactly the kind of flow a graph handles well, so I'd only leave LangGraph here for another Python framework with a clear story for pausing and resuming a run. A typed-output framework is worth a look if the pain today is malformed drafts rather than control flow.

Change one fact and the answer moves. If the same team's product were a TypeScript web app and the agent lived inside it, the TypeScript framework would be my first look, because one codebase beats two.

Agent frameworks and libraries to weigh against LangGraph

Independent and smaller projects come first, then the three from the big model and cloud companies.

Pydantic AI

A Python agent framework built around typed outputs, which also covers realtime voice, image generation and embeddings under the line "How Python does AI".

Mastra

A TypeScript framework for agents that reason, remember and act, with memory, tools, MCP and observability built in, plus a hosted platform.

AG2

From the creators of AutoGen, a Python framework for building, orchestrating and scaling systems where several agents work together.

smolagents

Hugging Face's barebones library for agents that think in code, a lighter route than wiring every step into a graph.

Haystack

deepset's set of modular, customisable building blocks for production-ready agentic systems, with context engineering written into the pitch.

DSPy

Out of Stanford, a framework whose motto is "Program, don't prompt, your LLMs", so model behaviour is written as code rather than long prompts.

AutoGen

Microsoft's framework for AI agent applications, split into AgentChat, Core and Studio; its docs now mark it archived and point new users to Microsoft Agent Framework.

Google Agent Development Kit

Google's toolkit for building multi-agent systems, known as ADK throughout its own docs.

OpenAI Agents SDK

OpenAI's own Python SDK for building agents, with sandbox agents among the things its docs cover.

Weighing it up

Stay on a graph framework when your workflow has branches and waits worth drawing. Move to another Python framework when the graph has become ceremony, to the TypeScript camp when the agent lives in a TypeScript product, to a model vendor's SDK when you're happy to stay close to one provider, and to a barebones library when you'd rather own every line. The trade you pick should be the one that removes your current pain, not the one with the newest release notes.

Do you make agent frameworks or developer tools for AI agents? Tool makers can ask to be considered for a featured place on this list.

Want your tool on this list? Featured spots and reviews here are paid partnerships. Here's how to partner with me.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.