1 When and why to use agent design patterns
The chapter opens by showing a familiar failure mode of language models: even with careful prompting, they can ignore instructions, wander off-task, or produce incomplete results. The practical response is not simply to ask the model harder, but to narrow the task, supervise it more closely, and add code that can detect problems and steer the process. From this perspective, an AI agent is software that combines AI models with structured control logic so the system can reliably complete a chosen class of tasks.
Agents are presented as code-model hybrids in which decision-making shifts between deterministic software and model-driven behavior. The chapter explains that while models provide flexible understanding, generation, and planning, they are also unreliable on their own, so agents are built to constrain that freedom where necessary. This can improve utility, reliability, interpretability, and sometimes cost, because the system can be designed to use curated data, specialized tools, fixed workflows, and repeated checks instead of depending entirely on open-ended model reasoning.
The chapter also introduces agent design patterns as reusable behavioral modules that capture common solutions to recurring engineering problems in agent design. These patterns help standardize how agents are built, make design choices easier to explain, and separate structural decisions from parameter tuning. By treating patterns as composable building blocks, the book aims to support the creation of more capable, robust, and testable agentic systems while offering a practical framework for improving existing ones.
Summary
- The widespread challenges of AI models, specifically their notorious unreliability and tendency to disregard instructions, led to the development of AI agents, which can enable autonomous, multi-step workflows that incorporate planning, tool usage, and self-correction. By integrating AI into structured, transparent processes, agents deliver increased utility, reliability, and interpretability compared to direct model usage.
- Agent design patterns (ADPs) are recurring behavioral abstractions that make AI models more useful and reliable within agentic systems. ADPs address common design challenges, enabling systematic improvements in agent capability, robustness, reliability, interpretability, alignment, and cost.
- By applying these patterns, agent designers can disentangle complex quality concerns and make targeted enhancements to their agents. The ADPs in this book are common functional blocks for building agents that deliver these qualities. ADPs also help designers standardize approaches and quickly adapt agents to specific constraints.
- Despite speculation that agents will become obsolete, several factors—including access to private information sources, process-based design advantages, and user preference for observable, easily controlled systems—suggest that agents will remain relevant.
Agent Design Patterns ebook for free