Skip to content
Start ReadingGitHub
Section overviewPass 1: Architectures

Agent architectures

Teach stable orchestration patterns before component and framework detail.

Pass 1: Architectures · 8 published chapters

Follow the chapters in order. Each one combines a clear explanation, local illustrations, traceable sources, and runnable examples where code helps.

Prerequisites

Agent foundations.

Learning outcomes

The reader can choose and diagram single-agent loops, routers, pipelines, parallel workers, evaluator-optimizer loops, plan-execute systems, supervisors, handoffs, and event-driven graphs.

Begin with the least dynamic design that solves the task. Add routing, parallelism, loops, planning, evaluation, durable graphs, and multi-agent control. Distinguish architecture patterns from the runtime harness that realizes them. Compare determinism, latency, cost, debuggability, failure propagation, and termination.

Chapter 1 Main path

Architecture selection criteria

Establishes a systematic decision framework and trade-off matrix for selecting among deterministic workflows, single-agent loops, and multi-agent coordination patterns based on latency, cost, determinism, and failure containment.

Key Topics:
  • Classify AI orchestration architectures across four distinct tiers of agency from fixed pipelines to multi-agent networks.
  • Apply the Principle of Least Agency to select the most deterministic architecture that reliably fulfills system requirements.
  • Evaluate trade-offs across latency, token cost, debuggability, state durability, and failure blast radius.
Chapter 2 Main path

Single-agent and reactive loops

Explores the internal mechanics, state progression, and failure modes of single-agent ReAct loops, detailing how models interleave reasoning with dynamic tool actions and how host runtimes enforce termination guardrails.

Key Topics:
  • Trace the step-by-step mechanics of the ReAct (Reason + Act) loop pattern.
  • Manage context accumulation, observation overload, and semantic drift across multi-turn runs.
  • Implement deterministic host guardrails including turn budgets, tool timeouts, and loop detectors.
Chapter 3 Main path

Sequential, routing, and parallel workflows

Deep dive into deterministic workflow orchestration topologies including linear prompt chaining, conditional routing, parallel sectioning, and consensus voting, emphasizing error isolation and validation gates.

Key Topics:
  • Construct linear prompt chaining pipelines with structured intermediate validation checkpoints.
  • Design classification-based routing workflows that steer requests to specialized handlers.
  • Implement parallel sectioning (Map-Reduce) and consensus voting (Self-Consistency) workflows.
Chapter 4 Main path

Plan and execute

Explores the plan-and-execute architectural pattern, detailing how separating strategic task planning from tactical action execution and dynamic replanning improves reliability on complex long-horizon tasks.

Key Topics:
  • Contrast the global strategic horizon of plan-and-execute with greedy single-step reactive loops.
  • Implement decoupled planner, executor, and replanner components within stateful graph engines.
  • Manage explicit plan state boards tracking step dependencies and lifecycle statuses.
Chapter 5 Main path

Evaluator-optimizer and reflection

Explores the evaluator-optimizer and reflection patterns, detailing how decoupled generator and evaluator models iteratively critique, score, and refine outputs against deterministic tests and semantic rubrics.

Key Topics:
  • Construct iterative generator-evaluator loops using explicit scoring rubrics and acceptance thresholds.
  • Integrate deterministic verifiers (compilers, linters, unit tests) with LLM-as-a-judge evaluators.
  • Implement episodic verbal reflection (Reflexion) to record critique history and prevent repetitive errors.
Chapter 6 Main path

State machines and event-driven graphs

Explores state machines and event-driven graphs for AI agents, detailing typed state schemas, cyclic nodes, conditional edge routing, durable checkpointing, and asynchronous human-in-the-loop interruption.

Key Topics:
  • Model agent workflows as deterministic state graphs with explicit state schemas and state reducers.
  • Implement cyclic execution topologies with conditional branching edges and termination guards.
  • Integrate durable checkpoint stores to snapshot state across long-running executions.
Chapter 7 Main path

Supervisors, handoffs, and agent-as-tool

Explores multi-agent coordination architectures, comparing centralized supervisors (manager-worker), decentralized peer handoffs (swarm), and encapsulated subagents (agent-as-a-tool).

Key Topics:
  • Distinguish hierarchical supervisor architectures from peer-to-peer handoffs and tool-encapsulated subagents.
  • Implement context isolation to prevent context window bloat and enforce least privilege across subagents.
  • Construct function-based transfer routines for deterministic peer handoffs.
Chapter 8 Main path

Architecture trade-offs

Compares orchestration patterns across determinism, latency, token expenditure, observability, failure propagation, and termination guarantees to guide minimal architecture selection.

Key Topics:
  • Evaluate the six core trade-off dimensions across deterministic pipelines, reactive loops, evaluator-optimizer loops, state graphs, and multi-agent systems.
  • Apply the simplicity principle to select the least dynamic architecture that satisfies functional requirements.
  • Calculate token cost and latency multipliers when transitioning from single-agent to multi-agent topologies.

Security & Threat Model Connections (Pass 2 Preview)

Section titled “Security & Threat Model Connections (Pass 2 Preview)”

Each pattern links forward to compound-risk analysis in end-to-end attack paths.