liveBook · Manning

Chapter 2: Turn a task into an agent architecture

What you will learn in chapter 2 of Designing AI Agents

The introduction frames agent architecture as a set of choices driven by a business task and its constraints, rather than by a preferred pattern.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction frames agent architecture as a set of choices driven by a business task and its constraints, rather than by a preferred pattern.

Key terms: business task, constraints, pattern selection

2.1 Choose the capabilities the task requires

This section frames agent architecture as a set of design concerns whose required capabilities depend on the task.

Key terms: capability, architecture, reasoning, evaluation, collaboration, governed

2.1.1 The agent capability stack

The section presents seven cognitive modules as a task-specific design checklist, groups them into three layers, and cautions that adding modules must be justified by the task rather than treated as progress toward maturity.

Key terms: cognitive modules, Perception, Memory, Reasoning, Action, Reflection, Core Cognition, Meta-Cognition, System Intelligence, design responsibilities

2.1.2 Design the cognitive engine: The Perception-Reasoning-Action loop

This section explains how an agent’s PRA cycle, reflection, and memory work across iterations, and why reliable architecture must limit compounding errors.

Key terms: PRA loop, Perception, Reasoning, Action, Observe Result, reflection loop, self-evaluation, PRA cycle, memory loop, persistence

2.2 Turn capabilities into a system architecture

This section introduces the General Agent Architecture as a way to make capability-to-system design decisions visible and explains how to read its main boundaries and arrows.

Key terms: General Agent Architecture, cognitive modules, runtime infrastructure, external world, Governance controls, Runtime, information flow, containment

2.2.1 How information flows through cognitive modules

The section connects seven cognitive modules into an agent architecture by tracing the primary, feedback, persistence, and collaboration paths under governance constraints.

Key terms: Perception, context engineering, Reasoning, primary path, PRA loop, Action, execution evidence, task completion, intended effect, Reflection

2.2.2 Runtime virtual machine

This section explains the runtime virtual machine as the non-cognitive infrastructure that supports, connects, and makes an agent’s decisions inspectable in production.

Key terms: runtime virtual machine, LLM, context window, operating-system analogy, anterograde amnesia, short-term state, durable files, state stores, MCP Host, Model Context Protocol

2.2.3 The external world boundary

This section identifies who and what interacts with an agent across its system boundary and explains why consequential actions need governance.

Key terms: external world, agent system boundary, Human users, Other agents, Digital environment APIs, Governance, Agent-to-Agent (A2A), Agent Cards, runtime, code-level interface

2.2.4 How production systems instantiate the architecture

This section compares production runtime strategies and shows why agent architectures invest selectively according to workload.

Key terms: runtime virtual machine, extension-layered, Plugins, sandbox-first, context-engine-centric, Context Engine, reference model, Perception, Governance, Memory

2.3 Use the two-axis map to compare pattern choices

This section introduces a two-axis map for comparing agent patterns against a task’s needs and constraints.

Key terms: cognitive function, execution topology, Y-axis, X-axis, outcome, dominant constraint, cost, latency, failure modes, trust boundaries

2.3.1 The execution topology axis

This section defines execution topology as the shape of work flow, distinguishes it from cognitive purpose, and adds Hierarchy as a sixth flow shape.

Key terms: execution topology, cognitive function, Evaluator-Optimizer loop, Hierarchy, six neutral topology names, multi-level delegation

2.3.2 Why you need both dimensions

This section shows why agent patterns need both a cognitive-function coordinate and an execution-topology coordinate to distinguish their structure and failure modes.

Key terms: topology, cognitive function, two coordinates, failure modes, trade-offs, Generator-Critic, Iterative Hypothesis Testing, Adversarial Review, rubber-stamps, confirmation bias

2.3.3 The complete pattern map

This section shows how the two-axis pattern map helps engineers find, compare, and discuss design options while treating empty cells as questions rather than impossibilities.

Key terms: cognitive functions, execution topologies, coordinate, Navigation, Communication, Reasoning row, Chain-of-Thought, Complexity-Based Routing, Parallel Exploration, Iterative Hypothesis Testing

2.3.4 Scope and limitations of the map

This section explains what the two-axis map contributes, what it leaves out, and why its pattern choices must remain conditional and revisable.

Key terms: cognitive axis, orthogonal organization, shared coordinate system, two-dimensional map, autonomy level, trust boundaries, failure modes, cost constraints, latency budgets, bounded context

2.3.5 The pattern selection card

The section uses a three-panel card to turn a business problem into a testable agent architecture, then compares suitable pattern choices by token cost.

Key terms: Pattern Selection Card, ASSESS, ROUTE, SELECT, cognitive function, function-topology coordinates, Argus, Perception, Reasoning, Reflection

2.3.6 How to read the rest of this book

Explains how to read the pattern map and choose a topology based on the task rather than treating its columns as a progression.

Key terms: cognitive functions, dependency shapes, topology, Chain, Route, Parallel

2.4 Decide when to scale beyond one agent

This section sets a one-agent default and explains when evidence and expected benefits justify the costs of adding agents.

Key terms: one agent, structural boundary, coordination cost, state ownership, communication, observability, error handling, latency, debugging paths

2.4.1 Start with the single-agent default

This section sets out when one agent should remain the default instead of adding multiple agents.

Key terms: context window, consistent mental model, sequential, one expertise, PRA loop, coherent state, burden of proof

2.4.2 Scale only after hitting a structural wall

This section identifies the structural limits that justify testing a multi-agent design and maps each limit to a collaboration pattern.

Key terms: single-agent design, context window, reasoning history, PRA loop, multi-agent structure, context overflow, expertise specialization, parallelism, adversarial verification, Hierarchical Delegation

2.4.3 What multi-agent costs you

This section explains the costs of adding agents, when those costs are justified, and how a primary agent can retain integration authority while delegating bounded work.

Key terms: coordination cost, error amplification, debugging opacity, measured single-agent limitation, task success, latency, token cost, debugging effort, primary agent, bounded sub-agents

2.5 Set trust boundaries before granting autonomy

This section explains how to grant agents only the action-level authority they need, adjust trust from observed behavior, and enforce boundaries outside model reasoning.

Key terms: autonomy, reversibility, blast radii, authority, approval rules, trust, review, promote, demote, approval gates

2.6 Apply the decisions: The Argus skeleton

This section introduces Argus as a minimal PRA-loop architecture that can grow when evidence justifies added complexity.

Key terms: minimum capabilities, PRA loop, extension points

2.6.1 The PRA loop in 50 lines

Shows how Argus’s minimal, single-pass review maps to Perception, Reasoning, and Action.

Key terms: Argus, Perception, Reasoning, Action, PRA loop, single-pass prompt

2.6.2 Try it yourself

This subsection uses a deliberately vulnerable sample diff to check Argus’s review output and identify two possible failure modes.

Key terms: argus/core.py, SQL injection vulnerability, false positives, Generator-Critic loop

2.6.3 The same pattern, different frameworks

Shows that the same Argus Perception-Reasoning-Action (PRA) architecture can be implemented in different frameworks, with different parts of the loop exposed.

Key terms: PRA loop, Claude SDK, OpenAI Agents SDK, Runner.run_sync(), LangGraph

2.7 Summary

2.8 References

This section lists the sources cited in the chapter on turning a task into an agent architecture.

Where this is used later

Concepts explained in this chapter

← Chapter 1: The agent paradigm shift Chapter 3: Perception: What your agent sees determines what it does →

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.