1 The agent paradigm shift
In this chapter, the central idea is that AI agent systems represent a shift from software where developers hard-code every branch to systems where a language model chooses actions at runtime inside an engineered harness. That harness supplies context, memory, permissions, budgets, and stopping rules, while the model provides flexibility and the harness provides reliability. The chapter uses a code review agent, Argus, to show how a real task is no longer just a pipeline of fixed steps, but a loop in which the system perceives evidence, decides what to do next, and adapts as new information appears.
The chapter also explains why existing software patterns are not enough on their own. Classic design patterns assume human-controlled decisions, known object types, and predictable delivery, but agent systems move those decisions inside the machine and into an open-ended, language-driven runtime. To make sense of this, the chapter introduces three major uncertainties: output uncertainty, where the model may answer differently each time; behavioral uncertainty, where the agent’s next move cannot be fully predicted in advance; and environmental uncertainty, where the outside world changes between observations. These pressures make reliability, state management, and tool use core architectural concerns rather than afterthoughts.
Finally, the chapter reframes agent engineering as a matter of specification, constraints, and evaluation. It presents seven cognitive functions—perception, memory, reasoning, action, reflection, collaboration, and governance—as a reference architecture for organizing design choices, and shows how Argus combines them in stages to review a pull request. The broader message is that agent engineering is less about writing the agent’s code and more about designing the boundaries in which it operates, including what it can see, what it can do, how it recovers from failure, and how it is judged. In that sense, the engineer becomes more like a gardener than a watchmaker, shaping conditions that let capable but unpredictable systems behave usefully and safely.
A deterministic pipeline has a fixed sequence, while an agent loop is a model-driven cycle in which reasoning and planning may interleave during execution.
How four GoF patterns break and what replaces them in agent systems.
Selected pattern lineages, from GoF through distributed systems to agent systems. The arrows trace recurring design pressures across distinct implementations.
The seven cognitive functions for processing a pull request review. The arrows show information flow. The dashed box shows governance controls reaching across the pipeline; the four governance patterns retain their matrix coordinates.
The two creations in agent engineering: specification as mental creation, running agent as physical creation.
Summary
- Agent architecture is bounded resource allocation under uncertainty: the model spends; the harness budgets.
- Agent systems introduce three fundamental uncertainties that break the assumptions underlying classical design patterns: output (same prompt, different responses), behavioral (agent selects its own strategy at runtime), and environmental (the world changes between observations). Treating uncertainty as the default operating condition is the paradigm shift.
- Agent design patterns inherit recurring engineering pressures from earlier systems. Cache hierarchies inform tiered memory, circuit breakers inform loop detectors, and saga transactions inform plan-and-execute workflows. The medium has changed from deterministic code to probabilistic language models, while the pressures recur. Experienced engineers already have the right intuitions. This book gives them the vocabulary to design, review, and communicate about agent architectures within their teams.
- The seven cognitive functions (perception, memory, reasoning, action, reflection, collaboration, and governance) organize 28 named patterns across six execution topologies. This two-dimensional framework (what the agent does × how it does it) is the map for the rest of this book.
- Design inversion treats the specification as source code and the agent as its compiler. Past the implementation plateau, further code improvements yield diminishing returns, so the developer's role shifts toward designing specifications that constrain the generated behavior.
- Token leverage, the ratio of output quality to token cost, helps teams evaluate designs alongside reliability and latency, especially when usage scales.
Designing AI Agents ebook for free