Agent Frameworks
Which framework to choose?
Want to build a serious AI agent? There are dozens of frameworks, and each pulls you in a different direction. In this guide we sort out the top five — LangGraph, CrewAI, Claude Agent SDK, AutoGen and Pydantic AI — explain when each one wins, and show when it is better to build an agent with no framework at all.
Why you even need a framework for agents
You can build a simple agent with direct API calls to the model. But the moment the agent needs a loop of decisions, tool use, memory, error handling and coordination between several agents — you find yourself rewriting the same infrastructure others already wrote. A framework gives you that infrastructure: state management, tool calling, streaming, and sometimes built-in observability too.
The question is not "whether" but "which" — because each framework makes a different tradeoff between control (how much you define by hand) andspeed (how much works out of the box). This is the main axis we will distinguish along:
Comparison table — at a glance
| Framework | Approach | Best for |
|---|---|---|
| LangGraph | An explicit State graph | Complex agents in production |
| CrewAI | Role-based, Crews | Fast multi-agent |
| Claude Agent SDK | A built-in agent loop | Coding & computer agents |
| AutoGen / Agent Framework | Conversations between agents | Research & the Microsoft stack |
| Pydantic AI | Type-safe, Pythonic | Reliability & structured output |
LangGraph — full control via a graph
LangGraph (from LangChain) represents the agent as adirected graph: nodes are steps, edges are transitions, and state passes between them. You define exactly when the agent moves to which step, including loops, conditional routing and human stop points.
- Persistent state + Checkpointing — saving state between runs, rewinding to a point and time-travel debugging.
- Human-in-the-Loop — a built-in stop for human approval before a critical action.
- Suits — complex production agents that require precise control, loops and reflection. A steeper learning curve.
LangChain is the broad toolkit (models, chains, RAG). LangGraph is the dedicated layer foragents on top of it. If you learned LangChain in theprevious guide, LangGraph is the natural next step for serious agents.
CrewAI — a crew of agents with minimal code
CrewAI takes a completely different approach: instead of programming a flow, you define a crew (Crew) of agents — each with a role, goal and backstory — and Tasks. The framework coordinates between them, sequentially or hierarchically. This is the fastest way to stand up a working Multi-Agent System.
- Role-based agents — Researcher, Writer, Reviewer — each an "expert" in its domain, phrased in natural language.
- Sequential / Hierarchical — execution in order, or a manager agent that delegates in real time.
- Suits — fast prototypes and workflows with a clear division of roles. Less low-level control over each step.
Claude Agent SDK, AutoGen and Pydantic AI
Claude Agent SDK
Anthropic's SDK provides the same agent loop that powers Claude Code — including tool use, subagents, context management and an MCP connection — as infrastructure for building your agent. The natural choice for coding and computer agents, and for those built around Claude models. See also the Claude Code guide.
AutoGen / Microsoft Agent Framework
The Conversations between agents conversational multi-agent approach. In 2026 Microsoft merged AutoGen with Semantic Kernel into theMicrosoft Agent Framework — an enterprise solution with multi-agent orchestration and enterprise features. The natural choice for those working in .NET / Azure.
Pydantic AI
A modern Pythonic framework that emphasizes type-safety and structured output. If you love the FastAPI developer experience and want a reliable agent with strong output validation — Pydantic AI will feel like home.
How to choose — a quick decision tree
For a simple agent — a loop of a model call + tools — direct code with the provider's SDK is usually enough. A framework adds value when there is real complexity (state, multi-agent, HITL). All the frameworks supportMCP for tools andA2A for communication between agents — so the choice of protocols is not locked to the choice of framework.