Compare the Six Patterns
Side by side on control flow, cost/latency, best fit and a representative example. Filter by kind, sort any column.
| Pattern | Kind | Control flow | Cost / latency | Best for | Example |
|---|---|---|---|---|---|
| Prompt chaining | Workflow | Fixed sequence, gates between steps | Low–medium | Cleanly decomposable fixed subtasks | Write copy → translate it |
| Routing | Workflow | Classify, then branch to a handler | Low (+1 classify) | Distinct categories handled separately | Triage support tickets |
| Parallelization | Workflow | Fan out, then aggregate (sectioning / voting) | Higher (×N calls) | Independent subtasks; multiple attempts | Many prompts vote on code safety |
| Orchestrator–workers | Workflow | Central LLM splits subtasks at run time | High | Subtasks can't be predicted up front | Edit code across many files |
| Evaluator–optimizer | Workflow | Generate → evaluate → refine, looped | Medium–high (loop) | Clear criteria; refinement adds value | Literary translation with feedback |
| Autonomous agent | Agent | LLM directs itself in a tool loop | Highest, variable | Open-ended; steps can't be hardcoded | Coding agent solving SWE-bench |