Anthropic 的 Advisor Tool 是一个很有意思的 Agent 架构能力:让较快、较低成本的 executor model 负责大部分生成,在关键时刻向更强的 advisor model 咨询战略建议。
它仍处于 beta,需要使用:
anthropic-beta: advisor-tool-2026-03-01Advisor Tool 的核心思路
很多长程 Agent 任务里,并不是每个 token 都需要最强模型来写。常见模式是:
- 大部分步骤是机械执行
- 少数节点需要高质量规划
- 最怕的是方向错、工具选错、遗漏关键约束
Advisor Tool 把这件事产品化:
- executor model:执行任务、生成主要输出
- advisor model:在中途提供战略建议和纠偏
官方描述中,advisor 通常生成 400-700 个文本 token,总计约 1400-1800 tokens(含 thinking),executor 随后继续完成任务。
适合哪些任务?
特别适合长程 Agent 工作负载:
- 编码 Agent
- Computer use
- 多步骤研究流水线
- 复杂代码迁移
- 长时间工具调用任务
- 需要规划但不希望全程用 Opus 的场景
不太适合:
- 单轮问答
- 用户已经手动选择模型的 pass-through 应用
- 每一轮都必须由最强模型直接完成的任务
模型配对规则
Advisor model 必须至少和 executor 一样强。官方示例中:
- Haiku 4.5 可咨询 Opus 4.8 / Opus 4.7
- Sonnet 4.6 可咨询 Opus 4.8 / Opus 4.7
- Opus 4.7 可咨询 Opus 4.8 / Opus 4.7
- Opus 4.8 只能咨询 Opus 4.8
如果配对无效,API 会返回 400 invalid_request_error。
API 快速示例
{
"model": "claude-sonnet-4-6",
"max_tokens": 4096,
"tools": [
{
"type": "advisor_20260301",
"name": "advisor",
"model": "claude-opus-4-8"
}
],
"messages": [
{
"role": "user",
"content": "Build a concurrent worker pool in Go with graceful shutdown."
}
]
}当 executor 认为需要建议时,会触发 server-side advisor 调用。开发者不需要额外发第二个请求。
它如何工作?
官方流程:
- executor 输出
server_tool_use,调用advisor - Anthropic 在服务端运行 advisor model
- advisor 读取完整 transcript,包括 system、tools、历史 turns、tool results
- advisor 结果以
advisor_tool_result返回 executor - executor 继续生成
整个过程发生在一次 /v1/messages 请求中。
对 Agent 成本优化的启发
Advisor Tool 代表了一种新模式:不是简单在“便宜模型”和“贵模型”之间二选一,而是把强模型变成关键节点顾问。
设计 Agent 时可以考虑:
- executor 用 Sonnet 处理常规步骤
- advisor 用 Opus 处理架构规划、风险判断、方向纠偏
- 对关键任务保留最高智能,但不让全部 token 都按最高单价生成
这对长期运行的 coding agent、research agent、workflow automation agent 都很有价值。
来源:Anthropic 官方文档 - Advisor tool | 整理:ClaudeEagle