Agent architectures
Teach stable orchestration patterns before component and framework detail.
Follow the chapters in order. Each one combines a clear explanation, local illustrations, traceable sources, and runnable examples where code helps.
Module Overview & Outcomes
Section titled “Module Overview & 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.
Required Concepts & Scope
Section titled “Required Concepts & Scope”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.
Published chapters in this section
Section titled “Published chapters in this section”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.
- 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.
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.
- 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.
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.
- 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.
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.
- 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.
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.
- 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.
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.
- 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.
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).
- 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.
Architecture trade-offs
Compares orchestration patterns across determinism, latency, token expenditure, observability, failure propagation, and termination guarantees to guide minimal architecture selection.
- 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.
