Skip to main content

The Framework Landscape (LangGraph, CrewAI, smolagents, OpenAI Agents SDK, LlamaIndex)

Introduction

You've spent this whole course learning the ideas — prompting, RAG, tools, memory, agents, multi-agent systems. Now the practical question every builder eventually asks: which framework do I actually build this in? LangGraph? CrewAI? smolagents? An OpenAI or Claude SDK? LlamaIndex? The list grows weekly, and the noise is deafening.

This lesson is the map — not a deep dive into any one tool (those come next), but the landscape: the major frameworks, the one axis that organizes all of them, and a way to choose. And it opens with the answer most tutorials bury:

You may not need a framework at all. A capable agent is a short loop you already know how to write (Section 3). Anthropic's own advice is to start simple and add a framework only when a simpler solution falls short. The framework is a means, not the goal.

In this lesson:

  • Do you even need a framework? — when it helps, when it just adds abstraction
  • The landscape — the four categories of framework (hands-on gallery)
  • The control ↔ convenience spectrum — the single axis that places them all
  • How to choose — by layer of the stack and how much control you need
  • The honest take — frameworks' hidden costs, and where the field is converging

Scope: this is the survey. The deep dives follow — LangGraph, CrewAI, smolagents, the OpenAI Agents SDK, and more get their own lessons next. Builds on the whole agents arc (Sections 3–7) and the protocols MCP (L137–142) and A2A (L146).

An infographic titled 'The Agent Framework Landscape' mapping the major tools for building AI agents in 2026 along a spectrum from maximum control on the left to maximum convenience on the right. On the control end sits LangGraph, an explicit state-machine graph of nodes, edges, and typed shared state with checkpointing and time-travel debugging. Toward the convenient end sits CrewAI, a team of role-playing agents defined by role, goal, and backstory. In between and around them are the other families: smolagents from Hugging Face, a roughly thousand-line code-first library whose CodeAgent writes Python as its actions instead of JSON tool calls; the provider SDKs, the OpenAI Agents SDK with built-in handoffs and the Claude Agent SDK with explicit code-first primitives; LlamaIndex, whose AgentWorkflow layer sits on a data and retrieval backbone; plus lightweight options like Pydantic AI for type safety and the Microsoft Agent Framework that merged AutoGen and Semantic Kernel. The frameworks are grouped into four categories: full-stack frameworks, provider SDKs, lightweight libraries, and data-centric frameworks. A central panel delivers the most important point first: you may not need a framework at all — Anthropic recommends starting with a simple prompt and a short agent loop and adding a framework only when a simpler solution falls short, because frameworks add abstraction and debugging cost and the teams that succeed obsess over evaluation and iteration, not tool choice. A how-to-choose panel maps needs to tools: maximum control and durable state to LangGraph, fast role-based prototypes to CrewAI, minimal auditable code to smolagents, a single agent on one model family to a provider SDK, and document-heavy retrieval to LlamaIndex. A forward note observes that as the open MCP and A2A protocols standardize how agents reach tools and other agents, frameworks are converging into a thinner, interoperable orchestration layer. The takeaway: choose by which layer of the stack your problem lives in and how much control versus convenience you need — and only adopt a framework once a plain agent loop genuinely falls short.

Do You Even Need a Framework?

Before shopping for a framework, ask whether you need one. An agent, stripped down, is the tool-use loop from Section 3 — call the model, run any tool calls, feed results back, repeat until done:

# "Do I even need a framework?" Often: NO. A capable agent is a short loop you can read.
from anthropic import Anthropic
client = Anthropic()

def agent(goal, tools, run_tool, max_steps=8):
    messages = [{"role": "user", "content": goal}]
    for _ in range(max_steps):                        # ← your own termination (L148)
        m = client.messages.create(model="claude-opus-4-8", max_tokens=1024,
                                   messages=messages, tools=tools)
        if m.stop_reason != "tool_use":
            return m.content[0].text                  # ← done
        messages.append({"role": "assistant", "content": m.content})
        results = [{"type": "tool_result", "tool_use_id": b.id,
                    "content": run_tool(b.name, b.input)}
                   for b in m.content if b.type == "tool_use"]
        messages.append({"role": "user", "content": results})
