Best for · AI tools
Best AI agent frameworks: which one to build on, by language, job and lock-in
- Last checked
- 12 sources, linked below
- By the vectaai team
We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.
Verdict Our pick
The bar guide has a call.

- There is no single best AI agent framework, but there is a best one for your job.
Compared here
- 01LangGraph
- 02CrewAI
- 03OpenAI Agents SDK
- 04Claude Agent SDK
- 05Microsoft Agent Framework
- 06Google Agent Development Kit
- 07Pydantic AI
- 08Mastra
- 09LlamaIndex
- 10smolagents
Short answer
There is no single best AI agent framework, but there is a best one for your job. LangGraph (MIT, Python and JS) is the pick for long-running, stateful agents that must survive crashes and pause for human approval. CrewAI (MIT, Python) is the quickest way to a team of role-based agents. OpenAI Agents SDK (MIT) is the lightest serious option, and despite the name it works with 100+ other models. Claude Agent SDK (Python and TypeScript) gives you Claude Code's own agent loop with file, shell and web tools built in. Microsoft Agent Framework (MIT, Python and .NET) replaces AutoGen, which Microsoft has archived. Google ADK (Apache 2.0) is model-agnostic but tuned for Gemini.
For typed Python, take Pydantic AI. For TypeScript web apps, Mastra. For agents over lots of documents, LlamaIndex. For small local models, smolagents. All ten are free to use; the money is in the model API bills and optional hosted platforms like LangSmith ($39 per seat a month on Plus).
At a glance
| Framework | Licence | Languages | Best for | Paid add-on | Lock-in |
|---|---|---|---|---|---|
| LangGraph | MIT | Python; JS/TS as LangGraph.js | Stateful, long-running, human-in-the-loop | LangSmith: free Developer, Plus $39/seat/mo | Low; works without LangChain |
| CrewAI | MIT | Python (3.10 to 3.13) | Role-based multi-agent teams | CrewAI AMP control plane (free tier to try) | Low |
| OpenAI Agents SDK | MIT | Python; separate JS/TS SDK | Lightweight tool use, handoffs, guardrails | None required | Low; 100+ other LLMs supported |
| Claude Agent SDK | Anthropic Commercial Terms | Python, TypeScript | Agents that read, edit files and run commands | Pay for Claude API usage | High; built around Claude |
| Microsoft Agent Framework | MIT | Python, C#/.NET; Go in a separate repo | .NET shops, Azure, graph workflows | Azure services optional | Medium |
| Google ADK | Apache 2.0 | Python 3.11+; Java, Kotlin, Go, TypeScript sister projects | Gemini and Google Cloud deployments | Cloud Run, Agent Runtime optional | Medium |
| Pydantic AI | MIT | Python | Typed, validated outputs; durable execution | Logfire (free tier, no card) | Low |
| Mastra | Apache 2.0 core; ee/ folders under Mastra Enterprise License | TypeScript | Agents inside Next.js and Node apps | Enterprise licence for ee/ features in production | Low to medium |
| LlamaIndex | MIT | Python | Agents over documents, RAG | LlamaParse platform | Low |
| smolagents | Apache 2.0 | Python | Code-writing agents, local models | None; sandbox providers optional | Low |
Money note: none of these frameworks pays us anything, and most are free. This page makes money only from ads, which is a good position to be honest from. Where a framework has a paid hosted add-on, we say what it costs and whether you need it (usually not on day one).
We read every project's official GitHub repository or documentation on 4 December 2026: licence, languages, what it is built for, and what it sells on top. We did not benchmark them against each other, and you should be suspicious of anyone whose "benchmark" ranks their own sponsor first. GitHub star counts change daily, so we only use them as a rough sign of popularity.
Pick by job, in one table
| Your situation | Start with | Runner-up |
|---|---|---|
| Long-running agent that must survive crashes and wait for approval | LangGraph | Microsoft Agent Framework |
| A "team" of agents with roles: researcher, writer, editor | CrewAI | LangGraph |
| Simple tool-using agent, minimum ceremony | OpenAI Agents SDK | Pydantic AI |
| Agent that edits files, runs shell commands, browses | Claude Agent SDK | smolagents |
| .NET codebase or Azure shop | Microsoft Agent Framework | Semantic Kernel users: migrate here |
| Gemini models, Google Cloud | Google ADK | LangGraph |
| Python with strict types and validated outputs | Pydantic AI | OpenAI Agents SDK |
| Next.js or Node web app | Mastra | LangGraph.js |
| Agents over thousands of documents | LlamaIndex | LangGraph |
| Small local models, tinkering | smolagents | Pydantic AI |
LangGraph: best for stateful, production agents
LangGraph describes itself as a "low-level orchestration framework for building stateful agents." From its repo:
- Durable execution: agents "survive failures and pick up where they left off."
- Human-in-the-loop: people can inspect and change the agent's state mid-run.
- Memory: short-term working memory and long-term persistent memory.
- Licence: MIT. Python, plus LangGraph.js for JavaScript and TypeScript.
- Built by LangChain Inc., but usable without LangChain.
The paid part is LangSmith for tracing, evals and hosting. From LangChain's pricing page: Developer is $0 for 1 seat and 5k base traces a month; Plus is $39 per seat a month with 10k base traces and one small Agent Server on serverless hosting included; extra hosting is metered. Base traces are kept 14 days.
Pick it if your agent runs for minutes or hours, touches real systems, and must not lose its place. Skip it if you are building a weekend chatbot; the structure is overkill.
CrewAI: best for role-based teams of agents
CrewAI is a "framework for orchestrating role-playing, autonomous AI agents." You define agents with roles and goals, give them tasks, and let them collaborate.
- Crews for autonomous collaboration, Flows for "precise, event-driven control." You can combine them.
- Licence: MIT. Python only (3.10 up to below 3.14).
- Standalone, with its own primitives rather than sitting on LangChain.
- CrewAI AMP is the commercial control plane for deployment, observability and governance, with a free tier to try.
Pick it if your problem splits cleanly into specialist roles: research, write, review. Skip it if you need fine control over every step; Flows help, but LangGraph is more explicit.
OpenAI Agents SDK: best lightweight option
"A lightweight, powerful framework for multi-agent workflows." The core ideas fit on one hand:
- Agents: a model plus instructions, tools, guardrails and handoffs.
- Handoffs: one agent delegates to another.
- Guardrails: input and output checks.
- Sessions: conversation history handled for you.
- Tracing: built in.
Licence: MIT, with a separate JS/TS SDK. The surprise for many: it works with OpenAI's APIs and "more than 100 other LLMs." Not an OpenAI-only club.
Pick it if you want the least code between you and a working agent. Skip it if you need durable, hours-long processes; you will be adding a workflow engine yourself.
Claude Agent SDK: best for agents that work on files and code
Anthropic's SDK is "Claude Code as a library": "the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript." From the docs, you get:
- Built-in tools to read, write and edit files, run commands and search the web.
- Hooks, subagents, MCP connections, permissions and sessions you can resume or fork.
- Skills, commands and memory loaded from
.claude/folders, like Claude Code.
Two terms to know. It is governed by Anthropic's Commercial Terms of Service, not an open-source licence. And Anthropic says third-party products may not offer claude.ai login or rate limits unless approved; you use API key authentication and pay for API usage.
Pick it if your agent's job looks like a developer's or an analyst's: files, terminals, repos. Skip it if you want to swap models freely. If you are choosing between this and calling the API yourself, read Claude Agent SDK vs Messages API.
Microsoft Agent Framework: best for .NET and Azure
Microsoft's "open, multi-language framework for building production-grade AI agents":
- Licence: MIT. Python and C#/.NET, with a Go SDK in a separate repo.
- Graph workflows with sequential, concurrent, handoff and group patterns, plus checkpointing, streaming, human-in-the-loop and "time-travel."
- Migration guides from Semantic Kernel and AutoGen.
That last point matters: the AutoGen repo now says it "has been archived and is no longer actively maintained" and, "for new projects, we recommend Microsoft Agent Framework." If a tutorial tells you to start with AutoGen, it is out of date.
Pick it if your company writes C# or lives in Azure. Skip it if you are a solo Python dev with no Microsoft stack.
Google ADK: best for Gemini and Google Cloud
The Agent Development Kit is a "code-first Python framework for building, evaluating, and deploying sophisticated AI agents."
- Licence: Apache 2.0. Python 3.11+, with Java, Kotlin, Go and TypeScript sister projects.
- "Model-agnostic, deployment-agnostic", though optimised for Gemini.
- Deploy to Cloud Run, or scale with Agent Runtime on Google's agent platform (formerly Vertex AI Agent Engine). Local Docker works too.
Pick it if you use Gemini or Google Cloud already. Skip it if you want the most third-party examples and integrations; LangGraph's ecosystem is larger.
Pydantic AI: best for typed Python
From the team behind Pydantic. "Any model, one Python API", "typed end to end", results validated against the output type you define. It also lists "durable execution on ten engines" including Temporal, DBOS and Prefect. MIT. Observability through Logfire, which has a free tier with no card.
Pick it if you hate surprise JSON and like your IDE catching errors. It is the "FastAPI feeling" option.
Mastra: best for TypeScript web apps
"The modern TypeScript framework for AI-powered applications and agents", running inside React, Next.js or Node, or standalone.
- Model routing across 40+ providers, agents, graph workflows, human-in-the-loop with saved state, memory and RAG, MCP servers, evals.
- Licence, read carefully: the core is Apache 2.0, but code in
ee/folders is under the Mastra Enterprise License, free for development and testing, paid for production.
Pick it if your product is a TypeScript web app. Check the licence if you plan to use enterprise features in production.
LlamaIndex: best for document-heavy agents
LlamaIndex calls itself "the document processing platform for AI" and an "open-source framework to build agentic applications." MIT, Python. It started as the data layer for LLM apps, and that is still its edge: indexing, retrieval and Workflows for document agents. LlamaParse is its commercial platform for parsing and extraction.
Pick it if the hard part of your agent is "find the right paragraph in 10,000 PDFs."
smolagents: best for small models and tinkering
Hugging Face's "barebones library for agents that think in code." Its CodeAgent writes Python snippets as its actions instead of JSON tool calls. Apache 2.0. Works with local transformers, Ollama, llama.cpp and hosted models.
One warning straight from its README: the built-in local executor "is not a security sandbox." For untrusted tasks, use the supported sandboxes (E2B, Modal, Docker, Blaxel).
Pick it if you run small local models or want to read a framework's whole source in an afternoon.
How to choose without regret
- Start from your language. C# means Microsoft. TypeScript web means Mastra or the JS SDKs. Python means everything else.
- Start from your model if you are committed. Claude-heavy work: Claude Agent SDK. Gemini: ADK. Otherwise stay model-agnostic.
- Ask how long one run lasts. Seconds: anything works. Hours with approvals: LangGraph or Microsoft's workflows.
- Check the licence before the demo. MIT and Apache 2.0 are simple; Mastra's
ee/and Anthropic's Commercial Terms need a read. - Budget for the model, not the framework. An agent that loops 30 times costs 30 calls.
- Lock down tools early. An agent with a shell and your API keys is a security project. Our AI coding agent security guide covers the basics, and AI agent tooling standards explains MCP and friends.
Want an agent that codes rather than a framework to build one? Our open-source AI coding agents page compares ready-made ones. Everything else lives in AI tools.
Questions people ask
What is the best AI agent framework?
It depends on the job. LangGraph is the strongest pick for stateful agents that run for a long time, survive failures and pause for human review. CrewAI is fastest for role-based teams of agents. OpenAI Agents SDK is the lightest. Claude Agent SDK is best when the agent needs to work on files and run commands like Claude Code does.
Are AI agent frameworks free?
The ten here are free and open source or free to use, with MIT or Apache 2.0 licences for most; the Claude Agent SDK is governed by Anthropic's Commercial Terms. You pay for the model API calls the agent makes, and optionally for hosted tooling such as LangSmith, CrewAI AMP or Pydantic's Logfire.
Is AutoGen still maintained?
No. Microsoft's AutoGen repository says it has been archived and is no longer actively maintained, with contributions limited to bug fixes and security patches. For new projects Microsoft recommends Microsoft Agent Framework, which supports Python and .NET and has migration guides from both AutoGen and Semantic Kernel.
Can I use the OpenAI Agents SDK with other models?
Yes. OpenAI's repository says the SDK works with the OpenAI Responses and Chat Completions APIs and with more than 100 other LLMs. So the name is about who built it, not which model you must use. The same goes for Google ADK, which calls itself model-agnostic while being optimised for Gemini.
Which agent framework is best for TypeScript?
Mastra is built TypeScript-first and runs alongside React, Next.js or Node, with agents, graph workflows, memory, evals and MCP support. LangGraph.js, the OpenAI Agents SDK for JS and the Claude Agent SDK also have TypeScript versions. Pick Mastra for a web app, the others if you already chose their model.
Do I need a framework to build an AI agent?
Not always. A simple agent is a loop: call the model, run the tool it asks for, send back the result, repeat. Many teams start with the model provider's own SDK. Reach for a framework when you need memory, retries after crashes, human approval steps, many agents or tracing.
Sources
Every fact above comes from these pages. Prices change, so each one carries the date we read it.
- LangGraph on GitHub, checked 4 Dec 2026
- LangChain pricing (LangSmith), checked 4 Dec 2026
- CrewAI on GitHub, checked 4 Dec 2026
- OpenAI Agents SDK (Python) on GitHub, checked 4 Dec 2026
- Claude Agent SDK overview, checked 4 Dec 2026
- Microsoft Agent Framework on GitHub, checked 4 Dec 2026
- AutoGen on GitHub (archived notice), checked 4 Dec 2026
- Google ADK (Python) on GitHub, checked 4 Dec 2026
- Pydantic AI on GitHub, checked 4 Dec 2026
- Mastra on GitHub, checked 4 Dec 2026
- LlamaIndex on GitHub, checked 4 Dec 2026
- smolagents on GitHub, checked 4 Dec 2026