A sequential composition where each stage’s output is the next stage’s input. The pipeline as a whole performs what no single stage could do alone — decomposing a complex task into a chain of simpler stages, each specializable to its own narrow function. The diagnostic property: each stage’s output is a well-typed input for the next stage, even if the data shape evolves across the pipeline.The concept is distinct from evaluator-optimizer (which iterates on the same content) and from orchestrator-workers (which parallelizes independent sub-tasks). Prompt-chaining is sequential — stage N+1 depends on stage N’s output. The cost: bottleneck-buffer dynamics apply (the slowest stage limits throughput; failures cascade unless each stage validates input from the previous).
User-initiated: User describes multi-stage workflow, pipeline, sequential prompts, or “do A then B then C.” Vocabulary cues: “prompt chaining,” “pipeline,” “sequential,” “stage one, stage two.”Agent-initiated: Agent notices a task that decomposes into sequential stages, each with a clear output→input handoff. Candidate inference: “the stages are sequential; the pipeline pattern fits.”Situation-shape signals: Tasks with clear sequential dependencies. Existing pipelines (data, compilation, drug synthesis) being adapted. Workflows where each stage’s output is well-typed for the next.
Parallelizable tasks where sequential dependency is artificial — when stages don’t actually depend on each other’s output, parallel execution (orchestrator-workers) is faster.
Tasks requiring iteration on the same content — evaluator-optimizer fits better than chaining when you need to re-process based on critique.
Single-step tasks — by definition the pattern needs ≥2 stages.
Highly coupled stages that share state — when stages need to communicate beyond the linear output→input handoff, a richer coordination pattern (blackboard, mediator) fits.
flow — prompt-chaining is flow at the prompt level; pipeline = flow with stages.
stack-layer — pipeline stages can be viewed as layers; the abstraction stacks naturally.
evaluator-optimizer — contrast: chaining is sequential, evaluator-optimizer is iterative. The two can compose at the meta-level (each stage in a chain can itself run an evaluator-optimizer loop).
orchestrator-workers — contrast: chaining is sequential, orchestrator-workers is parallel; sometimes the orchestrator dispatches stages-of-a-chain to workers in parallel.
bottleneck-buffer — pipelines are subject to bottleneck-buffer dynamics; the slowest stage limits aggregate throughput.
seam — inter-stage data handoffs are seams; format mismatches between stages live there.
A canonical worked example from the Anthropic essay: extract → summarize → categorize → respond. The first stage extracts structured fields from an input; the second summarizes the extracted material; the third categorizes the summary; the fourth composes a response conditioned on the category. Each stage’s prompt does one thing; the output schema between stages is explicit; failures localize to a single stage.
Production lines · engineering-and-technology
each station performs one transformation; output of station N is input of station N+1.
Prompt-chaining is the simplest multi-stage LLM pattern: each stage’s output becomes the next stage’s input, with each stage’s prompt narrowly scoped to a single sub-task. Anthropic’s “Building Effective Agents” essay names it as a baseline pattern — for instance, extract → summarize → categorize → respond, where each step does one thing and passes a structured artifact forward. Its virtues are debuggability (you can inspect each stage’s output) and prompt isolation (each stage can be tuned without entangling the others).Inference: The structural shape — sequential composition where each stage transforms a substrate from upstream into a substrate for downstream — is a foundational primitive that long predates LLMs. UNIX pipes, MapReduce, ETL pipelines, assembly lines, and drug-synthesis pathways all instantiate the same “X feeds Y” shape. The contrast that earns prompt-chaining its name in agent literature is with orchestrator-workers (parallel decomposition) and routing (single-step classify-and-dispatch). The diagnostic question is whether the dependency graph between sub-tasks is genuinely linear. If it is, prompt-chaining; if the sub-tasks are independent, orchestrator-workers; if the routing decision needs to happen up front, a router. Choosing the wrong shape forces awkward serialization or loses parallelism that the task structure would have supported.
Escoffier, *Le Guide Culinaire* (Flammarion, 1903) — the brigade de cuisine. · family-and-consumer-science
Escoffier’s brigade de cuisine organizes a professional kitchen as a sequential pipeline of specialized stations. A commis preps the raw ingredients (mise en place); the chef de partie at the appropriate station cooks the prepared components; a saucier finishes the dish with its sauce; the pass plates and dispatches it. Each station performs one narrow transformation and hands its output to the next station as that station’s input. The stages are the kitchen roles, the inter-stage data is the dish-in-progress moving down the line, and the pipeline as a whole turns out plated dishes at a rate and consistency no single cook working a dish end-to-end could match.Inference: The brigade’s payoff is the same one standardized pipelines earn everywhere: by fixing what each station receives and what it must emit, the kitchen can specialize each role deeply and run many dishes through the line concurrently, each at a different stage. The liability is also the same — the slowest station (often the saucier under load) sets the throughput of the whole pass, the canonical bottleneck dynamic of any staged composition.
Compiler design: standard textbook treatment (Aho et al., *Compilers: Principles, Techniques, and Tools*). · computer-science
The canonical compiler architecture from the “Dragon Book” decomposes a single hard problem — translate source code into executable form — into an ordered pipeline of narrower problems: lexical analysis (text → tokens), syntactic analysis (tokens → parse tree), semantic analysis (parse tree → typed AST), intermediate-code generation (AST → IR), optimization passes (IR → IR), and code generation (IR → target). Each stage consumes a representation produced by the prior stage and produces a representation consumed by the next. No single stage attempts the end-to-end transformation; the pipeline as a whole accomplishes what no single stage could cleanly express.The structural property the architecture exploits is that the intermediate representations are the right shape for the work each stage does. Trying to do optimization on tokens would be incoherent; trying to do parsing on the IR would lose information that was disambiguated upstream. The chained representations are not just a convenience — they are how each stage gets the affordances it needs.Inference: When designing any multi-stage LLM pipeline (or any sequence of transformations on structured data), the load-bearing design question is “what is the right intermediate representation between stages X and X+1?” — not “what prompt should each stage have?” The intermediate-data shape determines what each stage can do; getting it right is the architecture decision the rest of the system rides on.
Compiler stages · computer-science
source → tokens → AST → IR → optimized IR → machine code.
Dean & Ghemawat (2004), "MapReduce: Simplified Data Processing on Large Clusters." · computer-science
Dean and Ghemawat described MapReduce as a two-stage pipeline for embarrassingly-parallelizable processing of very large datasets: a map function applied independently to each input record produces an intermediate key-value stream, which is then grouped by key and fed into a reduce function that aggregates the values for each key into a final result. The framework’s contribution was not the two-stage idea itself (it is essentially a restricted form of prompt chaining where the two stages are fixed shapes) but the operational machinery that makes the pipeline run reliably on commodity hardware at scale — task scheduling, failure recovery, data locality, and the shuffle-and-sort between stages.The constraint that made it scale was structural: by fixing the inter-stage data shape (key-value pairs) and the way control flows between stages (parallel-then-grouped-then-parallel), the runtime can take over the hard parts (where each task runs, how failures are retried, how partial results are combined). The pipeline shape is the affordance.Inference: When a pipeline’s stages have a regular shape — uniform input, uniform output, uniform composition — the architecture can amortize concerns across many invocations: caching, retries, parallelism, observability. This is why production agent pipelines tend to converge on standardized inter-stage shapes (typed messages, schema-constrained payloads) rather than ad-hoc per-stage data formats; the shape is the platform.
Drug-synthesis pathways · chemistry
chemical transformations stage-by-stage; each stage’s product becomes the next stage’s substrate.
**ETL pipelines** (Extract-Transform-Load) — data flows thro · computer-science
ETL pipelines (Extract-Transform-Load) — data flows through fixed stages.
Henry Ford (with Samuel Crowther), *My Life and Work* (Doubleday, Page & Co., 1922), Ch. V — the Highland Park moving assembly line (1913). Scholarly: David A. Hounshell, *From the American System to Mass Production, 1800–1932* (Johns Hopkins University Press, 1984). · engineering-and-technology
Ford’s My Life and Work (1922) gives the first-person account of the moving assembly line installed at Highland Park in 1913, the physical-world archetype of chaining a complex task into ordered, single-operation stages. Ford codifies three principles: place tools and workers in the sequence of operation so each part travels the least distance; use carriers (often gravity-fed) so each worker drops the finished part in a fixed spot that feeds the next worker; and use sliding assembly lines that deliver parts at convenient stations. The breakthrough was decomposing a whole job — building a motor — into many minute, ordered operations (the motor assembly alone was split into 84 stations), each doing one thing and passing its output downstream.Inference: The assembly line is prompt-chaining in steel. The overall task is the finished vehicle; the chained subtasks are the single-operation stations; the intermediate artifact handed between stations is the partially-assembled part. The structural lesson Ford makes vivid is the same one chaining exploits: a task too large or error-prone to do in one undivided step becomes tractable, fast, and inspectable when split into a fixed sequence where each stage has one narrow job and the output of stage N is precisely the input of stage N+1. The line also exposes the failure mode — a slow or defective station stalls everything downstream, the manufacturing analog of a weak link in a chain of prompts.
Berg, Tymoczko, Gatto & Stryer, *Biochemistry* (W. H. Freeman), ch. "Glycolysis and Gluconeogenesis". · chemistry
Glycolysis is a textbook instance of a strictly sequential pipeline. Hexokinase phosphorylates glucose to glucose-6-phosphate; phosphoglucose isomerase then accepts glucose-6-phosphate as its substrate and converts it to fructose-6-phosphate; and so on down a chain of ten enzyme-catalyzed steps. The stages are the enzymes (each a narrow transform), and the inter-stage data is the metabolite that flows from one active site to the next — the product of stage N is the required substrate for stage N+1. Stages cannot be skipped or reordered, because each enzyme recognizes only its specific input molecule. The pathway as a whole accomplishes what no single enzyme could: it extracts usable energy from glucose by composing many small, specialized transformations.Inference: The reason a stage cannot be skipped is that the inter-stage interface is typed — each enzyme’s substrate specificity is exactly the schema constraint that makes the next stage’s input well-formed. The same property is what gives an engineered pipeline its reliability: when each stage emits precisely the shape the next stage expects, the composition is sound; when the handoff shape drifts, the chain breaks at that seam.
MapReduce · computer-science
the Dean-Ghemawat shape: map → shuffle → reduce, with each stage’s output formally typed as input for the next.
Gary & Handwerk, *Petroleum Refining: Technology and Economics*, 4th ed. (Marcel Dekker, 2001). · engineering-and-technology
A refinery separates crude oil through a sequence of distillation columns wired output-to-input. Crude is first fractionated in the atmospheric distillation unit, which draws off the lighter cuts (naphtha, kerosene, diesel) and leaves a heavy residue at the bottom. That atmospheric residue cannot be pushed hotter without thermal cracking, so it is piped as the feed into a second column — the vacuum distillation unit — which lowers the boiling points by reducing pressure and pulls further heavy gas-oil fractions out of it. The stages are the columns, the inter-stage data is the residue stream handed from the first column to the second, and the train as a whole achieves a separation depth that one column operating alone could not.Inference: The reason the residue must go to a second, differently-configured stage rather than being processed harder in the first is a hard physical constraint at the inter-stage boundary (the cracking temperature). Pipelines often split a stage in two precisely because one stage hits a limit the next stage is built to get around — the natural place to introduce a new stage is exactly where the current stage’s operating envelope runs out.
Doug McIlroy’s introduction of pipes to UNIX in the early 1970s is the canonical pre-LLM realization of the prompt-chaining structural shape. command1 | command2 | command3 composes simple utilities into a pipeline where each command reads its predecessor’s stdout as its stdin. The cultural lesson UNIX absorbed — “write programs that do one thing well; write programs to work together; write programs to handle text streams” — is structurally the same advice that makes prompt-chaining reliable: keep each stage focused, define the inter-stage interface explicitly, and let the composition do the work.Inference: The same primitive surfacing across substrates separated by fifty years is exactly the polysemy-as-fossil-record evidence the catalog values. Naming the shape lets engineers recognize a new prompt-chaining design as instance of a well-understood pattern rather than as novel architecture.
Woodward & Doering, "The Total Synthesis of Quinine," *J. Am. Chem. Soc.* 66, 849 (1944). · chemistry
A total synthesis in organic chemistry is a sequential pipeline made physical. Woodward and Doering’s 1944 route toward quinine proceeded as a linear chain of transformations starting from a simple precursor: the purified product of each reaction step became the starting material — the substrate — for the next, building the target molecule’s complexity one well-defined stage at a time. (Their work was a formal total synthesis: it reached quinotoxine, a known relay compound already shown to be convertible into quinine, so the last leg was completed by composing onto an earlier-established chain rather than re-running it.) The stages are the individual reactions, the inter-stage data is the isolated intermediate, and the pipeline as a whole produces a molecule that no single reaction could.Inference: Linear synthesis carries the classic pipeline liability — a low yield or a failure at any stage propagates downstream and caps the whole route’s output, exactly the bottleneck-and-cascade dynamic that makes chemists favor convergent routes (assemble fragments in parallel, join them late) for long chains. The same reasoning argues against very long linear prompt chains: each added sequential stage multiplies the cumulative failure probability, so past some depth, decomposing into parallel sub-chains joined at the end is the more robust shape.