返回课程总览 · 上一章 · 下一章

IndyDevDan · 51:36 · 发布 2026-02-23 · 22.8万次观看(截至抓取) · 观看原视频 🔥 观众最高回放 29:56 — PI v9 Agent Team 编排演示

主旨

写一个 ext,做一个 YAML agent team 配置:scout / plan / build / review / document / red team,主 agent 自动 dispatch 子 agent 干实事,/agent-team 命令切换团队——演示 “specialization is the advantage” 这一主张在 Pi 内如何落地

核心论点

  1. Agent Team = YAML 配置 + primary agent 当 dispatcher:主 agent 收到 prompt 后自己不动手,派 subagent 做,主 agent 负责调度 + 汇总。(→ 详解1)
  2. 特殊化的 subagent 各司其职:scout = 找信息;plan = 规划;build = 改代码;review = 审查;document = 写文档;red team = 攻击性测试。特殊化的 agent 比随机泛 agent 出活(→ 详解2)
  3. /agent-team <team名> 切换:不同任务切不同 team:plan/build/review、scout/planner/builder/reviewer/documenter/red team 等。YAML 即团队定义。(→ 详解3)
  4. v9 是 v7 (subagent widget) 的工程升级版——v7 单 subagent 自由调度,v9 多 agent 团队化 + primary agent 编排 layer。(→ 详解4)

知识点详解

1. Primary agent 改当 dispatcher 30:10

Instead of my primary agent doing anything, it has a team of agents that helps them do the work. So, this is another version of multi-agent orchestration. If we scroll up here, you can see our primary agent didn’t do any work. It doesn’t need to. It has agents to do that work on their behalf. (30:10)

主 agent 的行为模式从”亲自动手”变成”调度”:prompt 来,它分给 team 中的子 agent,然后等结果集齐再回来与人类交互。这是”集中调度型多 agent”在 Pi 内的可执行实例——与 Agent Teams 在 Claude Code 实验性功能中给出的”centralized message bus + 共享 task list”是同等粒度。

2. 特殊化的 subagent 各司其职 30:10

Instead of having a whole set of random agents that you can run, instead of running ad hoc agents, you really want to be specializing. (32:08)

When you give it your prompt and when you build your own custom agent decoding tool on top of it that’s where you really get differentiated results. (32:26)

作者明确写出主旨:specialization is the advantage——同一个 prompt 给一个泛 agent 跑 vs 派给 scout + planner + builder 三个专精 agent,质量差距是数量级。这一主张与 Subagent 在 Claude Code 高阶课里定义的”短上下文子代理”一致,但本片特别强调:专精化泛化出活。

3. /agent-team 切换 + YAML 配置 30:10

If we type /agent team you can see here we can select a team. This is a default team that just loaded. If we hit agent teams, you can see here I have different teams of agents. I’ll click on the plan build team. (32:38)

And now you can see I have a planner, I have a builder, and I have a reviewer. And this all comes from a teams file where you can see I just have a simple YAML configuration for all the teams. (32:50)

团队的”成员 + 命令行”组合在 YAML 文件里维护,/agent-team <name> 加载。plan-build-review.yaml 三人组;scout-planner-builder-reviewer-documenter-redteam.yaml 六人组。YAML = 团队即代码。

4. v9 是 v7 的编排升级 30:10

Remember, let me make this super clear, right? PI does not have sub agent support. So, how am I getting multi-agent orchestration? I’m building it myself, right? I customize it. This is all coming from this one extension here. (30:10)

OK, you can see there, I’m just cycling through all the themes. My agents are getting customized. Just love the customization here, right? Let’s go and look at the system select. (32:15)

作者一句话点破:Pi 没有原生 subagent / multi-agent / agent team——你看到的 v9 agent team 全是 ext 写的。同一 ext v7 (单 sub widget) + v9 (team dispatcher) + v12 (chain) + v13 (meta) 共用一组钩子,只是分工不同。

可执行步骤

  • 写一个 teams.yaml,列出两个 team:plan-build-review.yaml / scout-planner-builder-reviewer.yaml
  • 写 ext 读 YAML → 在 Pi 启动时为每个 team 准备 3-6 个 subagent 槽
  • 启动 demo: 让主 agent 跑 “find and fix all TS files” 任务,看主 agent 调 subagent 而自己不动手
  • /agent-team scout-planner-builder 切到三人团队,跑 “改 tree.md 的标题字号” 任务,看输出格式不同

关联

  • 进阶:本片 14-v12-Agent-Chain.md — 用 pipeline 方式串起 subagent
  • 进阶:本片 15-v13-Meta-PI.md — 在 v9 之上套一层 meta 调度 8 个领域专家
  • 印证(中央调度式多 agent):Agent Teams — Claude Code 实验性功能也是同样的”centralized message bus”
  • 互补(特殊化的实际表现):Subagent — “短上下文子代理”在本片是”特殊化的子代理”

一手来源与延伸

  • Pi extension 文档:https://pi.dev/ — multi-agent orchestration pattern
  • 视频 30:10-33:55(v9 agent team 演示)

术语

  • Agent team:YAML 配置的多 agent 团队,plan / build / review / scout / documenter / red team 等角色
  • Dispatcher:primary agent 改当调度,不亲自动手,只把任务派给 team members
  • YAML 团队配置:团队即代码,不同任务切不同 team 是 v9 的关键设计

金句

Specialization is the advantage. (32:15) — 本片主旨一句。

When you give it your prompt and when you build your own custom agent decoding tool on top of it that’s where you really get differentiated results. (32:26) — 特殊化 + 自建 harness 才是差异化所在。

立场与利益

  • 利益中性:agent team 抽象是工程模式,无直接挂商品
  • 与利益反向(单独标):作者主动说 Pi 没有原生 multi-agent,你必须自己造 —— 损商业形象

价值定位

本片目标学习者的价值:

  • 适合谁:需要把”工程多 agent 协作”做成可重复 playbook 的工程师
  • 解决什么:team 在 YAML 配置 + dispatcher 在 primary agent + subagent 在 widget 显示,这是把多 agent 协作做成可复用三件套
  • 认知 vs 实操:实操偏重——YAML + ext + 实际跑
  • 跨源重叠:与 Claude Code 的 Agent Teams 是同思路,但 Pi 的实现更接近”你自己组装”

自检问题

  1. v9 的 primary agent 与 v7 之前的 primary agent 行为差异是什么? 答案:v9 中 primary agent 不动手,只 dispatch 子 agent 去做;之前的版本 primary agent 都是自己跑工具。回跳 30:10
  2. “specialization is the advantage” 的具体含义? 答案:同一个 prompt 给一个泛 agent 跑 vs 给 scout/planner/builder/reviewer 等专精 agent,出活质量数量级差距——专精化比泛化有质量优势。回跳 30:10
  3. /agent-team 命令是切换什么? 答案:切换 team 配置。YAML 里可以为不同任务定义不同的 subagent 集合(plan-build-review 三人组 vs scout-planner-builder-reviewer-documenter-redteam 六人组)。回跳 30:10