Families of agentic patterns

52 patterns in 9 families. Each family shares a way of wiring models, tools and control flow; every card plays its diagram live.

Workflows

The code fixes the path; the LLMs fill in each step.

Prompt Chaining

Workflows · 6 nodes · 3 LLM calls · branch · 2 scenarios

+2 variants · Schluntz & Zhang 2024

Break a task into fixed steps, where each LLM call works on the previous output, with optional code checks between steps.

Routing

Workflows · 6 nodes · 2 LLM calls · branch · 2 scenarios

+2 variants · Schluntz & Zhang 2024

Classify the input, then send it to a specialized prompt, model or tool.

Parallelization: Sectioning

Workflows · 7 nodes · 3 LLM calls · parallel · 1 scenario

+2 variants · Schluntz & Zhang 2024

Split the work into independent subtasks, run them in parallel, then merge the results.

Parallelization: Voting

Workflows · 6 nodes · 3 LLM calls · parallel · 1 scenario

+2 variants · Wang et al. 2022

Run the same task N times, or with N different prompts, and take the majority or consensus answer.

Orchestrator-Workers

Workflows · 6 nodes · 5 LLM calls · parallel · 1 scenario

+1 variant · Schluntz & Zhang 2024

A central LLM works out the subtasks at run time, sends them to worker LLMs, then combines the results.

Evaluator-Optimizer

Workflows · 4 nodes · 6 LLM calls · loop · branch · 2 scenarios

+2 variants · Schluntz & Zhang 2024

One model drafts, another judges; the loop runs until the work clears the bar.

Reasoning & Prompting

Shape how one model thinks inside a call or a short fixed chain: decompose, ask follow-ups, verify its own claims, or hand the arithmetic to code.

Chain-of-Thought

Reasoning & Prompting · 6 nodes · 5 LLM calls · branch · 2 scenarios

Wei et al. 2022

The model writes out its intermediate reasoning steps before the final answer, all inside one call.

Least-to-Most Prompting

Reasoning & Prompting · 5 nodes · 5 LLM calls · loop · branch · 1 scenario

Zhou et al. 2022

First break the problem into easier subquestions, then solve them in order, feeding each answer into the next.

Self-Ask

Reasoning & Prompting · 4 nodes · 6 LLM calls · loop · branch · 1 scenario

+1 variant · Press et al. 2022

The model asks itself follow-up questions, answers each one (optionally with search), then composes the final answer.

Chain-of-Verification

Reasoning & Prompting · 8 nodes · 5 LLM calls · parallel · 2 scenarios

+3 variants · Dhuliawala et al. 2023

Draft an answer, plan questions that check its claims, answer each one without seeing the draft, then rewrite the answer to match.

Program-Aided Reasoning

Reasoning & Prompting · 4 nodes · 1 LLM call · loop · branch · 2 scenarios

+1 variant · Gao et al. 2022

The model writes a program that encodes its reasoning, an interpreter runs it, and the program's output is the answer.

Agent Loops

One model chooses its next action, observes the result and loops, sometimes critiquing itself or learning across attempts.

Augmented LLM

Agent Loops · 6 nodes · 3 LLM calls · 2 scenarios

+2 variants · Schluntz & Zhang 2024

One LLM call that can use tools, retrieval and memory; every other pattern is built from this.

ReAct (Autonomous Agent)

Agent Loops · 5 nodes · 4 LLM calls · 2 scenarios

+2 variants · Yao et al. 2022

Alternate Thought, Action (tool call) and Observation until the model decides it is done.

CodeAct

Agent Loops · 6 nodes · 2 LLM calls · loop · parallel · 2 scenarios

Wang et al. 2024

The agent acts by writing code. One snippet can call many tools, loop and filter, and only its printed output comes back to the model.

CRITIC

Agent Loops · 6 nodes · 4 LLM calls · loop · branch · 2 scenarios

+1 variant · Gou et al. 2023

The model drafts an answer, checks its own claims with tools such as search or code, and revises from the evidence they return.

Reflexion

Agent Loops · 6 nodes · 3 LLM calls · loop · branch · 1 scenario

+2 variants · Shinn et al. 2023

After a failed attempt, the agent writes a lesson in plain language to memory and tries again with that lesson in context.

Plan or explore the task before or while acting, as a plan, a DAG or a tree.

Plan-and-Execute

Planning & Search · 7 nodes · 4 LLM calls · loop · branch · 1 scenario

+2 variants · LangChain team 2024

A planner writes a step list, an executor runs each step, and a replanner revises the remaining steps.

ReWOO

