Skip to content
← All articles

AI Agent Frameworks Compared

A factual comparison of LangGraph, CrewAI, AutoGen, and the OpenAI Agents SDK across control flow, state handling, human-in-the-loop support, and maturity.

Illustration generated for Neuricon.

Oct 13, 2026 · 7 min read

#guide#ai

How this comparison is organized

This guide compares four frameworks on four dimensions: control flow, state handling, human-in-the-loop support, and maturity. It closes with a note on LlamaIndex Workflows, which takes a different event-driven shape. Nothing here ranks the frameworks. Each makes a different trade between explicitness and convenience.

LangGraph

LangGraph models agent behavior as a state machine. You define a graph of nodes, where each node is a function that reads and writes a shared state object. Edges connect the nodes, and conditional edges let the graph branch at runtime based on the current state. Cycles are first class: a node can edge back to an earlier node, which is what makes retry loops and tool-calling loops expressible without special casing.

State is explicit. You declare it as a TypedDict, and nodes return partial updates that LangGraph merges with reducers. The common pattern is an append reducer for the message list, so history accumulates instead of being overwritten. After every node execution, a checkpointer persists the full state. Checkpointers range from in-memory and SQLite for development to Postgres for production, and they are what make a run resumable after a crash.

Human-in-the-loop is a built-in primitive. The graph can interrupt at a node boundary, hand the current state to your application, and wait. When the human responds, the graph resumes with Command(resume=...). Interrupts and crash recovery use the same checkpoint mechanism, so a run that pauses for approval and a run that survives a restart are handled the same way.

LangGraph ships a prebuilt agent loop (create_react_agent) for the standard tool-calling pattern, but its defining use case is explicit, auditable control flow: the developer draws the graph, the model acts within it.

CrewAI

CrewAI takes a role-based approach. Each agent is defined with a role, a goal, a backstory, and a set of tools. Work is organized into tasks, each carrying a description, an expected output, and an assigned agent. A Crew bundles agents and tasks together, and crew.kickoff() runs the whole thing. A minimal crew is about fifteen lines of Python.

```python

from crewai import Agent, Task, Crew, Process

researcher = Agent(

role="Senior Research Analyst",

goal="Discover cutting-edge developments in AI",

backstory="You are an expert analyst with a keen eye for emerging trends.",

tools=[search_tool],

verbose=True,

)

research_task = Task(

description="Research the latest developments in {topic}. Find 5 key trends.",

expected_output="A detailed report with 5 bullet points on key trends.",

agent=researcher,

)

crew = Crew(

agents=[researcher],

tasks=[research_task],

process=Process.sequential,

)

result = crew.kickoff(inputs={"topic": "AI Agents"})

```

Control flow is declarative. Tasks run sequentially by default, with the output of one task fed as context into the next. A hierarchical process is also available, where a manager agent delegates and reviews work. CrewAI also offers Flows, an event-driven pipeline primitive, for production paths that need predictable step-by-step execution without autonomous delegation.

State is implicit rather than explicit. Task outputs pass between agents as context, and the framework provides short-term, long-term, and entity memory without requiring you to wire it up. This is the framework for teams that want a multi-agent system running quickly and do not need to inspect or branch on every message exchanged between agents.

AutoGen

AutoGen is Microsoft's framework for conversational multi-agent systems. Its core idea is that agents collaborate by talking to each other. The higher level AgentChat layer provides ready-made agent types: AssistantAgent for LLM-driven behavior with tools, UserProxyAgent as the stand-in for a human participant that can also execute code, and CodeExecutorAgent for running generated code. Agents are grouped into teams that manage who speaks when: RoundRobinGroupChat takes turns in fixed order, SelectorGroupChat lets a model pick the next speaker dynamically, Swarm hands control between agents, and GraphFlow runs a directed workflow.

Runs end on termination conditions such as a maximum message count, the mention of a stop phrase, or a token usage limit. Beneath AgentChat sits the Core layer, an event-driven runtime built on an actor model with typed messages and publish-subscribe topics, for developers who want to build custom agents from scratch.

