LangGraph, AutoGen, CrewAI, and LlamaIndex — four different bets on how agent systems should be structured, each encoding a fundamentally different theory of control.
The analogy first: imagine you're running a consulting firm. You could organize it as a state machine (every handoff is an explicit flowchart), as a roles-based team (hire specialists, let them self-organize), as a conversation room (everyone talks until done), or as a document assembly line (specialized workers process inputs in sequence). These four metaphors map almost exactly to today's four major frameworks.
The core challenge every framework solves is the same: given an LLM that can only process one context window at a time, how do you decompose a complex long-horizon task into steps, pass information between steps, handle failures, and maintain coherent state? Each framework answers this with a different abstraction.
LangGraph (langchain-ai/langgraph) models agent workflows as a directed graph where nodes are Python functions (or LangChain Runnables) and edges are transitions between them. A single StateGraph object holds a typed TypedDict schema — the global shared state — that every node reads from and writes partial updates back to.
The mechanism: when the graph runs, it starts at the START node, calls the current node function with the full state, merges the returned dict into state via a reducer function (e.g., appending to a list vs. overwriting a field), then follows edges to the next node. Conditional edges are functions that inspect state and return the name of the next node, giving you the equivalent of if/else branches in a visual graph. A special END node terminates execution.
Killer feature: persistent checkpointing via Checkpointer backends (SQLite, Redis, Postgres). Every state transition is saved; you can "time travel" backward to any prior state, replay with modified inputs, or interrupt execution for human-in-the-loop review using interrupt(). This makes LangGraph uniquely suited for long-running, fault-tolerant workflows in production.
CrewAI organizes agents as a crew of specialists with defined roles, goals, backstories, and tool sets. A Crew object holds a list of Agents and a list of Tasks. Each task specifies a description, expected output, and assigned agent. The crew executes tasks sequentially (or in parallel with Process.parallel), with outputs chained as context.
The mechanism: CrewAI uses an internal sequential process by default — each task runs in order, and the output of task N automatically becomes available as context to task N+1. A hierarchical process introduces a manager agent that dynamically assigns tasks to workers, enabling AutoGen-style delegation with CrewAI's declarative interface.
Killer feature: low time-to-working-demo. A functional multi-agent pipeline (researcher → writer → editor) can be running in under an hour with ~20 lines of config-style Python. The role/goal/backstory system leverages LLMs' instruction-following to create specialized behavior without custom prompting.
AutoGen (microsoft/autogen) models multi-agent collaboration as a structured group chat. Agents are ConversableAgent instances that send and receive messages. A GroupChat + GroupChatManager mediates who speaks next — via round-robin, LLM-based speaker selection, or custom logic.
The mechanism: state is implicit — it lives in the conversation history (the running message thread), not in a typed schema. Each agent maintains its own system prompt and can be configured to auto-reply, call tools, generate code, execute code in a sandbox, or terminate the conversation. The LLM's context window is the state management layer.
Important 2025 update: In October 2025, Microsoft announced that AutoGen and Semantic Kernel are merging into the unified Microsoft Agent Framework (github.com/microsoft/agent-framework). AutoGen remains maintained for bug/security fixes but will receive no new features. Enterprise teams are migrating to the new framework.
LlamaIndex (run-llama/llama_index) began as a RAG indexing library and has pivoted to become a platform for agentic document processing. Its core abstraction is the QueryEngine (single document query) and AgentRunner (multi-step reasoning over documents), with a composable pipeline API via QueryPipeline.
The mechanism: LlamaIndex's agents use a task-step execution loop — a Task decomposes into TaskSteps, each producing a TaskStepOutput that may trigger further steps. The framework provides first-class support for structured extraction, OCR pipelines, and document workflows, making it the natural choice when unstructured document data is central to the task.
Differentiator: LlamaIndex's connector ecosystem (150+ data loaders from the LlamaHub) and its production-grade RAG stack (covered in Day 4) make it uniquely powerful for knowledge-intensive agent applications. LlamaDeploy handles async multi-service agent deployments.
There is no universally superior framework — each optimizes for different constraints:
| Framework | Control | Speed to First Demo | Production Readiness | Best For |
|---|---|---|---|---|
| LangGraph | ⬤⬤⬤⬤⬤ | ⬤⬤ | ⬤⬤⬤⬤⬤ | Complex stateful pipelines |
| CrewAI | ⬤⬤⬤ | ⬤⬤⬤⬤⬤ | ⬤⬤⬤⬤ | Multi-role workflows, rapid prototyping |
| AutoGen | ⬤⬤⬤ | ⬤⬤⬤⬤ | ⬤⬤⬤ | Conversational agents, research |
| LlamaIndex | ⬤⬤⬤ | ⬤⬤⬤⬤ | ⬤⬤⬤⬤⬤ | Document-heavy knowledge tasks |
interrupt() API for human-in-the-loop is the most mature in any OSS framework.ConversableAgent + GroupChatManager pattern proved that LLMs could be reliable orchestrators when given explicit termination conditions. The speaker-selection problem it surfaced is now a core research topic.QueryPipeline composability model — connecting data loaders, transformations, and LLM calls as typed DAG nodes — is the cleanest abstraction for document-centric agentic tasks.Anthropic does not publish a proprietary agent framework in the traditional sense. Instead, the Claude API exposes tool use (function calling), computer use, and a raw streaming API that framework authors build on top of. Claude's "orchestration" is provided by frameworks like LangGraph or CrewAI that call the Claude API.
Notable: Claude Code (Anthropic's agentic coding product) implements its own internal hub-and-spoke agent architecture — a central orchestrator agent spawns specialized subagents via the Agent tool (which you're experiencing right now). This architecture is detailed in OpenClaw's SKILL.md documentation and has become a reference design for agentic tool builders.
Recent: The Claude Agent SDK (underlying Cowork and Claude Code) uses a task-based subagent model where each Agent tool invocation creates an isolated context. This is closer to LangGraph's explicit state management model than AutoGen's conversation model.
OpenAI's Agents SDK (open-sourced in 2025) uses a handoff model — agents can transfer control to other agents by calling a special handoff() function. State is passed as a context object. This is conceptually close to CrewAI's sequential task model but with explicit handoff semantics rather than implicit chaining.
Swarm: OpenAI's earlier experimental multi-agent framework (now deprecated in favor of the Agents SDK) proved that minimal abstractions (agents + handoffs + context variables) were sufficient for most multi-agent patterns. The Agents SDK formalizes this minimalist philosophy.
GPT-5-class models: OpenAI's latest models have stronger built-in tool routing, reducing the need for explicit orchestration logic in simple cases — the model itself can decide which tool to call without a supervisor agent.
Google released the Agent Development Kit (ADK) in early 2025 as an open-source Python framework for building multi-agent systems on Gemini models. ADK uses a hierarchical agent model where a root agent can delegate to sub-agents, with built-in integration to Google Cloud services (Vertex AI, BigQuery, Cloud Storage).
Architectural bet: ADK's deep Cloud integration is its moat — if your data and compute already live in GCP, ADK provides the lowest-friction path to production agent deployment. The framework was included in the systematic comparison paper (arXiv:2512.01939) and benchmarked competitively against LangGraph and CrewAI for structured enterprise tasks.
Gemini 2.x long context: Google's 1M-token context window changes the state management calculus — Gemini-based agents can hold significantly more conversation history before context overflow becomes an issue, partially mitigating AutoGen-style conversation model weaknesses.
OpenClaw is the community name for Claude Code's open-source agent architecture, built on Anthropic's Claude Agent SDK. Its hub-and-spoke model uses a primary Claude instance as the orchestrator, spawning specialized subagents via the Agent tool for parallelizable work. The SKILL.md system (today's Day 5 prompt is literally running inside this architecture) provides domain-specific instructions injected at agent invocation time.
Framework comparison: OpenClaw's architecture is most similar to LangGraph's explicit orchestration model — the orchestrator has deterministic control over when subagents are spawned and how results flow back — but without the typed state schema. Context passing is via natural language in the Agent tool's prompt parameter rather than a structured dict.
Security note: The December 2025 security report identified 9 CVEs and 1,184 malicious skills in the OpenClaw plugin ecosystem — a reminder that any framework with third-party plugin/tool extensibility inherits the supply chain risk of those extensions. (More in Day 14.)
TypedDict schema defining the shared state, then compiled to a runnable with .compile(checkpointer=...).messages field uses add_messages to append rather than overwrite, giving us a persistent conversation trace across nodes."Annotated[list, operator.add] for append semantics, or left as a plain type for overwrite semantics. Controls whether state accumulates or is replaced.tool_calls, each node would overwrite prior tool results instead of accumulating them."handoff(target_agent, context) value; the SDK routes the conversation to the target agent with the provided context. Distinct from a tool call — a handoff terminates the current agent's turn.interrupt() in a node function and graph.invoke(Command(resume=human_input)) to continue. State is checkpointed during the pause, enabling fault-tolerant interruptions.add_conditional_edges(source_node, routing_function, {"route_name": target_node}). The routing function returns a string key that maps to a target node name.end if no tools were called, or back to tool_executor if tool calls are pending."QueryComponent interface; edges define how output types map to input types. Supports both synchronous and async execution.Framework wars are vocabulary wars. The engineers debating LangGraph vs. CrewAI are mostly debating how much explicit control they want over state transitions. Once you internalize that the entire framework landscape is answering the single question — "how should state be managed across agent steps?" — you can navigate any new framework in minutes by asking: where does state live, how does it get updated, and what controls the transitions?