LLM agent frameworks compared: LangChain, CrewAI, AutoGen, OpenAI Agents SDK
TL;DR
If you need complex state-machine orchestration and already use LangSmith, pick LangChain + LangGraph. If you want the fastest path from idea to running agent, pick OpenAI Agents SDK. For genuine multi-agent collaboration with role-based design, pick CrewAI. For enterprise cross-service orchestration, pick Microsoft Agent Framework. If a single API call with tool use solves your problem, use none of them — start with direct API calls before adopting any framework.
Every month a new agent framework ships. Every team picks one before understanding what they are actually buying into. LangChain, CrewAI, AutoGen, and OpenAI Agents SDK are the four most common starting points in 2026, but they solve fundamentally different problems — and the wrong choice costs months of rewiring.
This page compares them on architecture, ease of use, production readiness, observability, multi-agent support, and community maturity. A worked customer-support triage example shows each framework’s approach to the same real task. Use the decision matrix at the end to shortlist before you build.
What each framework is — and is not
The four frameworks occupy different points on the abstraction spectrum. Calling them “agent frameworks” glosses over the real architectural difference.
LangChain
… (context around line 28) … LangChain is the oldest and most established at ~138k GitHub stars. It started as a prompting-and-chaining library and grew into an ecosystem: LangChain core for model calling and tools, LangGraph for state-machine agent orchestration, LangSmith for observability and debugging, and Deep Agents for higher-level agent patterns.
LangChain is the most comprehensive option and the one with the steepest learning curve. You get a lot of abstraction — too much, if you are not careful. The framework wraps model providers, vector stores, retrievers, parsers, and tools behind a unified interface. That is convenient when you need it and confusing when you do enough.
What it is good at: multi-provider model access, complex orchestration with LangGraph state machines, production observability via LangSmith, and integrations with most vector stores, document loaders, and tool providers on the market.
What it is not: a low-ceremony quick-start. The abstraction depth means you spend as much time learning LangChain conventions as you spend on your actual agent logic. LangChain is the oldest and most established at ~138k GitHub stars. It started as a prompting-and-chaining library and grew into an ecosystem: LangChain core for model calling and tools, LangGraph for state-machine agent orchestration, LangSmith for observability and debugging, and Deep Agents for higher-level agent patterns.
LangChain is the most comprehensive option and the one with the steepest learning curve. You get a lot of abstraction — too much, if you are not careful. The framework wraps model providers, vector stores, retrievers, parsers, and tools behind a unified interface. That is convenient when you need it and confusing when you do not.
What it is good at: multi-provider model access, complex orchestration with LangGraph state machines, production observability via LangSmith, and integrations with most vector stores, document loaders, and tool providers on the market.
What it is not: a low-ceremony quick-start. The abstraction depth means you spend as much time learning LangChain conventions as you spend on your actual agent logic.
OpenAI Agents SDK
OpenAI Agents SDK (26.7k stars) is the newest of the four. It is lightweight by design — the core library is a single Python package with clear separation between agents, tools, guardrails, handoffs, and tracing.
The SDK is provider-agnostic (it supports OpenAI models and 100+ others via the Chat Completions API interface), but its architecture assumes you are building agent loops, not workflow chains. Key concepts: agents (model + instructions + tools), handoffs (agents delegating to other agents), guardrails (input/output safety checks), and sessions (automatic conversation history).
What it is good at: rapid prototyping of agent loops, human-in-the-loop patterns built in, session management out of the box, and the lightest cognitive load of any framework here.
What it is not: a workflow orchestrator. If you need deterministic state machines, prompt chaining with if-statements, or multi-provider fallback routing, this is the wrong tool. It expects you to use agent handoffs for control flow, not pre-written DAGs.
CrewAI
CrewAI (52.4k stars) positions itself as the multi-agent automation framework. It is built from scratch — explicitly not wrapping LangChain — and optimises for collaborative agent teams with role-based design.
CrewAI has two layers: Crews for autonomous multi-agent collaboration and Flows for enterprise-grade event-driven orchestration. A Crew defines roles (researcher, writer, reviewer), assigns tools, and lets agents converse to produce output. A Flow gives you granular control over task sequencing, single-LLM-call optimisation, and natively embeds Crews.
What it is good at: multi-agent teams where agents need distinct roles and tools, rapid prototyping of collaborative workflows, and the CrewAI Cloud platform for no-code management.
What it is not: a general-purpose model-calling library. CrewAI’s abstraction assumes you want agents working together, not a single agent loop. If you need a straightforward tool-using agent without multi-agent collaboration, you pay for complexity you will not use.
AutoGen (and Microsoft Agent Framework)
AutoGen (58.5k stars) from Microsoft is now in maintenance mode. No new features. Community-managed going forward. Microsoft’s official successor is Microsoft Agent Framework (MAF), which reached 1.0 in early 2026 and provides enterprise-grade multi-agent orchestration with A2A (Agent-to-Agent) and MCP interoperability.
AutoGen pioneered the multi-agent conversation pattern — agents talking to each other in a group chat to solve tasks — but its architecture showed its age. The maintenance mode status means you should not start new projects on AutoGen. If you are already on it, Microsoft provides a migration guide to MAF.
What MAF is good at: enterprise multi-agent systems with cross-runtime interoperability, A2A protocol for agent-to-agent communication, and multi-provider model support out of the box.
What it is not: a lightweight choice. MAF assumes you are building at organisational scale with multiple agent teams, service-level agreements, and cross-platform deployment.
Comparison by decision criteria
The table below scores each framework on seven dimensions relevant to a team choosing between them. Scores are relative within this group — a 5 means best-in-class among these four, not necessarily ideal for your use case.
| Criterion | LangChain | OpenAI Agents SDK | CrewAI | AutoGen/MAF |
|---|---|---|---|---|
| Ease of first build | 2 — high abstraction depth | 4 — minimal ceremony | 3 — role-based is intuitive | 3 — clear but setup-heavy |
| Production readiness | 5 — LangSmith, tracing, versioning | 3 — tracing built in, but young | 3 — Cloud platform helps | 4 — MAF has enterprise SLAs |
| Multi-agent support | 4 — LangGraph state machines | 3 — agent handoffs | 5 — native role-based teams | 5 — A2A protocol |
| Observability | 5 — LangSmith is mature | 4 — built-in tracing | 3 — Cloud dashboard | 4 — enterprise monitoring |
| Community & ecosystem | 5 — largest by far | 3 — growing fast | 4 — strong docs & training | 2 — transition uncertainty |
| Multi-provider support | 5 — any provider | 3 — primarily OpenAI, 100+ others | 4 — major providers | 4 — major providers |
| Learning curve | 1 — steepest | 4 — shallowest | 3 — moderate | 2 — steep for MAF |
Context: These scores are based on documentation review and GitHub state as of May 2026, not hands-on benchmarking. Provider SDKs and framework releases move monthly — verify current state before committing.
Worked example: customer support triage
To make the architectural difference concrete, here is the same task — routing a customer-support email to the right team — built differently in each framework.
The task
- Read an incoming support email
- Classify it as billing, technical, account, or general
- If billing, check the payment history and respond with next steps
- If technical, search the knowledge base and suggest a fix
- If account, verify the user and escalate to an account specialist
- If general, compose and send an acknowledgement
- Log the outcome to a tracking system
LangChain approach
LangChain handles this as a LangGraph state machine. You define a state schema (email text, classification, tools used, log entries), build a graph with labelled nodes for each step, and compile it.
# Pseudocode — LangGraph state machine pattern
class SupportState(TypedDict):
email: str
classification: str | None
payment_history: list | None
kb_results: list | None
response: str | None
log: list
def classifier_node(state): # LLM call to classify
def billing_node(state): # Check payments + compose
def technical_node(state): # Search KB + suggest fix
def account_node(state): # Verify + escalate
def general_node(state): # Compose ack
def logger_node(state): # Log outcome
# Conditional edge: route by classification
def route_by_type(state):
return state["classification"]
builder = StateGraph(SupportState)
builder.add_node("classify", classifier_node)
builder.set_entry_point("classify")
builder.add_conditional_edges("classify", route_by_type, {
"billing": "billing", "technical": "technical",
"account": "account", "general": "general"
})
# ... add billing→logger, technical→logger, etc.
The graph is traceable, testable, and you can visualise it. The cost is the boilerplate: state definition, node functions, edge wiring, and compilation. A real deployment needs at least 60–80 lines before the actual LLM calls.
OpenAI Agents SDK approach
The Agents SDK handles this with agent handoffs and guardrails. You define a triage agent with tools (classify, search KB, check payments) and specialised agents (billing, technical, account) that the triage agent can hand off to.
# Pseudocode — OpenAI Agents SDK handoff pattern
from agents import Agent, Runner, Guardrail, handoff
triage_instructions = """
Classify the support email you receive.
- If billing, hand off to the billing_agent.
- If technical, hand off to the technical_agent.
- If account, hand off to the account_agent.
- Otherwise, compose a general acknowledgement.
"""
billing_agent = Agent(
name="Billing Agent",
tools=[check_payment_history, compose_billing_response, log_outcome]
)
technical_agent = Agent(
name="Technical Agent",
tools=[search_knowledge_base, compose_technical_response, log_outcome]
)
account_agent = Agent(
name="Account Agent",
tools=[verify_user, escalate_to_specialist, log_outcome]
)
triage_agent = Agent(
name="Triage Agent",
instructions=triage_instructions,
tools=[classify_email, compose_general_response],
handoffs=[billing_agent, technical_agent, account_agent]
)
result = Runner.run_static(triage_agent, incoming_email)
The SDK handles the handoff loop, session management, and tracing automatically. You do not write state machines or edge wiring. The trade-off: you get less control over execution order. The model decides when to hand off, which means you need good guardrails to prevent infinite loops or wrong handoffs.
CrewAI approach
CrewAI models this as a crew of agents with defined roles, goals, and tasks. Each agent has a role description, and tasks are assigned to roles.
# Pseudocode — CrewAI role-based pattern
from crewai import Agent, Task, Crew, Process
triage_agent = Agent(
role="Support Triage Specialist",
goal="Classify incoming support emails accurately",
tools=[classify_email]
)
billing_agent = Agent(
role="Billing Support Agent",
goal="Resolve billing issues by checking payment history",
tools=[check_payment_history, compose_billing_response]
)
technical_agent = Agent(
role="Technical Support Agent",
goal="Diagnose technical issues using knowledge base",
tools=[search_knowledge_base, compose_technical_response]
)
# Define tasks as sequential or hierarchical
tasks = [
Task(description="Classify this email", agent=triage_agent),
Task(description="Resolve based on classification",
agent=billing_agent # conditional routing handled at Crew level
),
Task(description="Log outcome to tracking system",
agent=triage_agent, # fallback logger
)
]
crew = Crew(
agents=[triage_agent, billing_agent, technical_agent],
tasks=tasks,
process=Process.sequential # or Process.hierarchical for routed flows
)
The role-based model is intuitive for teams who think in human organisational terms. The limitation: conditional routing requires either CrewAI’s Flow layer (event-driven architecture) or hierarchical processing, which adds complexity for what LangGraph handles natively with conditional edges.
AutoGen/MAF approach
With Microsoft Agent Framework, you define agent capabilities and let the A2A protocol handle routing and delegation. Each agent registers its capabilities; the system routes tasks by capability matching.
# Pseudocode — MAF A2A pattern (simplified)
from microsoft.agents import AgentHost, Agent
class TriageAgent(Agent):
capabilities = ["email_classification", "general_response"]
class BillingAgent(Agent):
capabilities = ["payment_lookup", "billing_response"]
# MAF handles capability-based routing and delegation
# through the A2A protocol layer
MAF’s strength is in distributed multi-agent systems where agents run on different services and communicate over the A2A protocol. For the single-process customer-support example, it is over-engineered. You use MAF when you need cross-service orchestration, not when you need a straightforward tool-calling loop.
When each framework makes sense
Choose LangChain when
- You need complex, stateful orchestration with visualisable graphs
- You are already invested in LangSmith for observability
- You need integrations with specific vector stores, retrievers, or document loaders that only LangChain wraps
- Your team has the time to learn the abstraction layer
Choose OpenAI Agents SDK when
- You are building single-agent or simple handoff-based systems
- You want the fastest path from idea to running agent
- Human-in-the-loop patterns are a requirement, not an afterthought
- You prefer explicit, readable code over framework abstractions
Choose CrewAI when
- Your use case genuinely needs multiple agents with distinct roles and tools
- You are prototyping collaborative workflows (research→write→review pipelines)
- The role-based mental model matches how your team thinks
- You want a cloud dashboard for non-technical team members
Choose Microsoft Agent Framework when
- You need enterprise-grade cross-service agent orchestration
- Your agents run across different runtimes, services, or clouds
- A2A and MCP interoperability is a hard requirement
- Your organisation already uses Microsoft cloud infrastructure
Do not use any framework when
- A single LLM call with structured output and one tool call solves the problem
- You need a deterministic prompt chain that an if-statement handles
- You are still learning what an agent loop looks like — start with direct API calls first
Methodology
- Data checked: 2026-05-29
- Sources consulted: GitHub repositories for all four frameworks (READMEs, star counts, fork counts), PyPI package descriptions, official SDK documentation, and Anthropic’s “Building effective agents” (Dec 2024)
- Assumptions: All four frameworks evolve monthly. Star counts, API surfaces, and feature sets are a May 2026 snapshot. No hands-on benchmarking was performed — comparisons are based on documentation review and GitHub state, not production deployment experience. JS-rendered documentation for some frameworks could not be fully fetched via server-side HTTP on this check cycle.
- Limitations: This comparison does not cover framework performance under production load, security audit results, integration with specific enterprise infrastructure, or total cost of ownership. AutoGen is in maintenance mode; Microsoft’s successor (MAF) reached 1.0 in early 2026 but has a smaller community track record. OpenAI Agents SDK is the newest framework with the thinnest production track record.
- Jurisdiction: Global. Framework selection guidance is jurisdiction-agnostic. Specific regulatory compliance (EU AI Act, UK Online Safety Act, sector-specific rules) may impose additional agent governance requirements not addressed here.
Source list
- LangChain GitHub repository — https://github.com/langchain-ai/langchain (accessed 2026-05-29)
- CrewAI GitHub repository — https://github.com/crewAIInc/crewAI (accessed 2026-05-29)
- AutoGen GitHub repository — https://github.com/microsoft/autogen (accessed 2026-05-29)
- OpenAI Agents SDK GitHub repository — https://github.com/openai/openai-agents-python (accessed 2026-05-29)
- Anthropic, “Building effective agents” — https://www.anthropic.com/engineering/building-effective-agents (accessed 2026-05-29)
- Microsoft Agent Framework documentation — https://learn.microsoft.com/en-us/azure/ai-services/agents/overview (accessed 2026-05-29)
Related guides
- AI agents vs workflows: a plain-English difference for teams — the conceptual foundation this comparison builds on
- Function calling and tool use: where agents actually fail — the practical pitfalls of tool access that affect every framework
- Building a minimum viable RAG system without overengineering — practical RAG patterns that pair with agent frameworks
- Fallback design: what happens when the AI call fails — essential for any framework-based system
Trust Stack
- Last checked: 2026-05-29
- Corrections: Contact us to report errors
Change log
- 2026-05-29: Full draft written covering LangChain, CrewAI, AutoGen/MAF, and OpenAI Agents SDK with architecture overview, seven-dimension comparison table, and worked customer-support example. Editor’s Notes, Quick Answer, Methodology, Source list, and Trust Stack added during editorial review.