Agentic Architecture & Orchestration

7 build exercises to practise the concepts in this domain.

1.1Build a Multi-Tool Agent Loop

Intermediate
45 minutes
  • How the agentic loop lifecycle works with the Messages API
  • Why stop_reason is the authoritative signal for loop control
  • How to handle tool_use and end_turn stop_reason values correctly
  • How to append tool results to conversation history for multi-turn execution
  • When safety iteration caps are appropriate versus inappropriate as stopping mechanisms

1.2Build a Hub-and-Spoke Research Coordinator

Intermediate
60 minutes
  • How hub-and-spoke architecture centralises all communication through a coordinator
  • Why subagent isolation means every piece of context must be explicitly passed
  • How to implement broad task decomposition that avoids the narrow decomposition failure
  • How iterative refinement loops detect and fill coverage gaps
  • Why tracing failures to the coordinator decomposition is the correct diagnostic approach

1.3Implement Context Passing with Structured Metadata

Intermediate
50 minutes
  • Why the coordinator allowedTools must include Task to spawn subagents
  • How to design structured metadata that separates content from source attribution
  • Why context passing failures cause attribution errors in downstream agents
  • How to spawn independent subagents in parallel for reduced latency
  • The difference between fork_session and parallel Task invocation

1.4Build a Prerequisite Gate for Financial Operations

Advanced
60 minutes
  • Why programmatic enforcement is required for financial operations instead of prompt-based guidance
  • How prerequisite gates physically block tool execution until preconditions are met
  • The difference between the 8% prompt failure rate and 0% gate failure rate
  • How to implement structured handoff protocols with all required fields
  • How multi-concern requests should be decomposed and handled in parallel

1.5Implement Agent SDK Hooks for Normalisation and Policy Enforcement

Advanced
60 minutes
  • The distinction between PostToolUse hooks (after execution, data normalisation) and tool call interception (before execution, policy enforcement)
  • Why hooks provide deterministic guarantees that prompts cannot match
  • How to normalise heterogeneous data formats from multiple MCP tools into a consistent schema
  • How to implement threshold-based and prerequisite-based policy enforcement using pre-execution hooks
  • The decision framework: hooks for 100% requirements, prompts for preferences

1.6Build a Multi-Pass Code Review Pipeline

Advanced
60 minutes
  • Why attention dilution produces inconsistent analysis depth across files in single-pass reviews
  • How multi-pass architecture (per-item + cross-item) solves the structural attention allocation problem
  • The difference between fixed sequential pipelines and dynamic adaptive decomposition
  • Why batching without a cross-file integration pass still misses cross-cutting issues
  • How to identify attention dilution artefacts: same pattern flagged in one file, approved in another

1.7Implement Session Management Strategies

Intermediate
45 minutes
  • The three session management options: resume, fork_session, and fresh start with summary injection
  • Why resuming after file changes leads to the stale context problem
  • How structured summary injection preserves knowledge without stale tool results
  • When targeted re-analysis is more efficient than full re-exploration
  • The difference between fork_session (divergent exploration) and resume (continuation)