Agent Design Patterns
Top 5 Agent Design Patterns for Structuring Multi-Step Reasoning
Building an AI agent that reasons across multiple steps is easy to start and hard to get right. The real question is not whether an agent can use a tool, but how it decides what to do next when the first result changes the plan.
Five common patterns answer that question differently: a reactive tool loop, an explicit planner separated from execution, a critic that reviews before finishing, a manager that delegates to specialists, and a bounded function-calling loop. Each has trade-offs in latency, cost, and reliability, and none is universally best.
In this guide I walk through LangChain, LangGraph, AutoGen, CrewAI, and the OpenAI Agents SDK as practical options, not as a ranked leaderboard. I focus on where each pattern fits, where it breaks down, and what to watch for before you commit to an architecture.
My practical advice is to start with the simplest loop and add structure only when failures show a gap.

Quick picks
LangChain — best for reactive agents that choose tools dynamically. Its model-and-tool loop runs until the model answers without another call, which suits tasks where each step depends on the last result.
The limitation is that the basic loop has no built-in planner or review stage, so you must add those controls yourself. LangGraph — best for stateful, multi-step agents needing explicit planning, retries, and human checkpoints.
It separates a planner from an executor in a stateful graph, making recovery paths visible. The trade-off is more model calls and more upfront design work than a simple reactive loop.
AutoGen — best for coding or analysis agents where self-correction and review matter. One model generates a draft while a second critiques it in a loop until approval or an iteration cap.
The added critique step means extra latency and cost, and a critic is not a guarantee of correctness. CrewAI — best for role-based crews where a manager reviews intermediate work before final output.
Hierarchical mode lets a manager delegate tasks and validate outcomes. You must enable hierarchical mode and configure a manager LLM or custom manager agent.
OpenAI Agents SDK — best for single-agent, tool-using workflows on OpenAI models who want explicit loop bounds. The runner handles the call-tool-observe cycle automatically and stops at final output or a MaxTurnsExceeded error.
A hard turn cap can halt a run before the task finishes, leaving recovery to your application.
Product shortlist
1. LangChain
LangChainLangChain fits multi-step reasoning when the next action depends on the latest tool result. Its create_agent factory builds a graph that calls tools in a loop until the model answers without calling another tool, and I like it for tasks needing flexible, reactive tool use instead of a fixed plan.
What I like
- The model-and-tool loop handles tasks where each step depends on the previous result.
- Graph state and an optional checkpointer let you persist and resume agent runs.
- Middleware support makes it easier to add logging, retries, or custom behavior between steps.
Limitations
- The basic loop has no upfront plan or review stage, so you must add those controls yourself.
- Long tool chains can be harder to debug.
My take
LangChain shines when you need an agent to improvise its next move based on tool output. The reactive loop is simple to reason about, but that simplicity is also a boundary: there is no built-in planner or critic.
Complex tasks benefit from extra layers such as upfront decomposition or self-correction. I would pair LangChain with LangGraph or add explicit planning steps when reliability matters more than speed.
For straightforward tool chaining, it remains a solid starting point.
Best for
Developers building reactive agents that choose tools dynamically, especially when persisting graph state between steps matters.
Sources: create_agent — LangChain Reference.
2. LangGraph
LangGraphI consider LangGraph when a task needs an explicit plan separated from execution. It models a planner and executor as nodes in a stateful graph, fitting multi-step reasoning where each step depends on the last.
This separation suits complex planning but adds model-call overhead. Unlike a turnkey agent, I define the state, transitions, and recovery myself.
What I like
- Explicit state and step boundaries make workflows easier to inspect and debug.
- Documented recovery includes retries, routing tool errors back to the LLM, and human pauses with checkpoint resumption.
- Supports planner/executor arrangements without a rigid framework.
Limitations
- Not a turnkey agent; I must design nodes, routing, state, and recovery myself.
- Planning adds model calls, increasing latency and cost versus a reactive loop.
- Flexible API means more upfront design work.
My take
LangGraph works best when I map a task to states and transitions rather than an unstructured model loop. Checkpointing lets long-running agents pause for human input and resume without losing context.
I accept more overhead and code upfront for visible recovery paths and deterministic routing. A reactive agent is faster and cheaper but struggles with backtracking or structured failure handling.
Best for
Stateful, multi-step agents needing explicit planning, retries, and human checkpoints.
Sources: Plan-and-Execute Agents; Thinking in LangGraph.
3. AutoGen
AutoGenAutoGen is an open-source framework that excels at multi-agent collaboration. Its standout feature is the reflection pattern, where one model generates a draft and another critiques it in a loop.
This is highly effective for tasks requiring self-correction, such as code generation, where a reviewer can catch errors before they reach the user.
What I like
- The built-in reflection pattern facilitates automatic error correction through a dedicated reviewer agent.
- Conversable agents can exchange feedback seamlessly until a stopping condition is met.
- The architecture remains highly modular, allowing custom critique and revision loops.
Limitations
- It introduces additional latency because each critique requires an extra model generation.
- Critique is not a guarantee that the final result will be correct.
My take
I find AutoGen's reflection approach particularly useful for building high-reliability coding agents. The main trade-off is increased computational cost and latency from the iterative loop.
While excellent for failure recovery, developers must set strict iteration caps to avoid excessive costs. It suits teams prioritizing output quality over speed.
Best for
Development teams building complex coding or analysis agents where self-correction and review are critical.
Sources: Reflection — AutoGen.
4. CrewAI
CrewAICrewAI organizes agents into crews with defined roles. Its hierarchical process lets a manager agent delegate work and review results.
What I like
- Role-based delegation assigns distinct responsibilities to each agent, keeping complex workflows understandable.
- The manager agent validates outcomes before work passes forward, adding a reliability checkpoint.
- Hierarchical mode is explicit, so you only take on orchestration when the task needs it.
Limitations
- The manager layer adds overhead and configuration that simple single-agent tasks do not require.
- You must explicitly enable hierarchical mode and supply a manager LLM or custom manager agent.
My take
CrewAI fits tasks that naturally split among specialists. The manager assigns work and checks outputs, which can improve reliability for multi-step reasoning.
Best for
Role-based agent crews where a manager reviews intermediate work before final output.
Sources: Hierarchical Process — CrewAI.
5. OpenAI Agents SDK
OpenAI Agents SDKThe OpenAI Agents SDK provides a lightweight, model-directed loop for function-calling agents. I like that it keeps orchestration close to the model while bounding execution with a configurable turn cap.
It fits teams wanting OpenAI tool use without heavy overhead.
What I like
- The runner handles the call-tool-observe-repeat cycle automatically, so you focus on tool definitions rather than plumbing.
- A max_turns setting stops runaway loops and raises MaxTurnsExceeded when the budget runs out.
- You can configure how the SDK surfaces tool errors and tool-not-found cases, which helps debugging.
Limitations
- A hard turn limit can halt a run before the task finishes, leaving recovery logic to your application.
- It assumes comfort with the OpenAI ecosystem and function-calling model.
My take
This SDK works best when your agent picks from a fixed set of tools across multiple turns. The turn cap is a safety valve, but you must decide whether to retry, resume, or surface the failure.
Choose it when latency and cost matter more than complex multi-agent coordination.
Best for
Developers building single-agent, tool-using workflows on OpenAI models who want explicit loop bounds.
Sources: Running agents — OpenAI Agents SDK.
How to choose
Match the pattern to the task. Reactive loops fit when tool results change the next step; planned sequences fit clear subtasks.
Add reflection or hierarchy when failures need review across tries. Both cost extra calls, so skip them for simple tasks.
Function-calling loops suit defined tools with application-side validation. Cap the turns and decide what happens when the limit is reached.
Don't add a manager layer to a single straightforward call. Planning overhead isn't worth it when a reactive agent handles the job.
I'd start simple and add planning or review only if failures reveal a gap. Hierarchy fits multi-agent work; reflection fits code review.
Sources: ReAct: Synergizing Reasoning and Acting in Language Models; Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models; Reflexion: Language Agents with Verbal Reinforcement Learning; Common architecture patterns — Building effective AI agents; Function calling | OpenAI API; create_agent — LangChain Reference; Plan-and-Execute Agents; Thinking in LangGraph; Reflection — AutoGen; Hierarchical Process — CrewAI; Running agents — OpenAI Agents SDK.
Which option fits?
There is no single pattern that fits every multi-step reasoning task. I’d choose LangChain or the OpenAI Agents SDK when I need a fast, reactive loop and the next action depends on the latest tool result.
LangGraph is my pick when the task breaks into clear states and I want checkpoints, retries, or human pauses between steps. AutoGen makes sense for coding or analysis work where a reviewer can catch mistakes before they reach the user, provided I can absorb the extra model calls.
CrewAI fits when work naturally divides among specialists and a manager needs to validate outcomes before the next assignment. My practical advice is to start with the simplest loop that could work, observe where it fails, and add planning, reflection, or hierarchy only if the failures reveal a real gap.
If you are unsure, build a reactive version first and measure whether the missing structure actually costs you. That keeps latency and cost under control while giving you a path to more reliability when you need it.