Choosing a framework
How to compare agent frameworks: what layer each occupies, which problems each is built for, and a short list of questions that decide the choice.
Frameworks differ in kind
“Agent framework” covers tools that sit at different layers. LangChain’s own docs separate three: a runtime (LangGraph) for durable execution, streaming, human-in-the-loop and persistence; a framework for model, tool and agent-loop abstractions; and a harness (Deep Agents) that adds planning, subagents, file tools and context management on top2. Comparing a runtime with a harness is like comparing a database with an application.
Diagram: my own. The layer names follow the split LangChain describes in 2; other vendors draw the lines differently.
What each is built for
A quick orientation, drawn from each project’s own documentation. Details are in the linked notes.
| Option | Core idea | Notes |
|---|---|---|
| LangGraph | Graphs of shared state, nodes and edges with checkpointing2 | Low-level; strong on durability and human-in-the-loop |
| OpenAI Agents SDK | Small set of primitives: agents, handoffs, guardrails, sessions, tracing3 | Lightweight |
| Claude Agent SDK | Claude Code’s agent loop and tools as a library4 | Strong for coding and file work |
| Google ADK | LLM agents plus Sequential, Parallel and Loop workflow agents5 | Multi-language |
| CrewAI | Agents, crews and flows6 | Role-based teams plus event-driven flows |
| Pydantic AI | Typed agents with dependency injection and validated output7 | Python, type-focused |
Questions that decide it
Diagram: my own rough guide, not a ranking.
- Do you need durable, resumable state? Long-running work and human approval pauses favour a runtime with checkpointing.
- Is the work mostly code or files? A harness with built-in file and shell tools saves building them.
- Is the control flow fixed or model-chosen? Workflow-style primitives suit fixed paths; agent loops suit open-ended ones (Workflows versus agents).
- Which model providers must you support? Some SDKs are tied to one provider by default; check how model-agnostic each really is.
- How will you test and trace? Look for built-in tracing, and for testability such as typed dependencies you can fake.
- How much of the framework can your team read? Anthropic’s advice is to understand what is under the hood1.
- Language and deployment. Python, TypeScript, Go and Java support differ by project.
Cautions
- The field moves quickly. Names, APIs and recommended patterns change within months. Check each project’s current docs before committing; I have kept the claims here to ones the docs make.
- Lock-in is mostly in your prompts and tools, not the loop. Keep tool implementations and prompts portable and the framework swap is cheaper.
- Pilot on a thin slice. Build one real workflow in your top two candidates and compare effort, traces and failure behaviour. Measure with the same eval set.
- Do not use several at once without a reason; each adds its own abstractions.
If none of this decides it, build without one (Building without a framework) and revisit.
Sources
- [1]Building effective agents — Anthropic · 2024PARAPHRASED
- [2]LangGraph overview — LangChain docsPARAPHRASED
- [3]OpenAI Agents SDK — OpenAIPARAPHRASED
- [4]Agent SDK overview — Anthropic, Claude Code docsPARAPHRASED
- [5]Agent Development Kit docs — GooglePARAPHRASED
- [6]CrewAI documentation — CrewAIPARAPHRASED
- [7]Pydantic AI — PydanticPARAPHRASED