Asking a model to do everything in one prompt often produces mediocre results. Prompt chaining splits a task into focused steps.
Example: Writing a Report From Research Notes
- Extract: pull key findings and figures from each source.
- Organise: group findings into themes.
- Outline: propose a structure.
- Draft: write each section from the outline and findings.
- Review: check facts and consistency against the extracted findings.
Benefits
- Each prompt is simpler and more reliable.
- Intermediate outputs can be inspected and corrected.
- Steps can use different models — cheap ones for extraction, capable ones for drafting.
- Failures are easier to locate and fix.
- Steps can be tested independently.
Designing Chains
- Pass structured outputs (lists, JSON) between steps.
- Keep each step's instructions focused on one job.
- Validate outputs between steps.
- Allow human review at key points for important work.
Chains Versus Agents
In a chain, you fix the steps in code. In an agent, the model decides the steps. Chains are more predictable and easier to test; use them when the process is known.
Watch for Error Propagation
A mistake early in the chain carries forward. Put validation after the steps most likely to go wrong.