For human-in-the-loop, the UserProxyAgent is the mechanism: it can be configured to request human input during the conversation, so approval and guidance arrive as ordinary messages in the chat. Status note: as of 2026, reporting indicates that active development has moved to the Microsoft Agent Framework as AutoGen's successor. Check the repository before starting new work on AutoGen.

OpenAI Agents SDK

The OpenAI Agents SDK is a Python package (pip install openai-agents) built around a small set of primitives. An Agent pairs a language model with instructions and tools. The Runner executes the agent loop, with Runner.run() for async code and Runner.run_sync() for scripts. The result carries final_output, which is a plain string unless the agent declares a structured output type.

```python

from agents import Agent, Runner, function_tool

@function_tool

def get_weather(city: str) -> str:

"""Get weather for a city."""

return f"Weather in {city}: Sunny, 72F"

agent = Agent(

name="Weather Bot",

instructions="Help with weather questions",

tools=[get_weather],

)

result = Runner.run_sync(agent, "What's the weather in NYC?")

print(result.final_output)

```

Multi-agent work uses handoffs: one agent transfers the entire conversation to a specialist agent, which then owns the turn. Guardrails run checks on inputs, outputs, and individual tool calls, and can trip a halt when something violates policy. Sessions, such as the SQLite-backed session, persist conversation history across separate Runner calls so memory survives between turns.

The SDK is the thinnest layer of the four. It assumes the OpenAI platform underneath and focuses on making single-agent loops, delegation, and guardrails easy to express. Provider flexibility comes through LiteLLM integration or OpenAI-compatible model clients rather than through the SDK itself.

A note on LlamaIndex workflows

LlamaIndex takes an event-driven approach through its standalone workflows package. Logic is split into steps, which are async methods decorated with @step. Steps consume and emit typed events: StartEvent begins the run, user-defined events carry data between steps, and StopEvent ends it. Routing is inferred from event type hints rather than declared as edges, and a Context object shares state between steps. The higher-level FunctionAgent and AgentWorkflow abstractions are built on this foundation. It fits well when the system already uses LlamaIndex for retrieval and the agent logic is a structured pipeline around it.

Head to head on the four dimensions

Control flow. LangGraph: explicit graph with developer-defined nodes, edges, and conditional branches. CrewAI: declarative tasks with sequential or hierarchical processes; delegation decisions are model-mediated. AutoGen: conversation between agents with speaker selection policies. OpenAI Agents SDK: agent loop with handoffs routing between specialists. LlamaIndex: event-driven steps with routing by event type.

State handling. LangGraph: explicit shared state with reducers and checkpointer persistence after every step. CrewAI: implicit, via task context passing and built-in memory. AutoGen: conversation history within teams; typed messages in the Core layer. OpenAI Agents SDK: per-run context plus Sessions for cross-run conversation memory. LlamaIndex: Context object shared between steps.

Human-in-the-loop. LangGraph: interrupts at node boundaries with resume via Command(resume=...). AutoGen: UserProxyAgent configured to request human input mid-conversation. OpenAI Agents SDK: approval flows are typically built as tool-level confirmation or a handoff to a human-approval step, using guardrails and sessions for the plumbing. CrewAI: no dedicated HITL primitive surfaced in the material reviewed; teams usually gate kickoff() behind their own approval step.

Maturity. LangGraph is established in production agent systems, with durable execution as its defining feature. CrewAI is a popular high-level option with a lean footprint. AutoGen is the established Microsoft framework whose new work points to the Microsoft Agent Framework. The OpenAI Agents SDK is the official lightweight option, tied to the OpenAI platform. LlamaIndex Workflows is actively developed alongside the LlamaIndex ecosystem.

Choosing one

Start from the shape of your problem. LangGraph suits work where every step must be visible, pausable, and resumable. CrewAI's role-based crews get a multi-agent system running fastest. AutoGen's chat model fits tasks that are genuinely conversational. The OpenAI Agents SDK is the smallest layer that works for single agents with handoffs on the OpenAI platform. LlamaIndex Workflows keeps orchestration next to the data layer for retrieval-heavy pipelines. Underneath, they all run the same plan act observe cycle.

Comments

Loading comments…

Leave a comment

Posting as (guest — sign in for a profile)