Planning & Search · 7 nodes · 2 LLM calls · 1 scenario

+1 variant · Xu et al. 2023

Plan every tool call upfront using placeholders (#E1, #E2), run them, then a solver writes the answer in one pass.

LLMCompiler

Planning & Search · 8 nodes · 1 LLM call · loop · parallel · branch · 2 scenarios

+1 variant · Kim et al. 2023

The planner streams a dependency graph (DAG) of tool calls; independent ones run in parallel; a joiner either answers or triggers a replan.

Tree of Thoughts

Planning & Search · 8 nodes · 6 LLM calls · parallel · branch · 1 scenario

+1 variant · Yao et al. 2023

Generate several candidate thoughts at each step, score them, expand the promising branches and backtrack at dead ends.

Graph of Thoughts

Planning & Search · 11 nodes · 5 LLM calls · loop · parallel · branch · 1 scenario

Besta et al. 2023

Thoughts form a graph, not a tree. Partial results are scored and regenerated, merged many-to-one, and refined until the whole is right.

Language Agent Tree Search

Planning & Search · 8 nodes · 6 LLM calls · loop · branch · 1 scenario

+1 variant · Zhou et al. 2023

Monte Carlo tree search over agent actions. Expand, act for real, score, back up the score along the path, and learn from failed branches.

Knowledge & Memory

Pull in outside or stored knowledge, decide when to fetch it, and check what comes back.

Agentic RAG

Knowledge & Memory · 7 nodes · 3 LLM calls · branch · 2 scenarios

+2 variants · No single inventor

The agent decides whether to retrieve, from which source, and with what rewritten query, and repeats until it has enough context.

Corrective RAG

Knowledge & Memory · 8 nodes · 4 LLM calls · loop · branch · 2 scenarios

+2 variants · Yan et al. 2024

Grade the retrieved documents. If they're irrelevant, rewrite the query and fall back to web search before generating.

HyDE

Knowledge & Memory · 6 nodes · 2 LLM calls · parallel · 2 scenarios

Gao et al. 2022

The LLM writes a hypothetical answer passage. That passage is embedded instead of the query, and the real documents nearest to it are retrieved.

Multi-Query RAG

Knowledge & Memory · 8 nodes · 2 LLM calls · parallel · 1 scenario

+2 variants · No single inventor

Rewrite one question into several queries, retrieve for each in parallel, then fuse the ranked lists before generating.

Retrieve-and-Rerank

Knowledge & Memory · 9 nodes · 2 LLM calls · parallel · 2 scenarios

No single inventor

Cast a wide net with cheap keyword and vector search over context-prefixed chunks, then let a reranker keep only the best few.

GraphRAG

Knowledge & Memory · 10 nodes · 1 LLM call · 2 scenarios

+1 variant · Edge et al. 2024

Index a corpus as an LLM-built entity graph with pre-written community summaries, then map-reduce over those summaries to answer whole-corpus questions.

Memory Stream

Knowledge & Memory · 7 nodes · 3 LLM calls · loop · 2 scenarios

Park et al. 2023

Log every observation with an importance score, retrieve by recency, importance and relevance, and periodically write reflections back into the stream.

Hierarchical Memory

Knowledge & Memory · 6 nodes · 1 LLM call · 2 scenarios

+2 variants · Packer et al. 2023

Treat the context window like RAM. The agent uses tool calls to page facts between core, recall and archival memory.

Multi-Agent

Several role-specialized agents coordinate through a manager, hand off to each other, or debate.

Supervisor

Multi-Agent · 7 nodes · 6 LLM calls · branch · 2 scenarios

+2 variants · No single inventor

A supervisor agent sends work to specialist agents and every result comes back through it.

Handoffs

Multi-Agent · 5 nodes · 5 LLM calls · branch · 2 scenarios

+2 variants · OpenAI Solutions team 2024

Agents pass the whole conversation to each other; the agent holding it talks directly to the user, and there's no central manager.

Group Chat

Multi-Agent · 7 nodes · 10 LLM calls · branch · 2 scenarios

Wu et al. 2023

Agents share one thread; a manager picks who speaks next, everyone sees every message, and the chat runs until it is told to stop.

Role-Play

Multi-Agent · 5 nodes · 9 LLM calls · loop · parallel · branch · 2 scenarios

Li et al. 2023

Two role-prompted agents, an instructor and a doer, trade instructions and solutions turn by turn until the instructor declares the task done.

SOP-Driven Team

Multi-Agent · 7 nodes · 4 LLM calls · loop · branch · 2 scenarios

+1 variant · Hong et al. 2023

Role agents follow a fixed procedure, each publishing a structured document to a shared pool that the next role picks up.

Blackboard

Multi-Agent · 8 nodes · 9 LLM calls · parallel · branch · 2 scenarios

No single inventor

Specialists read and write one shared board; each round a control unit picks who acts next, until a critic finds a solution on the board.

Mixture-of-Agents

Multi-Agent · 9 nodes · 6 LLM calls · parallel · 1 scenario

+1 variant · Wang et al. 2024

Layers of different models each answer, every model in the next layer reads all the previous answers, and an aggregator writes the final one.

Multi-Agent Debate

Multi-Agent · 6 nodes · 9 LLM calls · loop · parallel · 1 scenario

+2 variants · Du et al. 2023

Several agents answer independently, read and critique each other's answers over rounds, then converge by majority or an optional judge.

Safety & Oversight

Checks and human approval points wrapped around any of the other patterns.

Human-in-the-Loop

Safety & Oversight · 6 nodes · 2 LLM calls · branch · human · 3 scenarios

+2 variants · No single inventor

Pause before high-stakes or irreversible actions so a person can approve, edit or reject; then resume.

Guardrails

Safety & Oversight · 7 nodes · 5 LLM calls · parallel · branch · 3 scenarios

+3 variants · OpenAI 2025

Checks that run before and after the agent, any of which can block or redirect the flow.

Permission Policies

Safety & Oversight · 6 nodes · 5 LLM calls · loop · branch · human · 2 scenarios

No single inventor

Every tool call is checked against declarative allow, ask and deny rules and a budget before it runs.

Sandboxed Execution

Safety & Oversight · 8 nodes · 2 LLM calls · loop · branch · human · 2 scenarios

No single inventor

Agent commands run inside an isolated filesystem and network boundary, so only crossings of that boundary need approval.

Dual LLM

Safety & Oversight · 8 nodes · 2 LLM calls · 2 scenarios

+1 variant · Simon Willison 2023

A tool-holding LLM never sees untrusted text; a tool-less LLM reads it, and code passes its output along only as variables.

LLM-as-Judge

Safety & Oversight · 7 nodes · 3 LLM calls · branch · 2 scenarios

+3 variants · Zheng et al. 2023

A separate judge model scores a system's outputs against a rubric, and the scores gate releases or rank candidates.

Reliability & Runtime

The plumbing that keeps agents running in production: validate and repair outputs, fail over between models, persist state, and wake up on events.

Schema Validation & Repair

Reliability & Runtime · 5 nodes · 2 LLM calls · loop · branch · 2 scenarios

No single inventor

Check the model's output against a schema and rules; on failure, send the exact error back and ask again, up to N tries.

Retries & Model Fallback

Reliability & Runtime · 6 nodes · 1 LLM call · loop · branch · 2 scenarios

No single inventor

Retry failed model calls with backoff, then fail over down an ordered list of models, resting any that keep failing.

Checkpoint & Resume

Reliability & Runtime · 6 nodes · 0 LLM calls · loop · 2 scenarios

No single inventor

Save the agent's state after every step, so a crash or a long pause resumes from the last checkpoint instead of starting over.

Ambient Agent

Reliability & Runtime · 6 nodes · 6 LLM calls · loop · branch · human · 2 scenarios

Harrison Chase 2025

An agent woken by events rather than chat messages, working in the background and reaching people only to notify, ask or get a review.

Efficiency & Cost

Spend fewer tokens, dollars and seconds: escalate only when needed, reuse what was already computed, parallelize generation, and batch what can wait.

Model Cascade

Efficiency & Cost · 5 nodes · 2 LLM calls · branch · 2 scenarios

+2 variants · Chen et al. 2023

Try the cheapest model first; a scorer checks the answer and escalates to a stronger, pricier model only when confidence is low.

Caching & Reuse

Efficiency & Cost · 5 nodes · 2 LLM calls · parallel · 1 scenario

+2 variants · No single inventor

Avoid recomputing. Reuse the processed prefix of a stable prompt, or return a stored answer when a request matches an earlier one.

Batch & Throttled Fan-out

Efficiency & Cost · 6 nodes · 3 LLM calls · loop · parallel · 1 scenario

+1 variant · No single inventor

Run thousands of independent requests through a rate limiter with retries, or submit them as one provider batch at half price.

Skeleton-of-Thought

Efficiency & Cost · 7 nodes · 4 LLM calls · parallel · 1 scenario

+1 variant · Ning et al. 2023

Write a short outline first, then expand every outline point in parallel and join the results, cutting time to a complete answer.

Missing a pattern? Propose one →