Seven Mental · 心智七篇
← Knowledge Atlas · Concept

Prompt Chaining(提示链)

提示链:任务分解为顺序步骤,用延迟换准确率
CONCEPT · PROMPT CHAINING · LINEAR WORKFLOW · AGENTIC SYSTEMS

Prompt Chaining

Prompt Chaining — decompose a task into sequential steps, each LLM call handling the previous step’s output

The simplest workflow pattern in agentic systems. Use it when a task decomposes cleanly into fixed, ordered sub-tasks. The essence is trading latency for accuracy — each LLM call faces a simpler, more focused sub-task. Programmatic gate checks can be inserted between steps.

Typical use cases
Generate marketing copy (English)
Translate to target language
Write document outline
Gate check
Draft document from outline
Placement in agentic workflows
When to use
Sub-tasks are fixed and ordered; no dynamic branching needed
vs Routing
Routing picks a path based on input; prompt chaining follows a fixed path
vs Orchestrator-Workers
Chaining is linear serial; orchestrator-workers dynamically decomposes in parallel
Why gates
Programmatic mid-checks stop errors from propagating — failing early is cheaper than failing late
→ Agentic Systems · Routing · Orchestrator-WorkersAnthropic (2024)

Prompt Chaining(提示链)

定义

将任务分解为一系列顺序步骤,每个 LLM 调用处理上一个的输出。可以在中间步骤加入程序化检查(gate)确保流程不偏离轨道。

适用场景

任务能干净地分解为固定子任务时。本质是用延迟换准确率——让每次 LLM 调用面对更简单的任务。

典型用例

  • 生成营销文案 → 翻译为目标语言
  • 写文档大纲 → 检查大纲是否满足标准 → 基于大纲写文档

在 agentic 系统中的位置

属于 agentic systems 中最简单的 workflow 模式。比 routing 更线性,比 orchestrator-workers 更确定。

References

  • sources/anthropic_official/building-effective-agents.md