In the LangGraph vs CrewAI choice, LangGraph is for long-running, branching workflows where you need explicit control, checkpoints and human approval steps. CrewAI is for describing a team of role-based agents and getting a working multi-agent prototype quickly. The OpenAI Agents SDK sits between them: a small set of primitives (agents, tools, handoffs, guardrails, sessions) with very little ceremony. All three are open-source Python libraries, all three are free at the library level, and all three can call models from more than one provider.

This guide compares them on the points that decide real projects. It includes short, runnable code for each, and covers what happened to AutoGen, since many searches still pair it with these three. Versions referenced are current on PyPI as of October 5, 2026: langgraph 1.2.13, crewai 1.15.23 and openai-agents 0.23.1. One practical note if you want to try all three: those crewai and openai-agents releases require different major versions of the openai package (below 3 and 3 or later), so install them in separate virtual environments.

LangGraph vs CrewAI vs OpenAI Agents SDK at a glance

ItemLangGraphCrewAIOpenAI Agents SDK
Mental modelA state graph of nodes and edgesA crew of agents with roles, goals and tasks, plus FlowsAgents that use tools and hand off to other agents
Control over flowExplicit: branches, loops, conditional edgesSequential or hierarchical crews; event-driven FlowsThe agent loop decides; you shape it with handoffs
Durable stateCheckpointers persist state at each stepFlow state persistence with @persistSessions persist conversation history
Human-in-the-loopInterrupts that pause and resume a graphHuman input and feedback in crews and FlowsBuilt-in human-in-the-loop mechanisms
ModelsAny, via LangChain integrationsNative provider SDKs, or LiteLLMOpenAI by default; non-OpenAI providers supported
LanguagesPython and JavaScript/TypeScriptPythonPython and JavaScript/TypeScript
Learning curveSteepestGentleGentlest
LicenseMITMITMIT

In plain terms, LangGraph gives you the most control and asks the most of you. CrewAI gives you the friendliest abstraction for teams of agents. The OpenAI Agents SDK gives you the thinnest layer over a tool-calling loop.

LangGraph: explicit control for production workflows

LangGraph describes itself as a low-level orchestration framework for building, managing and deploying long-running, stateful agents. You define a typed state, write nodes as functions that update it, and connect them with edges, including conditional edges that route on the current state.

from typing import TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.checkpoint.memory import InMemorySaver

class State(TypedDict):
    draft: str
    approved: bool

def write(state: State) -> dict:
    return {"draft": "Refund approved for order 1042."}

def route(state: State) -> str:
    return "send" if state.get("approved") else "review"

def review(state: State) -> dict:
    return {"approved": True}

def send(state: State) -> dict:
    print("sending:", state["draft"])
    return {}

g = StateGraph(State)
g.add_node("write", write)
g.add_node("review", review)
g.add_node("send", send)
g.add_edge(START, "write")
g.add_conditional_edges("write", route, ["send", "review"])
g.add_edge("review", "send")
g.add_edge("send", END)

app = g.compile(checkpointer=InMemorySaver())
app.invoke({"draft": "", "approved": False}, {"configurable": {"thread_id": "ticket-1042"}})

In a real agent, write would call a model and review would be an interrupt that waits for a person. The checkpointer saves state after each step under the thread_id, which is what gives LangGraph durable execution: a crashed or paused run resumes where it stopped. Swap InMemorySaver for a database-backed checkpointer in production.

Strengths: Fine-grained control over loops and branches. First-class interrupts for human approval. Short-term and long-term memory. A JavaScript version. Deployment and tracing through LangChain's commercial LangSmith platform, which is optional.

Weaknesses: More code and more concepts before your first result. For quick agents, LangChain itself now points people to Deep Agents, a higher-level package built on LangGraph, or to the create_agent helpers in LangChain.

CrewAI: role-based teams, fast

CrewAI has two layers. Crews are teams of agents, each with a role, a goal and a backstory, that work through tasks sequentially or under a manager agent. Flows add event-driven, stateful orchestration around crews when you need precise control.

from crewai import Agent, Task, Crew, Process

researcher = Agent(
    role="Researcher",
    goal="Find accurate, current facts about the topic",
    backstory="A careful analyst who cites sources.",
)
summary = Task(
    description="Summarize the state of {topic} in 2026.",
    expected_output="Three bullet points with sources.",
    agent=researcher,
)
crew = Crew(agents=[researcher], tasks=[summary], process=Process.sequential)
result = crew.kickoff(inputs={"topic": "agent sandboxes"})

Strengths: The role, goal and task vocabulary is easy for non-specialists to read and review. Prototyping is fast. Flows add state persistence and human feedback when a prototype needs to become a dependable process. Its LLM docs cover native provider SDKs, and LiteLLM is optional.

