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
- Direct model/API integration — your code calls the HTTP API and implements the tool loop. Maximum clarity; you own retries and memory.
- 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).
- Tool-calling loop frameworks — register tools, let the library run model↔tool cycles (examples often cited: LangChain, Semantic Kernel).
- Retrieval-centric frameworks — strong document index + query abstractions (example often cited: LlamaIndex).
- 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
| Need | Lean approach | Framework category to evaluate | |
|---|---|---|---|
| Chat UI with streaming | Node proxy + React | Orchestration/UI helper | |
| Support bot with 3 internal APIs | Direct Function Calling (Tool Calling) Explained loop | Tool-calling framework if tools multiply | |
| Q&A over docs | [[rag-with-python | RAG script]] | Retrieval-centric framework at scale |
| Researcher + writer roles | [[agentic-workflows\ | Workflow]] with two calls | Multi-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.