AI SDK & Agent Framework
The code between your product and the model — streaming, tool calls, structured output — and, when you need it, the agent loop that keeps state and hands work between steps.
The real choice
Broad framework or thin SDK. Broad frameworks come with integrations for loaders, vector stores and memory, but add layers of abstraction you have to learn and debug. Thin SDKs give you a typed agent loop close to the raw API and leave the rest to you. An agent harness goes further the other way: the whole loop — file access, shell, context management — comes ready-made, for agents that work inside a workspace.
Pick by situation
Tap the ones that are you — the tools that fit light up below.- Your app is TypeScript and you want agents without adding a Python service
AI SDK
Mastra - You want a small typed agent loop in Python, close to the raw API
Pydantic AI
OpenAI Agents SDK - Your agent works on files and runs commands, like a coding or research agent
Claude Agent SDK - You need many prebuilt connectors for models, tools and data sources
LangChain - Your agent is a long-running workflow with branches, saved state and human approval steps
LangGraph - The agent mostly retrieves and reasons over your own documents
LlamaIndex
The contenders
Grouped by the side of the choice they answer, not ranked. Open a row for when to use it, the trade-off and what makers say.
LangChainframework · open source · free tierThe largest set of ready-made integrations for models, tools and data sources, in Python and JavaScript.


65+205 open source5.1M/wk−1% vs npm
Use it whenYou need many connectors and want LangGraph for stateful, multi-step agents.
Trade-offLayers of abstraction make debugging harder, and the API has changed often.
llms.txtUsed by 8base, AI Context Flow, Brev.io, Chirpz Agent, ClueoChat and 60 more · in 205 open-source projects.
We chose to integrate with LangChain as it is the leading LLM framework. We are happy that it was so straightforward to integrate with LangChain and build some use cases already.
LlamaIndexframework · open source · free tierAgents that mostly retrieve and reason over your own documents.

17+66 open source120.7k/wk−19% vs npm
Use it whenIngesting, indexing and querying data is the core of the product.
Trade-offLess natural for agents whose work is mostly calling external tools rather than reading data.
llms.txtUsed by Basejump AI, debate AI, Dezyn, Droidrun, Tometo and 12 more · in 66 open-source projects.
LlamaIndex provides sufficient independent tooling for building custom AI agents. Their open-source approach and developer community made it a solid choice for our platform.
Mastraframework · open source · free tierTypeScript and Next.js apps that want agents, workflows, memory and RAG without a Python service.

