EXPLAINER

How to Choose an Agent Framework

Choose an agent approach by category: direct API loops, prompt/orchestration helpers, tool-calling loops, multi-agent graphs, or vendor SDKs. Named libraries illustrate categories; pick based on needs, and know when a framework is unnecessary.

Short answer: To choose an agent framework, match category to need (direct API, orchestration helper, tool loop, multi-agent graph, vendor SDK). There is no universal winner — and sometimes you should use none.

What is it?

"Which framework can I use for an AI agent?" is really "which approach fits this job?". An agent needs a loop: model proposes, tools run, results return (Agent Tools: How AI Agents Take Actions). Frameworks package that loop differently. This guide maps categories and well-known examples as illustrations — not as a ranking or endorsement.

Why it matters

Picking by popularity alone adds dependencies and opaque failure modes. Picking by category keeps the decision reversible and clarifies when direct integration is enough.

How to do it

Categories

  1. Direct model/API integration — your code calls the HTTP API and implements the tool loop. Maximum clarity; you own retries and memory.
  2. Prompt / orchestration helper — light libraries that template prompts, parse outputs, or stream to UIs (example often cited: Vercel AI SDK for JS UI streaming helpers).
  3. Tool-calling loop frameworks — register tools, let the library run model↔tool cycles (examples often cited: LangChain, Semantic Kernel).
  4. Retrieval-centric frameworks — strong document index + query abstractions (example often cited: LlamaIndex).
  5. Multi-agent graphs — explicit roles and handoffs between agents (examples often cited: CrewAI, AutoGen patterns, graph orchestrators).

Decision steps

  • Write the happy path in pseudocode with no library.
  • If it is under ~100 lines and stable, stay direct.
  • If you need shared tool schemas across services, compare frameworks that emphasise tools/MCP.
  • If you need retrieval over many docs, prefer retrieval-centric tools or plain What is RAG (Retrieval-Augmented Generation)?.
  • If you need multiple specialised roles, consider multi-agent patterns (Multi-Agent Systems Explained) — framework optional.
  • Check licence, community pace, observability and how hard vendor lock-in would be.

When a framework is unnecessary

  • One prompt in, one answer out.
  • A single tool call with validation you already wrote.
  • Learning exercises — raw API teaches the real protocol.
  • Strict compliance environments that require every hop to be obvious in your code.

Example

NeedLean approachFramework category to evaluate
Chat UI with streamingNode proxy + ReactOrchestration/UI helper
Support bot with 3 internal APIsDirect Function Calling (Tool Calling) Explained loopTool-calling framework if tools multiply
Q&A over docs[[rag-with-pythonRAG script]]Retrieval-centric framework at scale
Researcher + writer roles[[agentic-workflows\Workflow]] with two callsMulti-agent graph library

Always spike a vertical slice before committing the whole codebase.

When to use it

Use this decision process at the start of an agent project and again when the tool count or team size jumps. Revisit if debugging the framework takes longer than debugging your domain bugs.

Common mistakes

  • Declaring a "winner" framework for all projects.
  • Confusing a vendor SDK with an orchestration framework.
  • Adopting multi-agent graphs for a single workflow with one prompt.
  • Ignoring evaluation (How to Evaluate AI Systems and Outputs) while debating libraries.