---
title: 'PI v12 Agent Chain PI'
video_id: f8cfH5XX-XU
url: https://youtu.be/f8cfH5XX-XU
title_en: "The Pi Coding Agent: The ONLY REAL Claude Code COMPETITOR"
channel: IndyDevDan
published: 2026-02-23
duration: "51:36"
topics: [多 Agent 协作]
noted: 2026-07-07
value: S
part: 14
views: '22.8万'
---


↑ [返回课程总览](00-总览.md) · [上一章](13-v11-Damage-Control.md) · [下一章](15-v13-Meta-PI.md)

> IndyDevDan · 51:36 · 发布 2026-02-23 · 22.8万次观看(截至抓取) · [观看原视频](https://youtu.be/f8cfH5XX-XU)
> 🔥 观众最高回放 [29:56](https://youtu.be/f8cfH5XX-XU?t=1796) — 本片高回放时刻见对应章节

## 主旨

把 agent team 的"并发 dispatch"换成"流水线 dispatch"——**3 个 scouter 串成 pipeline,前一 agent 的输出直接喂下一个**;同样 plan→build→review 也串行——**演示"agent chain / pipeline"是 agent team 的另一面,YAML 配置与 primary agent 调度的工程模式相同,差别只在执行模型**。

## 核心论点

1. **Agent chain = agent pipeline**:前一 agent 的完整输出作为后一 agent 的输入提示,串行跑,与并发 team 是对照。([[#1-agent-chain-的执行模型-3636|→ 详解1]])
2. **三个 scouter 串联看似冗余,实质是"分布式不同角度理解同一任务"**——每一 scouter 用稍不同的 system prompt / model 跑出独立视角,后一跑前一输出的子集,最终产物是多视角合流。([[#2-多视角合流-3636|→ 详解2]])
3. **plan → build → review 是另一典型 chain**——planner 写计划,builder 写代码,reviewer 检查,各司其职;**对照 v9 agent team**:team 是并发 dispatch,chain 是串行接力。([[#3-plan--build--review-三人链-3636|→ 详解3]])
4. **infinite pipelines**:作者说"quite literally infinite agentic workflows, infinite pipelines, infinite chains of agents that you can build"——chain 抽象不限于 2-3 步,可以任意长度 + 任意拓扑 (fork / merge / loop)。([[#4-与-agent-team-的对照与向-adw-接近-3636|→ 详解4]])

## 知识点详解

### 1. agent chain 的执行模型 [36:36](https://youtu.be/f8cfH5XX-XU?t=2196)

> Let me show you what this thing can do. [...] And instead of an agent team, check this out. So, I'm going to type chain and let's run a scout workflow. This is a triple scout recon workflow. So, I have three scout agents chained together. ([36:36](https://youtu.be/f8cfH5XX-XU?t=2196))

> This is an agent chain, also known as an agent pipeline. ([36:36](https://youtu.be/f8cfH5XX-XU?t=2196))

`/chain` 命令触发,**三个 scouter 各自跑一遍同一个 recon 任务,前一个的输出文本作为后一个 prompt 的一部分**(不是全部 prompt——chain 抽象是显式的)。

### 2. 多视角合流 [36:36](https://youtu.be/f8cfH5XX-XU?t=2196)

> So this might seem really simple and kind of like redundant, but you know, you can put together any agent you want to. And you know, we talk about this on the channel a lot. To scale your impact, you scale your compute. ([36:36](https://youtu.be/f8cfH5XX-XU?t=2196))

三个 scouter 看似冗余,实际是**用不同的 system prompt / 不同 model 跑同一份 prompt,产出多视角结果**——后一 scouter 看前一 scouter 的输出可以修正 / 补充 / 接纳。最终产物是多视角合流,质量高于任一单独 agent。

### 3. plan → build → review 三人链 [36:36](https://youtu.be/f8cfH5XX-XU?t=2196)

> Imagine you create a plan. And and you know, we don't need to talk about this. We can actually just do it. Okay. So, I'm going to copy this again. Fire up a new version of this. So, we'll select a plan, build, review team. And so, you can see we have three unique agents chained together. ([36:36](https://youtu.be/f8cfH5XX-XU?t=2196))

> user team plan out a new minimal yet unique PI agent. Right away, our primary agent is going to do a little research to understand what's going on here. Then it's going to kick off its agent team. And so this is very powerful. We have the orchestrator working on the top level and then it's going to dial its work into its team. You can imagine what's happening here, right? The planner is going to execute, create a plan for the work. The builder is going to build it and the reviewer is going to review what was built and make sure that it's right. ([36:36](https://youtu.be/f8cfH5XX-XU?t=2196))

**plan → build → review 三人链**是 dev 流程的标准映射:planner 出大纲,builder 据此写代码,reviewer 检查代码是否对齐大纲。Orchestrator 只做准备工作,把任务按链上的位置串起来。

> You know, once again, this is just one of, you know, quite literally infinite agentic workflows, right? Infinite pipelines, infinite chains of agents that you can build. Okay. ([37:40](https://youtu.be/f8cfH5XX-XU?t=2260))

**作者明确**:chain / pipeline 是任意拓扑 + 任意长度的可重用抽象。

### 4. 与 agent team 的对照与向 ADW 接近 [36:36](https://youtu.be/f8cfH5XX-XU?t=2196)

> And if you're a tactical agent to coding member, this probably looks or starting to smell familiar to you. We are a few steps away from having this being an ADW, an AI developer workflow. I'll leave that concept inside the course. ([36:36](https://youtu.be/f8cfH5XX-XU?t=2196))

作者点名这是 ADW(AI Developer Workflow)的前身,**已在课程(tactical-agentic-coding)里讲授**。ADW vs chain 的差别在于:chain 是"agent 之间串",ADW 是"代码为主、agent 嵌入 CI / 多步检查 / 工程化复盘"的更完整开发流程。

## 可执行步骤

- [ ] 写 ext 注册 `/chain <length>` 命令 + 在 YAML 里配 N 个 agent 节点
- [ ] 定义 chain 的"节点"模型:每个节点有 system prompt + model + 输出注入方式
- [ ] 跑 `chain: [scout, scout2, scout3]` 任务,验证三 scouter 串行输出合一报告
- [ ] 跑 `chain: [planner, builder, reviewer]` 任务"为某文件加错误处理",验证 planner 写大纲 / builder 写代码 / reviewer 检查
- [ ] (后续)v13 meta-agent:你 build Pi demo 时,让一个 meta-agent 自动生成这些 chain 配置

## 关联

- 进阶:本片 [15-v13-Meta-PI.md](15-v13-Meta-PI.md) — meta-agent 调多个 chain 组成更大的工作流
- 互补:本片 [11-v9-Agent-Team.md](11-v9-Agent-Team.md) — team 是并发 dispatch,chain 是串行接力;同一抽象的两种执行模型
- 印证(中央调度 -> 串联 vs 并发 vs 分层):[[Agent Teams]] / Subagent —— chain 与 team 是同一主题的两个执行分支
- 进阶(ADW 是其延伸):Auto-Research — ADW 把 agent chain 嵌入 CI 流程

## 一手来源与延伸

- Pi extension 文档:[https://pi.dev/](https://pi.dev/)
- 视频 36:36-43:16(v12 Agent Chain 演示)

## 术语

- **Chain / pipeline**:前一 agent 的输出直接喂给后一 agent,串行执行
- **Triple scout**:三个 scouter 各自从不同角度查同一任务,后一吃前一输出
- **ADW**:AI Developer Workflow,chain 之上加 CI / 多步检查的工程化流程

## 金句

> This is an agent chain, also known as an agent pipeline. ([36:36](https://youtu.be/f8cfH5XX-XU?t=2196)) — 命名一句话定调。

> This is just one of, you know, quite literally infinite agentic workflows, right? Infinite pipelines, infinite chains of agents that you can build. ([37:40](https://youtu.be/f8cfH5XX-XU?t=2260)) — chain 抽象的扩展性陈述。

## 立场与利益

- 与利益同向:作者提示 ADW 在他课程里讲,但主片不提 = 引导观众去付费课
- 利益中性:chain 模式是工程抽象

## 价值定位

对**本片目标学习者**的价值:

- 适合谁:需要在多步 pipeline 里分配子任务的工程师
- 解决什么:**chain / pipeline 模式覆盖 plan→build→review 这一典型 dev 流程**;同时也覆盖 scout 这种"多视角合流"
- 认知 vs 实操:实操偏重——需要写 chain 抽象 + 节点定义
- 与本片其他章节重叠:与 v9 agent team 是同抽象的两面,与 v13 meta 是"agent 调度 agent"

## 自检问题

1. agent chain 与 agent team 的执行模型区别?
   **答案**:chain 串行,前一 agent 的输出喂后一 agent;team 并发,primary agent 派给多个 subagent 同时跑、各自独立。回跳 [36:36](https://youtu.be/f8cfH5XX-XU?t=2196)
2. plan → build → review 三人链式典型的开发流程映射是什么?
   **答案**:planner 出大纲,builder 据此写代码,reviewer 检查代码对齐大纲,每个节点系统提示专注一件事。回跳 [36:36](https://youtu.be/f8cfH5XX-XU?t=2196)
3. 三个 scouter 串联看似冗余,但实际用途是什么?
   **答案**:多视角合流——三个 scouter 用不同 system prompt / model 跑同一任务,后一吃前一输出,产出高于任一单独 agent 的质量。回跳 [36:36](https://youtu.be/f8cfH5XX-XU?t=2196)