How to Choose an Agent Framework
The agent framework landscape has fragmented fast. This guide maps common requirements to specific frameworks so you can narrow down candidates before reading documentation or running benchmarks.
Five questions to narrow your choice
What is your primary language?
Most frameworks support Python. For TypeScript: LangChain, LangGraph, LlamaIndex, OpenAI Agents, Vercel AI SDK, Mastra, A2A Protocol. For C#/.NET: Semantic Kernel, AutoGen.
Do you need multiple agents working together?
Yes — consider CrewAI (role-based), AutoGen (conversation-based), LangGraph (graph-based), or Google ADK. No — start with LangChain, OpenAI Agents SDK, or PydanticAI.
Is retrieval (RAG) your core feature?
Yes — LlamaIndex or Haystack. Both are built around ingestion and retrieval pipelines with strong evaluation utilities.
Are you locked to a specific LLM provider?
OpenAI: OpenAI Agents SDK or Swarm. Anthropic: Claude Code SDK. Google: Google ADK. Any provider: LangChain, PydanticAI, LlamaIndex, CrewAI.
How much abstraction do you want?
Low abstraction: PydanticAI, smolagents, Instructor, OpenAI Swarm, Vercel AI SDK. Medium: CrewAI, OpenAI Agents SDK, Mastra. High: LangChain, LangGraph, Semantic Kernel.
If you need X, use Y
Use-case to framework mappings based on features, community adoption, and design philosophy.
If you need
General-purpose agents with tool calling
Primary
LangChainWhy / Alternatives
Broadest ecosystem, most integrations, extensive documentation. Good default if you are unsure.
If you need
Multi-agent collaboration with role definitions
Primary
CrewAIWhy / Alternatives
Role-based agents with natural delegation semantics. Easy to understand and extend for team-structured tasks.
If you need
Stateful graph-based orchestration
Primary
LangGraphWhy / Alternatives
Directed graphs with conditional edges and checkpointing. Best when you need precise control over agent state transitions.
If you need
RAG pipelines and document retrieval
Primary
LlamaIndexIf you need
Enterprise .NET / C# integration
Primary
Semantic KernelWhy / Alternatives
First-class C#, Python, and Java support. Designed for enterprise integration with plugins, planners, and Azure OpenAI.
If you need
Minimal abstraction, type-safe agents
Primary
PydanticAIWhy / Alternatives
Pydantic-native structured output with dependency injection. Ideal if you want control without heavy abstractions.
If you need
Code-executing agents
Primary
smolagentsWhy / Alternatives
Agents write and execute Python code rather than JSON tool calls. Effective for tasks that benefit from programmatic reasoning.
If you need
Web browsing and computer use
Primary
Browser UseWhy / Alternatives
Purpose-built for autonomous web navigation with vision and DOM interaction modes.
If you need
Long-term memory and persistent state
Primary
Letta (MemGPT)If you need
Official OpenAI model integration
Primary
OpenAI Agents SDKWhy / Alternatives
Official SDK with native handoffs, guardrails, and tracing. Lightweight and opinionated — best if you are committed to OpenAI.
If you need
Google Gemini / Cloud deployment
Primary
Google ADKWhy / Alternatives
First-class Gemini integration with session management and Cloud Run deployment. Evaluation tools included.
If you need
Anthropic Claude, agentic workflows
Primary
Claude Code SDKWhy / Alternatives
Programmatic access to Claude with computer use, extended thinking, and MCP integration. Best for Claude-native workflows.
If you need
Full-stack TypeScript agents
Primary
MastraWhy / Alternatives
TypeScript-native with built-in workflows, RAG, evals, and integrations. Stays in the TS ecosystem end to end without Python dependencies.
If you need
React/Next.js streaming AI UI
Primary
Vercel AI SDKWhy / Alternatives
Purpose-built for React and Next.js with streaming UI hooks, generative UI, and edge runtime support. Unified provider interface for any LLM.
If you need
Prompt engineering and optimization
Primary
DSPyWhy / Alternatives
Programmatic prompt optimization with compile-time tuning. Replaces manual prompt engineering with modular, optimizable signatures.
General guidance
Start with LangChain if you are unsure. It has the largest community, most integrations, and most Stack Overflow answers. You can always migrate specific components to a more focused framework later.
GitHub stars are a lagging indicator. Newer frameworks like PydanticAI and smolagents have lower star counts but are actively maintained with strong design principles. Check commit frequency and issue response times alongside stars.
Test installation before committing. Several frameworks have heavy dependency trees. Run pip install --dry-run and check for conflicts with your existing stack.
Observability matters at scale. LangChain (LangSmith), LangGraph (LangSmith), Agno (built-in monitoring), and OpenAI Agents SDK (built-in tracing) have first-party observability. Others require third-party tools like Langfuse or Weights and Biases.