# That's the whole agent loop (Section 3) — no framework, full control, nothing hidden.
# Reach for a framework when you need what it GIVES you: durable state, checkpointing,
# handoffs, multi-agent orchestration. Not by default — by demonstrated need.

That's a real, production-shaped agent in ~15 lines — no framework, full control, nothing hidden. Anthropic makes this its headline guidance: start with a simple prompt, evaluate, and add agentic complexity only when it demonstrably improves outcomes. And the famous critique from practitioner Hamel Husain: after helping 30+ companies ship AI products, the teams that succeed barely talk about tools — they obsess over measurement and iteration; framework-shopping is often a way to avoid the real work (which is usually writing a good prompt and a good eval).

When a framework earns its place: when you need what it gives you — durable state & checkpointing, multi-agent orchestration, handoffs, retries/resume, a hosted dashboard, observability — and building those yourself would be reinventing the wheel. When it doesn't: for a single agent with a couple of tools, a framework mostly adds abstraction and a debugging tax. Default to no framework; adopt one by demonstrated need, not by default.

The Landscape — Four Categories

When you do reach for a framework, the dozens on offer sort into four categories — and knowing the category tells you most of what you need:

  • Full-stack frameworkseverything: agents, tools, memory, orchestration, deployment. LangGraph, CrewAI, and the Microsoft Agent Framework (which merged AutoGen + Semantic Kernel, GA April 2026).
  • Provider SDKs — built by model providers, deeply integrated with their models. The OpenAI Agents SDK and the Claude Agent SDK. Shortest path to production inside one model ecosystem (at the cost of some lock-in).
  • Lightweight libraries — building blocks, minimal overhead. smolagents (~1k LOC, code-first) and Pydantic AI (type-safe contracts).
  • Data-centric — agents bolted onto a retrieval backbone. LlamaIndex (Workflows / AgentWorkflow).

Explore the representative tools — each gives you a different mental model for what an agent is:

A gallery of six representative agent frameworks across the control↔convenience spectrum. Click each to see its mental model, philosophy, when to reach for it, and who uses it: LangGraph (an explicit state-machine graph — maximum control, durable state, checkpointing), CrewAI (a crew of role-playing agents — maximum convenience, fast prototypes), smolagents (a ~1,000-line code-first library whose CodeAgent writes Python as its actions), the OpenAI Agents SDK (a lightweight provider SDK with built-in handoffs, the Swarm successor), the Claude Agent SDK (Anthropic's code-first SDK with explicit primitives), and LlamaIndex (a data/RAG backbone with an AgentWorkflow layer). The lesson: place any framework in its category and on the control↔convenience spectrum, then choose by need.

Notice the through-line: each framework hands you a different abstraction for the same underlying loop — a graph (LangGraph), a crew of roles (CrewAI), a code agent (smolagents), handoffs (OpenAI), primitives (Claude), a data workflow (LlamaIndex). They're not really competing on features; they're competing on which mental model fits your problem.

The Control ↔ Convenience Spectrum

Strip away the branding and almost every framework lands on one axis: control vs. convenience. It's the same trade-off you've met all course (start simple, add structure only when forced), now applied to tooling:

  • Maximum control (LangGraph). An explicit state-machine graph — you specify every node, edge, and state transition. More code (~80–150 LOC to a first agent), but nothing is hidden: precise branching, durable checkpoints, debuggable at scale. "Minimum magic."
  • Maximum convenience (CrewAI). Declare a crew of roles and let the framework wire the coordination. Far less code (~30–60 LOC), a prototype in an afternoon — but the abstraction can be opaque when you need fine-grained control.
  • In between: smolagents (minimal, code-first composition), the provider SDKs (fast for a single agent on one model), LlamaIndex (great when the center of gravity is data).

The same "research → write" job shows the spectrum in code — watch the altitude change:

# The SAME "research → write" job, three philosophies (illustrative sketches):

# 1) LangGraph — an explicit GRAPH: nodes + edges + typed shared state (MAX CONTROL)
g = StateGraph(State)
g.add_node("research", research); g.add_node("write", write)
g.add_edge("research", "write"); g.add_edge("write", END)
app = g.compile(checkpointer=SqliteSaver(...))        # durable, resumable, traceable

# 2) CrewAI — a CREW OF ROLES; each agent is role + goal + backstory (MAX CONVENIENCE)
researcher = Agent(role="Researcher", goal="find facts", backstory="...")
writer     = Agent(role="Writer",     goal="draft a brief", backstory="...")
Crew(agents=[researcher, writer], tasks=[...], process=Process.sequential).kickoff()

# 3) smolagents — one CodeAgent that writes PYTHON as its actions (RADICAL SIMPLICITY)
CodeAgent(tools=[web_search], model=model).run("Research X and write a brief.")
# Same idea, three points on the control↔convenience spectrum. Pick the altitude you need.

There's no "best" point on the spectrum — there's the altitude your problem needs. High control (LangGraph) for a complex, stateful, mission-critical system you must debug and resume; high convenience (CrewAI) for a clean role-based prototype; minimal (smolagents) when you value reading every line. The skill is matching the altitude to the task, not picking the most powerful tool.

How to Choose

The 2026 reframe from the noise: stop asking "which framework?" and ask "which layer of my stack does this problem live in, and how much control do I need?" Conflating orchestration, deployment, and protocols is how teams over-engineer. A quick decision guide:

  • No framework — a single agent + a couple of tools. Write the loop (above). Default here.
  • LangGraph — complex, stateful, production-critical; you need branching, checkpointing, resume, and deep tracing.
  • CrewAI — the job is a clean set of roles; you want a fast prototype and a hosted dashboard.
  • smolagents — you want minimal, auditable code and code-first tool composition.
  • OpenAI / Claude Agent SDK — you've committed to one model family and want the shortest path to production (accepting some lock-in).
  • LlamaIndex — the agent is mostly retrieval + reasoning over documents.
  • Pydantic AI — you want type-safe contracts (typed inputs/tools/outputs) and a FastAPI-like DX.

Two cross-cutting truths. (1) You can mix layers — e.g. LangGraph for orchestration, LlamaIndex for retrieval, MCP for tools. (2) The framework is the least durable part of your system: your prompts, tools, evals, and data outlive it. Choose one you can swap out, and don't marry it.

The Honest Take — and Where It's Converging

Frameworks are genuinely useful, but be clear-eyed about the costs:

  • They add abstraction you must debug through. A bug can live in your code, the model, or the framework's hidden control flow — and the convenient ones obscure exactly the mechanics you need to see when things break. (This is why observability from L148 — Designing a Multi-Agent System is non-negotiable.)
  • They impose architectural decisions that may not fit your problem, and they churn — APIs change, projects get archived (Swarm → OpenAI Agents SDK; AutoGen → maintenance → Microsoft Agent Framework).
  • They can become a distraction. The leverage is in prompts, tools, and evals, not framework selection — successful teams optimize the former and stay framework-light.

And the most important trend for future-proofing your choice: the field is converging on open protocols rather than one framework. MCP (agent→tools, L137–L142 — The Integration Problem MCP Solves → The MCP Ecosystem & Security Considerations) and A2A (agent→agent, L146 — The A2A (Agent-to-Agent) Protocol) — both now under the Linux Foundation's Agentic AI Foundation (146+ members incl. Anthropic, Google, OpenAI, Microsoft) — are becoming the durable, interoperable backbone. As they standardize the wiring, frameworks become a thinner orchestration layer you can mix and swap.

The strategic takeaway: bet on the standards (MCP, A2A) and your own prompts/evals; treat the framework as replaceable plumbing. Pick the one that fits today's problem and today's team — and keep it loosely coupled enough to change your mind.

🧪 Try It Yourself

Reason these through, then check with the framework gallery:

  1. You need a single agent that calls two tools and returns an answer. What framework should you reach for — and what's the honest answer?
  2. Place these on the control ↔ convenience spectrum: CrewAI, LangGraph, smolagents.
  3. You're building a mission-critical, stateful workflow that must resume after a crash and be debugged step-by-step. Which framework, and which feature makes the difference?
  4. A teammate insists the project will fail unless you pick "the right framework." Channel Hamel Husain — what should the team obsess over instead?
  5. Why is it smart to keep your framework loosely coupled, and what are the durable parts of your system?

(1) Honestly, none — write the ~15-line agent loop yourself (full control, nothing hidden). Reach for a framework only when you need durable state, orchestration, or handoffs. (2) LangGraph (max control — explicit graph) → smolagents (minimal, code-first) → CrewAI (max convenience — role crew). (3) LangGraph — its checkpointers (typed durable state) give you crash-resume and step-by-step time-travel debugging. (4) Measurement and iteration — good prompts, tools, and evals. The framework is the least important and least durable choice; the job is often "write a better prompt + a better eval," not "pick a framework." (5) Frameworks churn (APIs change, projects get archived) and add abstraction; your prompts, tools, evals, data, and the MCP/A2A standards outlive any framework — so keep it swappable.

Mental-Model Corrections

  • "I need to pick a framework before I can build an agent." No — an agent is a short loop (Section 3). Start with no framework; adopt one by demonstrated need.
  • "The best framework is the most powerful one." The best one matches your altitude on the control↔convenience spectrum. Max control (LangGraph) is overkill for a role-based prototype; max convenience (CrewAI) is too opaque for a mission-critical stateful system.
  • "Frameworks vs. provider SDKs vs. protocols are the same kind of choice." Different layers: full-stack frameworks orchestrate, provider SDKs integrate one model, and MCP/A2A are protocols underneath. Ask which layer your problem lives in.
  • "Picking the right framework is the key to success." Per Hamel Husain, successful teams barely talk about tools — they obsess over evals and iteration. The framework is a minor, swappable decision.
  • "smolagents/CrewAI is a toy; LangGraph is 'real'." They're different trade-offs, not tiers. smolagents ships in production; LangGraph is overkill for simple jobs. Fit, not prestige.
  • "My framework choice locks in my architecture." Keep it loosely coupled. Your prompts, tools, evals, data, and the MCP/A2A standards are durable; the framework is replaceable plumbing.

Key Takeaways

  • You may not need a framework. An agent is the tool-use loop (Section 3) — ~15 lines, full control. Anthropic: start simple, add a framework only when a simpler solution demonstrably falls short.
  • Four categories: full-stack (LangGraph, CrewAI, Microsoft Agent Framework), provider SDKs (OpenAI Agents SDK, Claude Agent SDK), lightweight (smolagents, Pydantic AI), data-centric (LlamaIndex).
  • One axis organizes them all: control ↔ convenience. LangGraph = max control (explicit graph, durable state); CrewAI = max convenience (role crew); smolagents = minimal code-first; provider SDKs = fast single-agent; LlamaIndex = data-first. Match the altitude to the task.
  • Choose by layer + need: which layer of the stack, and how much control? You can mix (LangGraph + LlamaIndex + MCP). Default to no framework for simple agents.
  • Honest costs: frameworks add abstraction & a debugging tax, impose architecture, and churn (Swarm → OpenAI SDK; AutoGen → maintenance → MS Agent Framework). The leverage is in prompts, tools, evals — not tool selection (Hamel Husain).
  • Bet on the standards: MCP + A2A (Agentic AI Foundation) are becoming the durable, interoperable backbone — frameworks are converging into a thinner, swappable layer. Keep yours loosely coupled.
  • Next — LangGraph: Graph-Based Agent Control — the first deep dive: the max-control framework, node by node.