The best framework depends on your language and how much control the workflow needs. Use LangGraph for stateful workflows that must survive failures, CrewAI for role-based agent teams, Microsoft Agent Framework for .NET and Azure, Google ADK for Java, Go, Kotlin, and Google Cloud, Mastra for TypeScript, LlamaIndex for document-heavy agents, Pydantic AI for typed and testable results, smolagents for local models, and the OpenAI Agents SDK for the shortest path to a working multi-agent app. Do not start new projects on AutoGen, which is in maintenance mode. Microsoft Agent Framework is its direct successor.
TL;DR
Nine open-source frameworks are compared on license, language, orchestration style, model support, and production features: LangGraph, CrewAI, Microsoft Agent Framework, OpenAI Agents SDK, Google ADK, LlamaIndex, Pydantic AI, smolagents, and Mastra.
Feature lists overlap heavily, so language, license fine print, and project health decide the winner more often than any single capability.
The core code is free in every case, but several frameworks pair it with a commercial or hosted platform, and one well-known name, AutoGen, is now in maintenance mode.
Two AI agent frameworks can use the same language model, call the same APIs, and complete the same task. But what happens when something goes wrong? One framework may save execution state and resume after a failure. Another may require developers to build that recovery logic themselves.
The difference is easy to miss when comparing feature lists. It becomes important when an agent is handling real business workflows.
Choosing an open-source AI agent framework is about more than tool calling or multi-agent support. Developers also need to consider programming languages, workflow control, reliability, licensing, and long-term maintenance.
This blog compares nine frameworks in 2026: LangGraph, CrewAI, Microsoft Agent Framework, OpenAI Agents SDK, Google ADK, LlamaIndex, Pydantic AI, smolagents, and Mastra.
The comparison uses official documentation and repository information, with recommendations based on each framework’s architecture and intended use. These frameworks were not benchmarked hands-on, so the article does not make unsupported performance rankings.
What is an Open-Source AI Agent Framework?
An open-source AI agent framework is a code library, released under a license that lets anyone use and modify it, that handles the plumbing of building an agent. An AI agent is a program where a language model decides which step to take next, such as searching the web or updating a record, instead of following a fixed script.
Without a framework, every team rebuilds the same pieces. A framework supplies them:
Tool calling: Lets the model use functions, APIs, and servers that follow the Model Context Protocol (MCP), an open standard for connecting agents to tools and data.
Orchestration: Decides which agent or step runs next, in what order, and what happens after a failure.
State and memory: Remembers what happened earlier in a run and across sessions.
Human-in-the-loop: Pauses the agent so a person can approve or edit an action before it goes ahead.
Tracing and evals: Records what the agent did and tests whether it did it well.
A framework supplies the decision loop of agentic AI, MCP supplies the connection to tools, and neither makes the model itself smarter. Their job is control, debugging, and recovery. For tasks with fixed steps, a plain function is still the better tool.
AI Agent Framework vs AI Workflow
The difference is how decisions are made.
A traditional workflow follows steps defined by a developer. For example, receive a form submission, validate it, update a CRM, and send an email.
An AI agent may use a model to decide which tool or step is appropriate based on the user’s request.
In practice, reliable systems often combine both approaches.
Developers can use AI for interpretation and planning while keeping sensitive actions, approvals, and business rules inside deterministic code.
AI Agent Framework vs MCP
An agent framework controls how an application coordinates models, tools, and tasks.
The Model Context Protocol (MCP) standardizes connections between AI applications and external tools or data sources.
They serve complementary purposes. An agent framework can use MCP tools, but MCP does not replace orchestration, state management, or application-level security.
How We Evaluated the AI Agent Frameworks
We compared the frameworks using six criteria that influence real development decisions.
Evaluation factor
Why it matters
Programming language
Determines how naturally the framework fits an existing codebase
Orchestration
Controls how agents, tools, and workflow steps interact
State and recovery
Determines how interrupted or failed tasks are resumed
Model compatibility
Affects provider choice and switching costs
Licensing and costs
Identifies commercial restrictions and additional services
Project maintenance
Helps assess long-term compatibility and security support
The comparison is based on project documentation, publicly available repositories, and product information reviewed for November 2026. Framework descriptions reflect documented functionality. Recommendations about suitability are editorial assessments, not measured benchmark results.
GitHub stars are deliberately not used as a ranking criterion. They indicate community attention, but they do not establish reliability, security, or active maintenance.
Best Open-Source AI Agent Frameworks at a Glance
Compare the top open-source AI agent frameworks in 2026 based on their programming languages, key strengths, and ideal use cases.
Framework
Best For
Language
Key Strength
LangGraph
Stateful AI workflows
Python, JavaScript
Durable execution and workflow control
CrewAI
Multi-agent collaboration
Python
Role-based agents and Flows
Microsoft Agent Framework
Enterprise AI agents
Python, .NET
Enterprise orchestration and Azure integration
OpenAI Agents SDK
Lightweight AI agents
Python, TypeScript
Tools, handoffs, and tracing
Google ADK
Google Cloud applications
Python, TypeScript, Go, Java, Kotlin
Multi-language support and integrations
LlamaIndex
RAG and document agents
Python
Data retrieval and connectors
Pydantic AI
Structured AI applications
Python
Type validation and testing
smolagents
Local AI models
Python
Lightweight, flexible agent framework
Mastra
TypeScript AI applications
TypeScript
Built-in workflows, memory, and evaluations
Quick takeaway: LangGraph suits stateful workflows, CrewAI fits multi-agent teams, LlamaIndex works well for document-heavy applications, and Mastra is a strong option for TypeScript developers. The right framework depends on your programming language, application requirements, and workflow complexity.
Best Open-Source AI Agent Frameworks
Each entry follows the same pattern: a short description, the features, the pros, the cons, and who it suits. That way the nine can be read side by side.
1. LangGraph
LangGraph is a low-level orchestration framework for stateful agents. An agent is built as a graph, meaning a set of steps connected by rules for what runs next, and LangGraph saves the state between steps. LangChain’s own agents are built on top of LangGraph. It is written in Python, with a JavaScript version called LangGraph.js, and released under the MIT license.
Features:
Durable execution: Runs survive failures and resume where they stopped.
Human-in-the-loop checkpoints: The agent pauses so a person can approve or edit an action.
Memory: Both short-term and long-term memory are supported.
Graph orchestration: Steps, branches, and state are modeled explicitly.
Tracing: Runs are traced through LangSmith.
Deep Agents: A higher-level package that adds planning and sub-agents for complex tasks.
Pros:
Progress is not lost when a run crashes or pauses, because state is saved between steps.
Low-level control over what runs next.
Python and JavaScript versions under a permissive MIT license.
LangChain’s own agents run on it, and Deep Agents adds a higher-level option on top.
About 43k GitHub stars show wide attention.
Cons:
Low-level control means more code to write than in higher-level frameworks.
Tracing and managed deployment run through LangSmith, a separate LangChain product, so review its terms before depending on it.
Best for: Long-running, stateful workflows where a crash or a pause must not lose progress. It suits teams that will write more code in return for control over every step.
2. CrewAI
CrewAI is a standalone Python framework built on two ideas. Crews are teams of role-based agents, such as a researcher and a reporting analyst, that split a task between them. Flows are event-driven workflows that give exact control over what runs and when, and a Flow can use Crews as steps. It supports Python 3.10 to 3.13 and uses the MIT license.
Features:
Crews: Role-based agent teams that divide a task.
Flows: Event-driven workflows with exact control.
Tools, memory, knowledge sources, and structured outputs: The building blocks agents work with.
Checkpointing, async execution, and human input: Controls for long runs and approval steps.
MCP and A2A support: A2A is a protocol that lets agents built on different systems talk to each other.
Skills for coding assistants: CrewAI publishes skills that teach coding assistants such as Claude Code, Cursor and Windsurf its patterns.
Pros:
A working multi-agent setup comes together quickly.
Crews handle collaboration and Flows handle control, so one framework covers both.
Local models work through Ollama and LM Studio.
MIT license.
About 59k GitHub stars, the most of the nine, show wide attention.
Cons:
Agents use OpenAI models by default unless you configure another provider.
Anonymous usage telemetry is collected unless you set OTEL_SDK_DISABLED to true, and prompts and task data stay out of it unless you turn on share_crew.
Managed deployment and governance sit in CrewAI AMP, a separate commercial platform.
Best for: Role-based agent teams where you want a working multi-agent setup quickly. It suits Python teams that want collaboration and control in the same framework.
3. Microsoft Agent Framework
Microsoft Agent Framework combines AutoGen’s simple agent patterns with Semantic Kernel’s enterprise features, such as session state, type safety, middleware, and telemetry, and adds graph-based workflows for explicit control over multi-agent runs. AutoGen still works and still shows more GitHub stars than any framework here, but it is community managed and gets no new features. Existing AutoGen projects can follow Microsoft’s migration guide. The framework supports Python and .NET, with a Go version in public preview, under the MIT license
Features:
Graph workflows: Sequential, concurrent, handoff, and group patterns.
Checkpointing and human-in-the-loop: Runs can be saved, paused, and approved.
OpenTelemetry tracing and middleware: Visibility and hooks around each run.
YAML-defined agents: Agents can be declared in configuration files.
DevUI: A developer interface for testing agents.
Model providers: Microsoft Foundry, Anthropic, Azure OpenAI, OpenAI, and Ollama.
Pros:
It is the direct successor to both AutoGen and Semantic Kernel, so the direction is clear.
Python and .NET support suits mixed teams.
Enterprise features such as session state, type safety, and middleware come built in.
A migration guide covers existing AutoGen projects.
Providers beyond Microsoft’s own are supported.
Cons:
The quickstarts use Microsoft Foundry, and data sent to non-Azure models can leave your Azure compliance and geographic boundaries unless you manage that yourself.
The Go version does not yet include declarative agents, RAG, CodeAct, or functional workflows.
Best for: .NET and Azure teams, and Python teams that want enterprise-style structure. New Microsoft projects should start here, not on AutoGen.
4. OpenAI Agents SDK
The OpenAI Agents SDK is a lightweight Python framework for multi-agent workflows. Despite the name, it is provider-agnostic, working with OpenAI’s Responses and Chat Completions APIs and with 100+ other LLMs. An agent is a model configured with instructions, tools, guardrails (safety checks on inputs and outputs), and handoffs, which let one agent pass a task to another. It needs Python 3.10 or newer and uses the MIT license, and a separate JavaScript and TypeScript version exists.
Features:
Sandbox agents: Inspect files and run commands in a container over long tasks.
Realtime and voice agents: Agents that handle live audio.
Sessions: Conversation history is managed for you.
Human-in-the-loop controls: Approval steps before an action goes ahead.
Built-in tracing: Runs are recorded without extra setup.
MCP tools: Agents can use tools exposed through MCP.
Pros:
A small surface area gives the shortest path to a working multi-agent app.
It works with 100+ other LLMs, not only OpenAI’s.
Guardrails and tracing are built in.
Voice and realtime agents are supported.
MIT license, with a separate JavaScript and TypeScript version.
Cons:
No graph workflow engine appears among its core concepts, so complex branching logic lives in your own code.
The JavaScript and TypeScript version is separate from the Python one, so features are tracked per language.
Best for: Teams that want the shortest path to a working multi-agent app with guardrails and tracing built in. It also suits projects that need voice agents without a heavy framework.
5. Google Agent Development Kit (ADK)
Google’s Agent Development Kit is the widest option by language, available in Python, TypeScript, Go, Java, and Kotlin. Version 2.0 adds graph workflows and a Task API for structured delegation between agents. It connects to models from several providers and deploys to your infrastructure or to Google’s cloud services. The Python repository is Apache-2.0.
Features:
Graph workflows: Mix fixed code paths with AI reasoning (new in 2.0).
Model adapters: Gemini, Claude, OpenAI, Ollama, vLLM, and LiteLLM.
MCP tools: Agents can use tools exposed through MCP.
A2A support: Agents can talk to agents built on other systems.
Built-in evaluation tools: Test how well an agent performs.
Deployment options: Your own infrastructure, Cloud Run, GKE, or Google’s Agent Runtime.
Pros:
Five languages, more than any other framework here.
Several model providers work through adapters.
MCP and A2A support cover tools and other agents.
Evaluation tools are built in.
Deployment to Google Cloud is a first-class path.
Cons:
ADK 2.0 breaks compatibility with 1.x, and sessions created by 2.0 cannot be read by 1.x versions older than 1.28. Read the upgrade notes and pin versions before moving a live agent.
The Apache-2.0 license is confirmed for the Python repository, so check the other language repositories before you ship.
Best for: Teams outside the Python world, and anyone deploying to Google Cloud. Java, Go, and Kotlin teams get a framework in their own language here.
6. LlamaIndex
LlamaIndex began as a data framework that connects language models to private data, which makes it a natural fit for RAG (retrieval-augmented generation, where the model looks up your documents before it answers). The company’s main focus has since shifted to LlamaParse, its document-parsing platform, and the open-source framework remains available as a toolkit. It is written in Python under the MIT license.
Features:
Data connectors: APIs, PDFs, docs, and SQL.
Indexing and querying: Ways to organize data and ask questions of it.
Integrations: Over 300 packages for models, embeddings, and vector stores.
Workflows: A way to build agents on top of your data.
RAG support: Retrieval is the core design, not an add-on.
Pros:
It is built around data connectors and retrieval, which suits document-heavy agents.
Over 300 integration packages reduce custom glue code.
Workflows cover agent building in the same toolkit.
MIT license.
About 53k GitHub stars show wide attention.
Cons:
The company’s priority is LlamaParse, so check release activity before you commit.
The README is updated less often than the documentation, so start from the docs.
Python only.
Best for: Agents that work over documents, such as search across PDFs, contracts, or internal knowledge bases. It suits teams whose main problem is getting private data in front of a model.
7. Pydantic AI
Pydantic AI comes from the team behind Pydantic, the widely used Python validation library. Its main pitch is type safety. You declare what an agent must return, every run comes back validated and typed, and mistakes surface while you write code instead of in production. It is Python only and uses the MIT license.
Features:
Provider freedom: Any major model provider through a string swap, including OpenAI, Anthropic, Google, Bedrock, Azure, Mistral, and Ollama.
MCP and web search: Built-in tool options.
Durable execution: Available through Temporal, DBOS, or Prefect.
OpenTelemetry instrumentation: Works with any OpenTelemetry backend.
Evals: Tests agent behavior the way pytest tests code.
Dependency injection: Database connections and API clients are passed into tools in a checked way.
Pros:
Validated, typed results catch mistakes before production.
Extras such as memory, sub-agents, and the ready-made coding agent live in a separate Harness package.
Best for: Python teams that care about structured outputs, testing, and clean dependency injection. It suits projects where agent output feeds code that expects a fixed shape.
8. Smolagents
smolagents from Hugging Face is the minimalist of the group. The core agent logic fits in under 1,000 lines of code, which makes it easy to read end to end. Its CodeAgent writes actions as Python code instead of JSON tool calls, and a classic ToolCallingAgent is included for teams that prefer the JSON style. It is written in Python under the Apache-2.0 license.
Features:
Any model: Local transformers or Ollama, Hugging Face inference providers, OpenAI, and Anthropic through LiteLLM.
CodeAgent and ToolCallingAgent: Code-style or JSON-style actions.
Tools from MCP servers or LangChain: Reuse tools you already have.
Hugging Face Hub sharing: Share tools and agents with others.
Multimodal inputs: Text, vision, video, and audio.
Multi-agent hierarchies: Agents can manage other agents.
Pros:
The small codebase is easy to read and understand.
Any model works, including local ones.
Both code-style and JSON-style agents are included.
Tools and agents can be shared through the Hugging Face Hub.
Apache-2.0 license.
Cons:
Code agents run code that a model wrote, and the built-in LocalPythonExecutor is not a security boundary, so run agents in a sandbox such as E2B, Blaxel, Modal, or Docker.
Python only.
Best for: Researchers, tinkerers, and teams running open or local models. It suits anyone who wants a small, readable codebase more than a long feature list.
9. Mastra
Mastra is the TypeScript option, built for teams that already work in React, Next.js, or Node. It bundles agents, a graph-based workflow engine with .then(), .branch(), and .parallel() steps, memory, evals, and observability in one package, and it runs inside an existing app or as a standalone server. The core is Apache-2.0, with code in ee/ directories under a separate Mastra Enterprise License that requires a license for production use
Features:
Agents: The core building block for tasks that need a model.
Graph-based workflow engine: Steps chain with .then(), .branch(), and .parallel().
Model routing: Across 40+ providers.
Suspend-and-resume: Pauses a run for human approval.
MCP server authoring: Build your own MCP servers.
Memory, evals, and observability: Built into the same package.
Pros:
It fits teams already working in React, Next.js, and Node.
Agents, workflows, memory, evals, and observability ship in one package.
Model routing covers 40+ providers.
It runs inside an existing app or as a standalone server.
Apache-2.0 for the core.
Cons:
The dual license means ee/ directories need an enterprise license for production use, so check which directories you import before you ship.
TypeScript only.
Best for: JavaScript and TypeScript teams shipping agents inside web products. It suits teams that want agents, workflows, and evals in one package instead of assembling parts.
Side-by-Side Comparison
This comparison focuses on orchestration, state management, human approvals, observability, and model compatibility factors that matter when building production AI agents.
Framework
Orchestration Approach
State & Recovery
Human Approval
Observability & Testing
Model Compatibility
LangGraph
Graph-based workflows
Persistent checkpoints and resumable execution
Interrupt and resume
LangSmith tracing and evaluations
Multiple providers
CrewAI
Role-based Crews and event-driven Flows
Flow persistence and checkpointing
Human input in workflows
Tracing and execution monitoring
Multiple providers, local models
Microsoft Agent Framework
Agent orchestration and graph workflows
Session state and checkpointing
Approval and handoff patterns
OpenTelemetry and DevUI
Multiple providers
OpenAI Agents SDK
Agent handoffs and tool-driven execution
Sessions; custom recovery logic
Approval controls
Built-in tracing and guardrails
OpenAI and compatible providers
Google ADK
Sequential, parallel, and graph workflows
Session management and state persistence
Human confirmation patterns
Built-in evaluation tools
Gemini and supported external models
LlamaIndex
Event-driven agent workflows
Workflow state; persistence depends on configuration
Workflow-based approval steps
Instrumentation and evaluation integrations
Multiple providers
Pydantic AI
Typed agent execution and tool calls
Durable execution through integrations
Controlled tool approval
OpenTelemetry and Pydantic Evals
Multiple providers
smolagents
Code-based and tool-calling agents
Custom or externally managed persistence
Custom approval logic
Logging and external monitoring
Hosted and local models
Mastra
Graph-based workflows and agents
Workflow persistence and suspend/resume
Workflow suspension and approval
Built-in observability and evaluations
Multiple providers
Note: These capabilities describe supported architectural patterns, not identical out-of-the-box behavior. Persistence, human approval, and observability may require additional configuration or external services.
Choosing the Right Framework for Your Needs
Three questions narrow the field quickly. What language does your team ship in, how much control does the workflow need, and where will the agent run? The picks below are editorial judgment based on the facts above.
Pick by your situation
Stateful workflows that must resume after a failure: Start with LangGraph. Durable execution and human-in-the-loop checkpoints are core features.
A team of role-based agents, quickly: Start with CrewAI. Crews handle collaboration and Flows handle control.
A .NET or Azure shop: Start with Microsoft Agent Framework. It supports Python and .NET and is the successor to AutoGen and Semantic Kernel.
A light framework with handoffs, guardrails, and voice: Start with OpenAI Agents SDK. It has a small surface area and works with 100+ other LLMs.
Java, Go, Kotlin, or Google Cloud: Start with Google ADK. It supports five languages and deploys to Google Cloud with one command.
Agents that work over documents: Start with LlamaIndex. It is built around data connectors and retrieval.
Typed outputs and testable agents: Start with Pydantic AI. It offers validated results, evals, and durable execution options.
Open or local models with a tiny codebase: Start with smolagents. Its core logic is under 1,000 lines and it works with any model.
A TypeScript product team: Start with Mastra. It fits React, Next.js, and Node apps.
When a framework is not the right tool
Business process automation: Visual tools such as n8n and the platforms can get there faster than a framework, because not every agent needs code.
Customer-facing support and sales: YourGPT is an AI agent platform with omnichannel deployment, and building an AI agent for customer service is covered in the framework.
Two decisions that sit outside the framework
Tools: Whichever framework you choose, the agent still needs tools. MCP360 connects agents to 100+ tools through one MCP connection, so you skip wiring each API by hand.
Models: Model choice stays a separate decision, because most of these frameworks work with several providers, and agentic AI models differ on cost, prompt size, and computer use.
Match the picks to your team, then test the match before you commit.
Frequently Asked Questions
Which open-source AI agent framework is the best?
No single framework is best for every team. Mastra suits TypeScript developers, Google ADK supports Java, Go, and Kotlin, and Microsoft Agent Framework fits .NET projects. Among Python frameworks, LangGraph is suitable for stateful workflows, CrewAI for role-based multi-agent systems, and Pydantic AI for structured, testable outputs. The right choice depends on your programming language, workflow requirements, and production needs.
What is the difference between LangGraph and CrewAI?
LangGraph uses graph-based orchestration with persistent state and checkpoints, making it suitable for workflows that need explicit control and failure recovery. CrewAI focuses on role-based agent collaboration through Crews and event-driven execution through Flows. Choose LangGraph when state management and workflow control are priorities, and CrewAI when tasks involve multiple specialized agents working together.
Should I still use AutoGen in 2026?
AutoGen is no longer recommended for new projects. Microsoft has archived the framework and no longer provides new features, bug fixes, security fixes, or official support. Microsoft Agent Framework is its recommended successor, combining ideas from AutoGen and Semantic Kernel. Existing AutoGen users should review Microsoft’s migration documentation before moving production applications.
Are open-source AI agent frameworks really free?
Most open-source AI agent frameworks provide their core libraries under permissive licenses such as MIT or Apache-2.0. However, running an agent may involve additional costs for LLM APIs, hosting, databases, monitoring, and managed platforms such as LangSmith or CrewAI AMP. Mastra also includes enterprise-licensed components in its ee/ directories. Review licensing terms and operating costs before choosing a framework.
Can these frameworks work with models other than OpenAI’s?
Yes. Many frameworks support models from Anthropic, Google, OpenAI, and other providers. Pydantic AI, Mastra, CrewAI, and the OpenAI Agents SDK support multiple model integrations, while smolagents can work with local models through compatible tools such as Ollama. However, feature support varies by provider, so test tool calling, structured outputs, and other required capabilities before committing.
Do I need a framework to build an AI agent?
Not always. Simple agents with fixed tasks may only require model API calls and regular application code. Visual automation tools such as n8n can also handle many business workflows. An AI agent framework becomes useful when your application needs multi-agent coordination, persistent state, tool orchestration, human approval, tracing, or recovery from failures.
Conclusion
The frameworks in this group are converging on the same toolkit, with graph workflows, human approval steps, durable runs, and MCP and A2A for reaching tools and other agents. Microsoft merged two projects into one, and Google rebuilt ADK around graphs. As features converge, the choice shifts to what is expensive to change later: your language, your comfort with the license, and who will still maintain the project in two years.
A practical next step is a small pilot with a clear target. Pick two frameworks from the table and build the same small agent in each in one afternoon, with one tool call, one approval step, and one failure to recover from. Keep the agent’s business logic in plain functions so a later switch costs days instead of months, and recheck a project’s status before every major upgrade, since AutoGen’s maintenance mode shows how fast it can change.
Rajni is a senior content writer at Delta4 Infotech covering AI agents, automation, and no-code tools. She writes across the AI space, from chatbots and customer support to MCP and agent workflows, focused on how businesses actually put these tools to work.