Start with the simplest thing; add complexity only when it demonstrably improves outcomes — weighed against cost and latency.
Exam tell: distractors that bolt on a routing layer, a separate ML classifier, or more tools when a simpler fix (better prompt, better tool description) would do are usually wrong. When unsure between a simple and a complex option, prefer simple.
Every pattern is built from one block: an LLM augmented with retrieval + tools + memory, behind a well-documented interface (MCP is one standard way to wire tools in).
| Workflow | Agent | |
|---|---|---|
| Control | predetermined code paths | LLM decides next steps in a loop, from environment feedback |
| Use when | task well-defined, predictable sequence, latency-sensitive | open-ended, step count unpredictable, needs autonomy |
| Cost / risk | predictable, consistent | higher cost + error compounding → needs guardrails / sandbox |
Sequential steps; each call uses the previous output, with programmatic gates checking intermediate results.
Use when: subtasks are fixed and decomposing simplifies each call (outline → draft; draft → translate).
Classify the input, then send it to a specialized prompt/model.
Use when: distinct categories need different handling; or route easy→small model, hard→big model.
Run calls at once and aggregate. Sectioning = split into independent subtasks. Voting = run the same task several times for confidence.
Use when: speed (sectioning) or higher confidence via multiple looks (voting — e.g., several independent code reviews).
A central LLM dynamically decomposes the task, delegates to workers, and synthesizes.
Use when: subtasks can't be predetermined — they depend on the specific input (multi-file code changes, research).
One LLM generates; another critiques in a loop until criteria are met.
Use when: clear eval criteria exist and iteration measurably helps (literary translation, multi-round search).
Both fan out to multiple calls. The split is when the subtasks are decided:
Echo of Lesson 0003: emitting several Task calls in one turn for known independent work = sectioning;
a coordinator that figures out the split per query = orchestrator–workers. Either way, subagents share no memory.