Skip to content

Vol. III · Single-Agent Patterns · III.1

Prompt Chaining

A sequence of LLM calls where each step's output is the next step's input, with programmatic gates between them. The first workflow to reach for.

5 min read

Doctrine

  • Chain when the task decomposes into named stages with checkable intermediates.
  • Put code between hops: schema validation, regex, policy, retrieval.
  • Trade latency for accuracy only when the eval says the extra hop pays for itself.

When chaining wins

Outline → critique outline → draft → translate. Each hop has a job the next hop should not redo. Anthropic's examples (marketing copy then translation; outline then document) still hold.

LangChain began as this pattern. It remains correct. The mistake was treating every problem as a chain of hidden prompts.

Anti-patterns

  • A chain of five calls that could be one with a better prompt.
  • Passing unconstrained prose between stages with no schema.

Related