Design patterns
for AI agents

Fourteen ways to arrange language-model calls and agentsAgent A language model in a loop: it picks an action, often a tool call, reads the result and goes on until the task is done., from a fixed chain of prompts to teams that hand work to each other.

What sets them apart is who decides the next step: your code, fixed in advance (a workflow), or the model, at run time (an agent). Each page covers the structure, when to use it and how it fails.

Choose from 14

Patterns

Grouped by family, from the most predictable to the most autonomous. The pages build on each other: read Prompt Chaining, Routing and ReAct first, then the rest in any order.

Workflows

The developer’s code fixes the path. Cheapest, most predictable, easiest to test.

  1. Prompt Chaining

    A fixed sequence of model calls, each fed the previous output, with checks in code between steps.

  2. Routing

    Classify the input once, then send it to exactly one specialised path or model.

  3. Parallelization

    Run independent calls at once: different subtasks (sectioning) or the same task several times (voting).

  4. Evaluator–Optimizer

    Generate, evaluate against explicit criteria, revise, until the draft passes or the budget runs out.

Single agent

One model decides its own steps. The building block of every multi-agent pattern.

  1. ReAct (tool-use loop)

    One model alternates reasoning and tool calls, choosing each next step from the last observation.

  2. Plan-and-Execute

    A planner writes all the steps up front, an executor runs them, and a replanner checks and revises.

Centralized multi-agent

One agent coordinates the others and keeps control.

  1. Orchestrator–Workers

    A lead model invents the subtasks at run time, briefs workers with clean contexts, and merges results.

  2. Supervisor

    A central agent picks which worker acts at every step, and control always comes back to it.

  3. Hierarchical teams

    Managers of managers: a top agent delegates to team leads, who delegate to workers.

Decentralized multi-agent

No single boss: peers pass control along, or share a workspace.

  1. Swarm / Handoffs

    Peer agents with no manager. The active one transfers control, and the conversation, to a better-suited peer.

  2. Group Chat

    Agents share one message thread; a selector (rotation, a model, a graph or a person) picks who speaks.

  3. Blackboard

    Specialists coordinate through a shared workspace instead of messages; a controller picks who acts.

Consensus

Several minds on the same question.

  1. Council / Debate

    Several diverse agents answer the same question, critique each other, then a vote or a chair decides.

Cross-cutting

Added on top of any other pattern.

  1. Human-in-the-Loop

    Pause at risky or ambiguous points, save the state, let a person approve, edit, reject or answer, then resume.

Weigh the

Tradeoffs

For each pattern, what it costs against the others and when to use it, grouped by who decides the next step. Each page gives the numbers. Patterns nest: an orchestrator’s worker is usually a ReAct loop, and human approval gates can sit anywhere.

PatternCostUse it when
Your code decides
Prompt Chaining Moderate one call per step The steps are known in advance: the same sequence fits every input, and the order never depends on what a step finds.
Parallelization Moderate one call per branch Subtasks are truly independent: no branch needs another’s output, and you want the wait of the slowest one, not the sum.
Evaluator–Optimizer High two calls per round You can write the criteria down, ideally backed by an outside signal such as tests, a compiler or a schema.
Council / Debate Very high every member, every round You have strong models from different families and an open-ended question, where their disagreement is worth paying for.
The model decides
Routing Low one extra call to route Inputs fall into distinct categories, each needing its own prompt, tools or model, and you can classify them accurately.
ReAct High one or more calls per step The steps can’t be predicted, as in debugging or research, and the environment tells the model whether each step worked.
Plan-and-Execute Moderate one plan by a strong model, cheap steps The task’s shape shows in the request, many steps are independent, or someone must approve the plan before it runs.
A manager agent decides
Orchestrator–Workers Very high about 15× a chat’s tokens The subtasks can’t be predicted but split into independent, mostly read-only parts, and the answer is worth the tokens.
Supervisor High a manager call at every hop Several domains would overload one agent, requests need specialists in turn, and the user should hear one voice.
Hierarchical teams Very high one more round trip per level One supervisor measurably breaks down, and its workers fall into natural teams that can be built and tested apart.
Group Chat High one call per turn, plus the selector A few known roles speak in an unknown order, each building on the last message, with a clear test of being done.
Peers decide
Swarm / Handoffs Moderate no manager calls between turns A long conversation drifts between topics, and the right specialist only shows up partway through, then answers the user directly.
Blackboard Very high grows every round Contributions have no fixed order, the requester can’t know who can help, and partial results must stay findable.
A person decides
Human-in-the-Loop None no extra calls; waits on a person An action can’t be undone or costs a lot, or the decision needs something only a person has: a rule, a right, a signature.

A few questions to help you

Choose a pattern

Answer a few questions about your task and the list narrows to the pattern that fits, with Human-in-the-Loop added when a person must approve some steps. Every pattern costs more calls, tokens and time than one good prompt, so the questions start with the simplest option.

  1. Question 1: Could one well-written prompt do the job?

    With some context or a few examples pasted in.