Pattern catalog

Find the right agentic pattern

Browse the generated pattern chapters as a focused catalog. Filter by engineering concern, then jump directly into the chapter that explains the pattern and its implementation tradeoffs.

Use the catalog by decision

Search by the problem you are trying to solve, then read the use cases, avoid cases, failure modes, and production checklist before adopting a pattern.

Select

Choose an architecture

Start here when the problem is unclear. Compare autonomy, state, tools, evaluation, and operational risk before picking a pattern.

Open guide
Map

Read the diagrams

Use the visual route when a team needs shared language for boundaries, owners, control loops, multi-agent flow, and production risk.

Open guide
Prove

Find runnable proof

Use the lab matrix when you need code that proves a pattern boundary: routing, tools, memory, planning, orchestration, or deployment.

Open guide
Ship

Check production risk

Use the 10/10 gate before release. It forces clear evidence for security, observability, evals, rollback, and ownership.

Open guide

Concern

Level

Reader path

Effort

01 Agent Runtime Foundations
Pattern Beginner 12-25 min pattern review BuilderStudent

Single Agent

A single agent receives a goal or message, consults its context, and produces an answer or action. This is the smallest useful unit in the catalog.

Use when you need the basic runtime building blocks of any agentic system.

02 Agent Runtime Foundations
Pattern Beginner 12-25 min pattern review BuilderStudent

Agent Loop

The agent loop turns a model call into an agent: observe state, decide the next action, act, evaluate the result, and stop when the goal is complete or a limit is reached.

Use when you need the basic runtime building blocks of any agentic system.

03 Agent Runtime Foundations
Pattern Beginner 12-25 min pattern review BuilderStudent

Goals and State

Goals define success; state records progress. Together they make agent work resumable, inspectable, and easier to evaluate.

Use when you need the basic runtime building blocks of any agentic system.

04 Agent Runtime Foundations
Pattern Beginner 12-25 min pattern review BuilderStudent

Tool Use

Tool use gives an agent controlled access to external capability such as calculators, search, databases, files, code execution, APIs, or business systems.

Use when you need the basic runtime building blocks of any agentic system.

05 Agent Runtime Foundations
Pattern Beginner 12-25 min pattern review BuilderStudent

Structured Output

Structured output constrains model responses to typed data that software can validate and consume.

Use when you need the basic runtime building blocks of any agentic system.

06 Control Loops
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Planning and Execution

Planning separates deciding what to do from doing it. The planner creates steps; the executor runs them, reports progress, and handles errors.

Use when the agent needs structured reasoning, correction, or iterative execution.

07 Control Loops
Pattern Intermediate 12-25 min pattern review BuilderArchitect

ReAct

ReAct alternates reasoning and acting. The agent reasons about current state, takes an action, observes the result, and repeats.

Use when the agent needs structured reasoning, correction, or iterative execution.

08 Control Loops
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Reflection

Reflection asks an agent or evaluator to inspect prior output and identify concrete improvements.

Use when the agent needs structured reasoning, correction, or iterative execution.

09 Control Loops
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Evaluator-Optimizer

Evaluator-Optimizer pairs a generator with an evaluator. The generator proposes; the evaluator scores; the optimizer revises or stops.

Use when the agent needs structured reasoning, correction, or iterative execution.

10 Control Loops
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Self-Improvement

Self-improvement uses feedback from prior runs to improve future runs through reviewed changes to prompts, tools, retrieval, policies, tests, or skills.

Use when the agent needs structured reasoning, correction, or iterative execution.

11 Control Loops
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Self-Healing Workflows

Self-healing workflows detect failed steps and recover through retry, fallback, re-planning, or escalation.

Use when the agent needs structured reasoning, correction, or iterative execution.

12 Context, Memory, and Knowledge
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Context Engineering

Context engineering controls what the model sees: instructions, state, retrieval results, tool documentation, memory, examples, and prior messages.

Use when the system must assemble context, retrieve evidence, remember facts, or verify knowledge.

13 Context, Memory, and Knowledge
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Memory-Augmented Agent

Memory gives an agent continuity, but it also creates a durable trust boundary.

Use when the system must assemble context, retrieve evidence, remember facts, or verify knowledge.

14 Context, Memory, and Knowledge
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Long-Term Episodic Memory

Long-term episodic memory stores events: what happened, when, who was involved, and why it mattered.

Use when the system must assemble context, retrieve evidence, remember facts, or verify knowledge.

15 Context, Memory, and Knowledge
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Semantic Recall and RAG

Semantic recall retrieves relevant material by meaning rather than exact keywords. RAG injects retrieved material into context before generation.

Use when the system must assemble context, retrieve evidence, remember facts, or verify knowledge.

