Choosing an Agent Framework
A practical comparison of the major options — provider agent SDKs, LangGraph, LlamaIndex, CrewAI, and writing your own — and how to choose.
By now you've built an agent loop, tools, an orchestrator, subagents, parallel workers, critic loops, ensembles, handoffs, and an A2A endpoint, all in plain TypeScript. That's deliberate: you now understand what every agent framework does underneath. It also raises the obvious question: should your next project use a framework, and if so, which?
There's no universal winner. This lesson gives you a fair map of the major options as they stand in late 2026: the provider SDKs from Anthropic and OpenAI, LangGraph, LlamaIndex, CrewAI, Google's ADK, Microsoft Agent Framework, and Hugging Face's smolagents, plus the option of writing your own. You'll learn what each is genuinely good at, the hidden costs of any framework, and a short bake-off process for choosing with evidence instead of hype.
What a framework actually gives you
Every agent framework packages some of the same pieces you've already built by hand:
| Piece | Where you built it |
|---|---|
| The agent loop and stop conditions | A Minimal Agent Loop, Error Handling |
| Tool definitions, validation, and errors | Adding Real Tools, Validating Tool Inputs |
| Streaming and events | Streaming and UX |
| Memory and persistence | Adding Memory |
| Cost tracking and budgets | Prompt Caching and Cost Tracking |
| Multi-agent orchestration | This module |
| Tracing and evals | Tracing and Observability |
Frameworks differ in which of these they emphasize and how much they decide for you. They fall into four families:
- Provider agent SDKs (Claude Agent SDK, OpenAI Agents SDK). Built by model companies, tuned for their own models, focused on making one capable agent easy.
- Orchestration frameworks (LangGraph, Microsoft Agent Framework, Google ADK). Explicit control flow across many steps and agents, with state and human approval built in.
- Role-based team frameworks (CrewAI). You describe agents as roles with goals and assign them tasks; the framework coordinates them.
- Specialists (LlamaIndex for documents and data, smolagents for agents that act by writing code).