Agent FrameworksAIS-02 · theory

Source · LangGraph, CrewAI, Microsoft AutoGen, and OpenAI Agents SDK documentation (2024–2025); Anthropic engineering writeups

Why this matters

LangChain, LangGraph documentation (2024–2025); OpenAI Agents SDK docs (2025)

You can hand-write an agent loop in fifty lines. So why do frameworks exist? Because the boring parts — retries, streaming, tool schemas, state, tracing, and especially coordinating multiple agents — are where real systems bleed time. A framework gives you those for free and a shared vocabulary for your team.

But frameworks also add abstraction you have to debug. Picking the right one — or deciding you need none — is a genuine engineering decision, not a fashion choice.

The concept

Microsoft AutoGen docs; CrewAI docs; OpenAI Agents SDK docs (2025)

The 2025-era landscape clusters into a few shapes:

- LangGraph — model your agent as a graph of nodes and edges with explicit, persisted state. Great when you need loops, branches, checkpoints, and human-in-the-loop pauses that survive restarts. - CrewAI — a role-based abstraction: you define agents ("researcher", "writer") with goals and let them collaborate on tasks. Fast to stand up multi-agent "crews". - AutoGen (Microsoft) — conversation-centric multi-agent: agents talk to each other (and to code executors) in a message loop to solve a task. - OpenAI Agents SDK — a lightweight, provider-native SDK built around agents, handoffs, tools, and guardrails, with tracing baked in. Minimal abstraction over the model.

Orthogonally, agents are single (one loop, one set of tools) or multi-agent (several specialists). The dominant multi-agent shape is supervisor/worker (a.k.a. orchestrator-worker): a supervisor agent decomposes the task and routes sub-tasks to worker agents, then synthesizes their results.

Worked scenario

Anthropic, "How we built our multi-agent research system" (2025); LangGraph multi-agent tutorials

You are building a research assistant that reads sources and writes a briefing.

- Single-agent attempt: one agent with a search tool and a write tool. It works, but its context fills with raw search dumps and the writing quality drops. - Supervisor/worker redesign: a supervisor plans, spawns a Researcher worker (search + extract) and a Writer worker (draft from the Researcher's notes). Each worker keeps a focused context. The supervisor merges the output.

In LangGraph you would model supervisor and workers as nodes with a routing edge and shared state. In CrewAI you would declare the two roles and a task list. In AutoGen you would let the agents converse until the writer signals done. Same pattern, three framework flavors.

How it connects

Anthropic, "Building Effective Agents" (2024); Anthropic multi-agent research writeup (2025)

When to use a framework at all: if you have a simple, single-agent task, a plain loop plus the provider SDK is often clearer and easier to debug — abstraction you do not need is a liability. Reach for a framework when you need durable state and checkpoints (LangGraph), rapid multi-role prototyping (CrewAI), free-form agent conversation (AutoGen), or tight provider integration with built-in tracing (Agents SDK).

Multi-agent is not automatically better: it multiplies token cost and adds coordination failure modes. Use it when sub-tasks are genuinely separable and benefit from focused context or parallelism. Everything here runs on the tool layer (AIS-03) and needs the orchestration, guardrails, and observability of AIS-04.

Common traps
  • Adopting a heavy framework for a single-agent task. The abstraction can cost more debugging time than it saves; a plain loop plus the provider SDK is often clearer.
  • Assuming multi-agent is always better. It multiplies token cost and adds coordination failures; only split when sub-tasks are genuinely separable.
  • Conflating the frameworks' shapes. LangGraph is graph/state-centric, CrewAI is role-centric, AutoGen is conversation-centric, the Agents SDK is a thin provider-native layer — they optimize different things.
Key takeaways
  • LangGraph = explicit graph + persisted state; CrewAI = roles/crews; AutoGen = agents conversing; OpenAI Agents SDK = lightweight, provider-native with tracing.
  • The dominant multi-agent pattern is supervisor/worker: a supervisor decomposes and routes sub-tasks, workers keep focused context, supervisor synthesizes.
  • Choose a framework for what you actually need (durable state, roles, conversation, tracing); for simple single-agent tasks, no framework is often the right call.