16 Context, Memory, and Knowledge
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Working Memory

Working memory is compact, typed task state the agent can update and consult during a run.

Use when the system must assemble context, retrieve evidence, remember facts, or verify knowledge.

17 Context, Memory, and Knowledge
Pattern Intermediate 12-25 min pattern review BuilderArchitect

Knowledge-Bound Agents

Knowledge-bound agents ground answers and actions in approved sources, policies, and citation rules.

Use when the system must assemble context, retrieve evidence, remember facts, or verify knowledge.

18 Tools, Skills, and Protocols
Pattern Intermediate 12-25 min pattern review BuilderSecurity

Skills

Skills package procedural knowledge as discoverable, versioned folders of instructions, references, scripts, templates, assets, and tests.

Use when agents need safe external capabilities or communication protocols.

19 Tools, Skills, and Protocols
Pattern Intermediate 12-25 min pattern review BuilderSecurity

MCP-first Tool Use

MCP-first tool use separates tool capability from agent logic through manifests, validation, invocation, and structured results.

Use when agents need safe external capabilities or communication protocols.

20 Tools, Skills, and Protocols
Pattern Intermediate 12-25 min pattern review BuilderSecurity

A2A Agent Interoperability

A2A makes agents discoverable and callable across process, team, runtime, and vendor boundaries.

Use when agents need safe external capabilities or communication protocols.

21 Tools, Skills, and Protocols
Pattern Intermediate 12-25 min pattern review BuilderSecurity

Secure Agent Communication

Secure communication protects messages between agents with authentication, integrity, confidentiality, and policy checks.

Use when agents need safe external capabilities or communication protocols.

22 Tools, Skills, and Protocols
Pattern Intermediate 12-25 min pattern review BuilderSecurity

Human Approval Gates

Human approval gates pause execution before sensitive, expensive, destructive, or externally visible actions.

Use when agents need safe external capabilities or communication protocols.

23 Multi-Agent Systems
Pattern Advanced 12-25 min pattern review ArchitectBuilder

Task Delegation

Task delegation assigns bounded subtasks to specialized workers and combines their outputs.

Use when one agent is not enough and work must be split or coordinated.

24 Multi-Agent Systems
Pattern Advanced 12-25 min pattern review ArchitectBuilder

Supervisor / Worker

Supervisor/Worker centralizes goal ownership, task state, routing, and quality gates while workers perform bounded specialist work.

Use when one agent is not enough and work must be split or coordinated.

25 Multi-Agent Systems
Pattern Advanced 12-25 min pattern review ArchitectBuilder

Debate and Consensus

Debate and consensus use multiple independent proposals, critiques, votes, or rankings before producing a final answer.

Use when one agent is not enough and work must be split or coordinated.

26 Multi-Agent Systems
Pattern Advanced 12-25 min pattern review ArchitectBuilder

Parallel Agents

Parallel agents run independent work concurrently, then merge results through a fan-out/fan-in control point.

Use when one agent is not enough and work must be split or coordinated.

27 Multi-Agent Systems
Pattern Advanced 12-25 min pattern review ArchitectBuilder

CrewAI Flows and Crews

CrewAI Flows own state and execution order. Crews group specialized agents that collaborate on delegated work inside the flow.

Use when one agent is not enough and work must be split or coordinated.

28 Production Runtime
Pattern Advanced 20-35 min design review OperatorReviewer

Durable Workflows

Durable workflows make agentic systems resumable and auditable by owning retries, checkpoints, approvals, compensation, and long-running state.

Use when operating agents under real constraints: cost, policy, evals, events, and durability.

29 Production Runtime
Pattern Advanced 20-35 min design review OperatorReviewer

Observability and Evals

Observability records what happened. Evals decide whether behavior is good enough. Release gates decide whether a change is allowed to ship.

Use when operating agents under real constraints: cost, policy, evals, events, and durability.

30 Production Runtime
Pattern Advanced 20-35 min design review OperatorReviewerSecurity

Policy Enforcement

Policy enforcement constrains what the agent may say or do through permissions, data-access rules, business rules, safety rules, and escalation.

Use when operating agents under real constraints: cost, policy, evals, events, and durability.

31 Production Runtime
Pattern Advanced 20-35 min design review OperatorReviewer

Event-Triggered Agents

Event-triggered agents run in response to webhooks, queues, schedules, or domain events.

Use when operating agents under real constraints: cost, policy, evals, events, and durability.

32 Production Runtime
Pattern Advanced 20-35 min design review OperatorReviewer

Mastra Runtime

Mastra is a TypeScript runtime pattern for applications that need agents, workflows, tools, memory, evals, and observability in one framework.

Use when operating agents under real constraints: cost, policy, evals, events, and durability.