Weaknesses: When agents collaborate freely, behavior is harder to predict and debug than an explicit graph. Tight control means moving logic into Flows, which narrows the gap with LangGraph.

OpenAI Agents SDK: minimal primitives

The OpenAI Agents SDK is OpenAI's production successor to its earlier Swarm experiment. Its documentation lists a deliberately small set of primitives: agents with instructions and tools, agents as tools or handoffs, guardrails, sessions, human-in-the-loop, and built-in tracing. Newer additions include sandbox agents that work inside an isolated workspace, and realtime voice agents.

from agents import Agent, Runner

billing = Agent(name="Billing", instructions="Handle refunds and invoices.")
triage = Agent(
    name="Triage",
    instructions="Answer general questions; hand billing issues to Billing.",
    handoffs=[billing],
)
result = Runner.run_sync(triage, "I was charged twice for order 1042.")
print(result.final_output)

Strengths: You can get a working multi-agent system with the least code. Tracing is built in. Function tools get automatic schemas. It integrates with MCP servers.

A common misconception: Many comparison posts say the SDK only works with OpenAI models. Its documentation has a section on non-OpenAI models, with third-party adapters including LiteLLM and Any-LLM. OpenAI models are the default and the best-supported path, but they aren't the only option.

Weaknesses: Fewer orchestration primitives than LangGraph. Long-running workflows that must survive crashes need you to design persistence around sessions and run state. Some hosted tools work only with OpenAI models.

What happened to AutoGen?

The AutoGen repository now carries a maintenance-mode notice: no new features, and community management going forward. Microsoft points new users to Microsoft Agent Framework, its successor to both AutoGen and Semantic Kernel. Microsoft Agent Framework supports Python and .NET (with a separate Go SDK), graph-based workflows with checkpointing and human-in-the-loop, and interoperability through MCP and A2A. Its Python package is agent-framework, version 1.20.0 as of early October 2026. If you are starting fresh in the Microsoft ecosystem, evaluate Agent Framework rather than AutoGen.

Other frameworks worth a look

  • Pydantic AI: A type-safe agent framework from the Pydantic team, where any model is a string swap away. A good fit if your codebase already relies on Pydantic models and you want validated, structured outputs.
  • Google Agent Development Kit (ADK): A code-first framework with a graph-based workflow runtime and agent-to-agent delegation, tuned for Gemini and Google Cloud but model-agnostic.

For TypeScript teams, see our separate guide to the best TypeScript AI agent frameworks.

How to choose

  1. Map your failure modes first. If a run must survive a crash, wait hours for a human, or follow strict branching rules, start with LangGraph.
  2. If the problem is naturally "a team of specialists", such as a researcher, a writer and a reviewer, CrewAI gets you there with the least friction.
  3. If you want the least framework, and are happy to compose behavior in plain Python, use the OpenAI Agents SDK.
  4. Prototype in one, productionize in another is a common and reasonable path. The tools and prompts you write mostly carry over.
  5. Standardize tools with MCP. All three can consume MCP servers, so build integrations once. See how to build an MCP server in Python.

Pros and cons summary

LangGraph. Pros: maximum control, durable execution, interrupts, Python and JS. Cons: steeper learning curve, more boilerplate.

CrewAI. Pros: fastest to a working multi-agent prototype, readable role and task model, Flows for structure. Cons: emergent collaboration is harder to debug.

OpenAI Agents SDK. Pros: smallest API, built-in tracing and guardrails, sandbox and voice agents. Cons: fewer orchestration primitives, and the best experience is with OpenAI models.

Related guides: to add long-term memory beyond each framework's built-in store, see AI agent memory: Mem0 vs Letta vs Zep. For tools that give agents web access, see Tavily vs Exa vs Firecrawl.

FAQ

Is LangGraph better than CrewAI?

Not universally. LangGraph is better when you need explicit control over branching, loops, checkpoints and human approval. CrewAI is better when your problem maps onto a team of role-based agents and you want a prototype fast. Many teams use CrewAI to explore and LangGraph for critical production paths.

Does the OpenAI Agents SDK work with Claude or Gemini?

Yes, through its non-OpenAI model support, including adapters such as LiteLLM and Any-LLM. OpenAI models remain the default and most fully supported option, and some hosted tools require them.

Is AutoGen still maintained?

AutoGen is in maintenance mode. It no longer receives new features and is community managed. Microsoft recommends Microsoft Agent Framework for new projects and provides a migration guide.

Are LangGraph, CrewAI and the OpenAI Agents SDK free?

The libraries are open source under the MIT license and free to use. You pay for model usage, plus any optional hosted services, such as LangSmith for LangGraph or CrewAI's commercial platform.

Which agent framework is easiest for beginners?

The OpenAI Agents SDK has the fewest concepts to learn, and CrewAI's roles and tasks are intuitive for non-specialists. LangGraph takes longer to learn but pays off when workflows get complex.