One call is not always enough
Prompt chaining links several model calls so the output of one becomes the input of the next. Instead of one giant prompt, you build a pipeline where each link has a narrow job.
Common patterns
- Sequential where extract feeds summarize feeds translate, each step refining the last.
- Router where a first call classifies the request and dispatches to the right specialized prompt.
- Map then reduce where a prompt runs over many chunks and a final prompt merges the partial results.
Why chain
Each link is short, focused, and testable, which lifts reliability over one overloaded prompt. You can cache stable links, retry only the failing one, and inspect the intermediate outputs to see where a chain went wrong.
Watch the joints
The weak point is the seam between links. A malformed output from one link breaks the next, so validate each handoff, keep a consistent format between steps, and handle failures at each joint rather than only at the end.
Key idea
Prompt chaining wires focused calls into a pipeline where each output feeds the next, raising reliability and debuggability, as long as you validate the handoffs between links.