What you will learn in Agent Design Patterns
Elements, components, and architecture
Chapter by chapter
Chapter 1: When and why to use agent design patterns
This introduction frames agents as software that makes imperfect AI models more reliable and introduces agent design patterns as reusable solutions to common agent-design challenges.
What you learn in chapter 1 →Chapter 2: Working with ADPs: Building a mortgage advisor tool
This introduction frames a reliable mortgage-advisor agent as a case study and outlines its information-gathering, analysis, reporting, and compliance workflow using agent design patterns.
What you learn in chapter 2 →Chapter 3: Errand: Breaking complex workflows into units
This introduction frames Errand as a pattern for decomposing complex agent workflows into small intelligent pipelines that control context, improve maintainability, and enable parallel execution.
What you learn in chapter 3 →Chapter 4: Guardrail: A gating mechanism to boost reliability
This chapter introduces Guardrail as a pattern that uses specialized gating models to make agentic systems safer, more reliable, and more trustworthy.
What you learn in chapter 4 →Chapter 5: Resampler: Reliability through repeated sampling
This introduction frames stochastic model output as a reliability risk at code–AI interfaces and introduces Resampler as a retry-and-check loop that can both constrain and exploit variation.
What you learn in chapter 5 →Chapter 6: Voter: Leveraging stochasticity for improved outputs
This introduction shows how the Voter pattern turns variable model outputs into a more robust answer and a signal of uncertainty.
What you learn in chapter 6 →Chapter 7: Retriever: Returning more relevant results
Introduces the Retriever pattern as a way to search large information sources cheaply, then give an agent a small, relevant context for reasoning.
What you learn in chapter 7 →Chapter 8: Decompose-Process-Recompose: Handling large inputs with accuracy
This introduction explains why large inputs degrade model performance and how Decompose-Process-Recompose (DPR) produces one reliable answer by analyzing smaller fragments and combining the results.
What you learn in chapter 8 →Chapter 9: Router: Classifying and dispatching
The introduction explains why a single general-purpose agent can struggle with specialized tasks and presents Router as a unified interface that classifies requests and dispatches them to suitable specialists.
What you learn in chapter 9 →Concepts explained in this book
- AI agentA software system that uses an AI model, together with prompts, data, and programmatic control, to perform tasks.
- guardrailAn agent component that evaluates content against specified requirements and decides whether it may proceed.
- ResamplerAn agent design pattern that repeats stochastic model attempts and assesses their outputs to find an acceptable result.
- reliabilityReliability is the degree to which a system consistently produces correct and dependable results under expected conditions.
- intelligent elementAn agent component that uses AI to assess information or perform a focused function.
- VoterVoter is an agent design pattern that aggregates outputs from multiple invocations to provide a robust result or confidence information.
- decompositionThe division of a complex task or workflow into smaller, focused units.
- ErrandErrand is an agent design pattern that groups one or a few intelligent elements and procedures into a simple sequential or parallel-then-sequential operation with a final output.
- randomnessThe property of involving chance or probabilistic variation rather than fully deterministic behavior.
- RetrieverAn agent design pattern that retrieves relevant information from a larger data source to provide focused context for downstream processing.
- samplingSampling is the process of generating or selecting an output from a stochastic model or operation.
- interpretabilityInterpretability is the extent to which an agent's internal routines and outcomes can be understood by a developer or user.
- costCost is the expenditure associated with operating an AI agent, summarized here primarily by resource usage or monetary charges.
- subagentAn agent that operates under the coordination or supervision of another agent.
- DPR patternAn agent design pattern whose described components include a Decomposer that dispatches work and a Recomposer that combines partial intermediaries into a single outcome.
- context windowA context window is the maximum amount of input information a language model can consider in a single invocation.
- embeddingA numerical vector representation of data, often designed to encode semantic features for computational comparison.
- recompositionThe unification of outputs from separate processing steps into a final response that reflects the original task's global context.
- agentic applicationA software application whose operation relies on AI capabilities for essential functions while combining model-driven behavior with traditional software.
- model-to-code interfaceA code–AI interface is a boundary where program code exchanges model outputs that must conform to machine-readable expectations.
- InterlocutorInterlocutor is an agent design pattern for conversationally gathering required information through an internal agenda, follow-up questions, input correction, and a completion decision.
- lexical searchKeyword-based search retrieves information by matching query terms against terms in the searchable data.
- ai agencyDecision-making authority exercised by an AI model over how a software system handles inputs and selects actions.
- code agencyThe form of agency in which currently executing program code determines what happens next.
- model agencyModel agency is the form of agency in which AI-model outputs guide the selection of the next action.
- code orchestrationCode orchestration is the coordination of AI models and traditional software through a predetermined, rigid, and tractable program process.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
