AI Orchestration Patterns
Production-tested patterns for building reliable AI agent workflows. Each pattern includes a problem statement, diagram, and code examples in TypeScript and Python.
Fan-out / Fan-in
Deep ResearchDecompose a task into parallel subtasks, then aggregate results into a single output.
View pattern →Adversarial Verification
Codebase ReviewSpawn independent skeptic agents to attempt to refute each finding before it's accepted.
View pattern →Loop Until Dry
Codebase ReviewKeep spawning discovery agents until N consecutive rounds return nothing new.
View pattern →Human-in-the-Loop Checkpoint
Repo MigrationPause execution at a named gate and wait for a human to approve before continuing.
View pattern →Model Fallback Chain
Cross-cuttingDefine a primary model and one or more fallbacks. Automatically route when the primary is unavailable or over budget.
View pattern →Cost-Bounded Research
Deep ResearchSet a hard USD ceiling on a task. Execution halts gracefully when the budget is exhausted.
View pattern →