What is 'prompt chaining' and when is it a useful architectural pattern?
Select an answer to reveal the explanation.
Short Explanation
Prompt chaining breaks a complex job into sequential Claude calls, feeding each output into the next. You keep each step focused, catch errors between steps, and often get better results than one giant prompt.
Full Explanation
Prompt chaining (also called LLM pipelines or agentic workflows) decomposes complex tasks into sequential Claude API calls where each step's output feeds into the next. Benefits: each step can be focused and optimized independently, errors can be caught between steps, intermediate outputs can be validated or modified, and the overall quality often exceeds a single massive prompt. Example: document analysis pipeline: extract key entities, then classify entities, then generate a summary incorporating entity analysis. Sending the same prompt to multiple models simultaneously and combining responses describes parallel multi-model inference, not chaining. Linking multiple user messages together in a single API call describes multi-turn conversation, not sequential model-call outputs. A technique for compressing prompts by chaining words together without spaces is nonsensical.