24+13 open source1.4M/wk3.6× vs npm
Use it whenYou want a full agent framework — workflows, memory, evals — in the same TypeScript codebase as your app.
Trade-offYounger ecosystem, and some enterprise features sit under a separate source-available license.
llms.txtCLIUsed by Imagine, onlook, Revolte, siift, superset and 19 more · in 13 open-source projects.
Really like the depth of product here, very hard to make a product of this scale high quality, impressed!
LangGraphframework · open source · free tierStateful agents built as an explicit graph of steps, with checkpoints, retries, streaming and pauses for human approval, in Python or JavaScript.1+87 open source3.4M/wk+98% vs npm
Use it whenYour agent runs many steps or for a long time and you need to control each transition, resume after failures, or have a person approve actions.
Trade-offLower-level than a prebuilt agent — you design the graph and state yourself; managed deployment and tracing sit in paid LangSmith plans.
llms.txtCLIUsed by Semos.ai Manager Agents · in 87 open-source projects.
We picked LangGraph over CrewAI and AutoGen because it gives us explicit, stateful agent graphs with checkpoints and human approval steps, so we control every step instead of hoping the agents behave.
AI SDKlibrary · open source · free tierTypeScript agents with tool calling, multi-step loops and streaming to the UI, on any model provider.
4+193 open source21.2M/wk+167% vs npm
Use it whenYou already use the AI SDK for chat and want the agent in the same code.
Trade-offMemory, workflows and evals are left to you or other libraries.
Used by onlook, Quartr, Sparks AI, Zyntax IDE · in 193 open-source projects.
Used for multi-agent orchestration, state management, debugging, and structured artifact streaming for our AI application.
OpenAI Agents SDKframework · open source · free tierA small agent loop with tools, handoffs, guardrails and tracing built in, from the OpenAI team.1+39 open source1.6M/wk
Use it whenYou're mostly on OpenAI models and want minimal abstraction.
Trade-offTracing and hosted tools fit OpenAI best; other providers work but get less attention.
Used by DeepvBrowser · in 39 open-source projects.
Simplifies task decomposition and tool orchestration—define tools once and reuse across multiple browsing flows. Strong state management, invocation constraints, and observability, so we focus on user experience instead of glue code.
Pydantic AIframework · open source · free tierPython agents whose outputs must validate against typed schemas, across any model provider.35 open source27.5M/wk
Use it whenYou already use Pydantic and FastAPI and want the same style for agents.
Trade-offPython only, with fewer prebuilt integrations than the broad frameworks.
llms.txtNo maker's product we track shows it for this yet · in 35 open-source projects.
Claude Agent SDKlibrary · open sourceAgents that read and edit files, run shell commands and manage long context, built on the same harness as Claude Code.58 open source10.2M/wk
Use it whenYour agent does open-ended work in a workspace — code, research, file processing — rather than a few API calls.
Trade-offBuilt for Claude models, and it needs a filesystem and process to run in, which serverless functions don't give you.
llms.txtNo maker's product we track shows it for this yet · in 58 open-source projects.
Who switches to what
Public pull requests on GitHub since Oct 2024 whose title says "X to Y" — real code changes, by developers in general rather than makers only. Pick a flow to see its pull requests.
- feat(langchain): bridge MCP elicitation to LangGraph interruptslangchain-ai/langchain · 2026-08-20
- Migrate LLM calls to LangChain + orchestration to LangGraphKomali612/cicd-bootstrap · 2026-08-07
- archiving current langchain demo to start langgraph implementationyajji-k/ai-engineering-workspace · 2026-07-30
- Shifted chatbot form langchain to langgraph. Improved the workflow, M…Nouman64-cat/insurance-ai · 2026-07-23
- docs: add missing langchain to the LangGraph Python install commandComposioHQ/composio · 2026-07-15
- feat: migrate routing workflow from langchain to langgraphChikkalaSukrutiNaidu/multimodal-rag-bot · 2026-06-15
- feat(mastra): migrate v2 LangGraph chat extension to Mastra v3sourcefuse/loopback4-llm-chat-extension · 2026-05-22
- feat(migration): migrate lb4-llm-chat-extension from LangGraph to Mastra sourcefuse/loopback4-llm-chat-extension · 2026-05-13
- Migrate agent from LangGraph to MastraQuenumGerald/NudgeBot · 2026-05-07
- feat(migration): migrate lb4-llm-chat-extension from LangGraph to Mastra [WIP]sourcefuse/loopback4-llm-chat-extension · 2026-05-04
- Plan langgraph to mastra migrationConnorbelez/open-canvas · 2025-09-01
- server/llm: migrate from LangChain to Vercel AI SDKsagemathinc/cocalc · 2026-04-14
- Migrate LLM evaluation from LangChain to Vercel AI SDKsagemathinc/cocalc · 2026-04-10
- Migrate LangChain to Vercel AI SDKriccjohn/grimoire-oracle-web · 2026-03-02
- Migrate from LangChain to Vercel AI SDKliam-hq/liam · 2025-05-08
- Slim down qvac-langgraph to a pure LangChain adapterSpaceUY/qvac-meridian-challenge · 2026-10-01
- docs(cli): rename langgraph template to langchain in package READMEsassistant-ui/assistant-ui · 2026-07-04
- feat(cli): rename the langgraph starter template to -t langchainassistant-ui/assistant-ui · 2026-06-19
- Migrate from Vercel AI SDK to LangChain for chat infrastructurekarthicksakkaravarti/projectX · 2026-04-28
- refactor: migrate from Vercel AI SDK to LangChain + LangGraphjjinendra3/AceFrame · 2025-08-17
- Moving Backend LLM Integration to from Vercel AI SDK to LangChainwesfloyd/vibe-avs-builder · 2025-04-29
Before you choose
Write your first agent as a plain loop around the model's tool-calling API — it's under a hundred lines and teaches you what a framework would hide. Reach for a framework when you need the pieces it saves you from: retries, streaming, tracing, multi-step workflows. Choose by language first; a TypeScript app should not grow a Python service just for an agent.
- Reaching for a multi-agent setup before one agent with good tools works; more agents mean more tokens and more ways to fail.
- Letting the agent loop run with no step or cost cap, so a confused model calls tools until it hits the provider's rate limit.
- Adopting a broad framework's abstractions for a single model call, then fighting them when you need to see the actual prompt.
Other options
Real choices most makers here won't need to weigh.
Decided alongside
What the 107 makers' products here chose for their other decisions.