Overview

1 When and why to use agent design patterns

Agents emerge as a practical response to the limits of foundation models: while these models are impressively flexible, they can also be unreliable, prone to hallucination, and difficult to control in business settings. By narrowing the scope of what the model must do, feeding it better prompts and better data, and surrounding it with code that checks outputs and handles failures, developers can turn raw model capability into software that performs specific tasks more dependably. In this sense, agents are code-model hybrids that use AI where it adds value, while relying on deterministic orchestration where predictability matters.

The chapter frames agent design patterns as reusable behavioral modules that capture common engineering solutions for building such systems. These patterns help developers simplify and standardize agent design, separate design choices from parameter tuning, and make it easier to improve agents without rewriting them from scratch. They are presented as composable building blocks that can be applied to increase capability, robustness, reliability, interpretability, and often cost efficiency, especially when agents need to work with external tools, curated information sources, or multi-step workflows.

More broadly, the chapter argues that agents are worth building because they can provide more utility than plain models, particularly when users need access to specialized tools, contextual information, or carefully constrained behavior. At the same time, the author suggests that the future of agents is not threatened by ever-more-powerful foundation models, because many agentic applications depend on local context, proprietary workflows, and human control that generic models are unlikely to replace. The main takeaway is that disciplined agent design is not just about making AI work, but about making it work reliably, transparently, and in ways that are useful for real-world software systems.

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.

FAQ

What is an AI agent, and how is it different from a plain language model?An AI agent is a software system whose core functionality depends on AI models and that performs a chosen class of tasks, often tasks that traditional software cannot solve well without human input. Unlike a plain model, an agent combines models with code, tools, prompts, and control logic to carry out a task more reliably and usefully.
Why do engineers build agents instead of using foundation models directly?Engineers build agents to make foundation models more useful, reliable, interpretable, and sometimes cheaper. By narrowing the task, controlling the process, using better data, and adding code to detect failures, they can tame model weaknesses and turn them into practical software.
What are the main benefits of using agent design patterns?Agent design patterns help improve performance, interpretability, alignment, and cost. They also make agent design easier to understand, explain, test, and modify by breaking behavior into reusable building blocks.
How do agent design patterns improve reliability?They improve reliability by reducing internal failures in the agent’s code-model workflow. For example, a pattern may constrain the model’s responsibilities, enforce fixed steps, or supervise tool and output selection so the agent fails less often during execution.
What does “capability” mean in the context of agent design?Capability means the agent can correctly handle new classes of inputs, gain new functionality, or ground its decisions in more relevant information. In short, an ADP increases capability when it helps the agent do more or do better at the task.
What is the difference between robustness and reliability in agents?Robustness is about whether the agent still succeeds when inputs or task structure change, such as with messy or disguised inputs. Reliability is about whether the agent’s internal process completes without technical failure, such as malformed model outputs or empty search results.
Why are agents considered more interpretable than raw AI models?Agents are often more interpretable because model calls are limited, logged, parsed, and routed through known components. This gives developers more visibility into what the system did and why, making it easier to inspect and explain outcomes.
How can agent design patterns help reduce cost?They can reduce cost by avoiding unnecessary long reasoning searches, using efficient resource access, and structuring the agent to get the needed result quickly. This can lower token usage, query count, and overall operating expense.
Why might rigid code orchestration be preferable to letting the model control everything?Rigid code orchestration can be more reliable and easier to test, especially when correctness matters. It keeps high-level decisions deterministic while still using AI where it adds value, which is often better than giving the model full control.
Will agents become obsolete as foundation models improve?Not necessarily. The chapter argues that specialized agents remain useful because they can access local or proprietary information, support confidentiality, embed business-specific processes, and give users more control than broad frontier models often do.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Agent Design Patterns ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Agent Design Patterns ebook for free