核心结论:Agent 架构选型的唯一原则是 workflow 优先,agent 兜底——95% 的场景先别想「要不要多 Agent」,先问「这个流程能不能固定下来」。能固定就用 workflow(fixed shape),不能固定且需要中间决策才用 agent(runtime shape)。多 Agent 不是进阶,是昂贵的兜底:Anthropic 实测 orchestrator-worker 比单 Agent 好约 90%,但烧掉约 15 倍 token;而在同等算力预算下,多 Agent 只换来约 4% 的提升、付出 4 倍成本。
目录
- 一句话说透:workflow 优先,agent 兜底
- 先分清两个根本概念:固定形状 vs 运行时形状
- 单 Agent 什么时候够用:3 条判据
- 多 Agent 什么时候真值:只有两种场景
- 编排模式图谱:ReAct / Planner-Executor / Orchestrator-Worker
- 成本与可靠性的账:为什么多 Agent 是烧钱的
- 框架怎么选:LangGraph / CrewAI / AutoGen / Swarm
- 可运行的选型决策代码:一个 Python 函数
- 选型对照表:症状 → 原因 → 解法
- 结论:该用 / 不该用的判据
1. 一句话说透:workflow 优先,agent 兜底
很多人一上来就问「单 Agent 还是多 Agent」,问反了。真正该先问的是:这个任务能不能用 workflow 解决?
Anthropic 在《Building Effective Agents》里给出的建议非常明确:始终优先实现 workflow,只有在真正需要时才 resort 到 agent。理由是 workflow 能给生产应用提供大多数场景所需要的 reliability(可靠性)和 predictability(可预测性),而 agent 则是为「需求无法预判」的场景提供 flexibility(灵活性)。
打个比方 🎭:workflow 像流水线,工位顺序提前定死,每次跑都稳定;agent 像自由职业者,你只给目标和工具箱,他现场决定先干哪步。流水线不需要聪明,只需要稳定;自由职业者聪明,但每次都可能给你 surprise。
判断口诀:流程清晰且可重复 → workflow;流程随输入变化、需要中间决策 → 考虑 agent;刚开始 → 先 workflow,量出结果弱了再换 agent。
2. 先分清两个根本概念:固定形状 vs 运行时形状
选型前必须先建立这对概念,否则后面全是糊涂账。
Workflow(固定形状):你在设计阶段就定义好步骤、顺序、分支和 fallback。系统每次运行都走同一套结构。模型(如果有)只是在流水线的特定槽位填文本,它不决定流水线长什么样。
Agent(运行时形状):你给它一个 goal 和一批 tools,模型自己决定执行哪些步骤、按什么顺序、要不要调用工具、是否继续。没有一条预先写死的路径。
为什么这个区分是选型的基石?因为决策的难度不同。workflow 的复杂度在你脑子里一次性想清楚,agent 的复杂度被推迟到每次运行都重新想一遍——后者意味着更高的 token 成本、更不可控的输出,以及更难排查的失败。
引用 Anthropic 的定义:agent 是「LLM 动态地指挥自己的流程和工具使用的系统」;workflow 是「预定义的代码路径」。二者是从 workflow 到 agent 的连续光谱,不是非黑即白。
3. 单 Agent 什么时候够用:3 条判据
单 Agent(一个 LLM 带若干工具,自主完成多步)是大多数场景的默认选择。判断它够不够用,看这 3 条:
- 步骤数可预估 —— 任务大致在 3~5 步内能闭环。例如「查天气 → 推荐穿搭」,ReAct(Rea soning + Action,推理与行动交替)这种单 Agent 模式天然适合。
- 工具少而相关 —— 只有 3~5 个工具,模型不会在选择上犯迷糊。工具一多,单 Agent 的命中率就断崖式下降。
- 无需并行 —— 每一步都依赖前一步结果,串行推进即可,没有可以拆开同时跑的子块。
满足这 3 条,单 Agent 是最优解:成本低、可控、好调试。你只需要给模型一个明确的 tool 清单和一份好的 system prompt。
反例启发:如果任务需要 8 个以上工具、步骤超过 10 步、且中间步骤会纠错,单 Agent 会变得又慢又贵又不稳——这时候才轮到多 Agent 出场。
4. 多 Agent 什么时候真值:只有两种场景
多 Agent 不是「更高级」,是为了特定收益付出高昂代价。真正值得上多 Agent 的场景只有两类:
场景一:真并行(True Parallelism)。任务能拆成互不依赖的独立子块,并行跑比串行拼起来更快。比如「同时调研 10 个公司」「同时分析 20 份文档」。研究证实,在可并行任务上多 Agent 有明显提升,而在顺序推理任务上普遍退化——因为多 Agent 的交接会丢失上下文。
场景二:生成 + 校验的双角色(Generator-Critic)。一个 Agent 负责写,另一个 Agent 以全新视角审。这种「写—审」结构提升最大、代价相对最小。因为 LLM 自我纠错能力弱,换个视角的批评者能抓到很多它自己看不见的问题。
在这两类之外,多 Agent 基本是负收益。尤其要警惕顺序链路:每加一个 agent,成功率就按乘法累积。假设单步可靠率 95%,链 5 步成功率降到 77.4%,链 10 步掉到 59.9%;如果单步可靠率只有 90%(复杂模糊任务很常见),10 步只剩 34.9%。这就是那句「单 Agent 能干的活,别上多 Agent」的数学依据。
5. 编排模式图谱:ReAct / Planner-Executor / Orchestrator-Worker
如果你确认需要 agent,接下来要选编排模式(orchestration pattern)。三张主流牌打出来对比:
ReAct(推理-行动交替):单模型内循环——模型每轮「想一下 → 调工具 → 看结果 → 再想」。适合简单问答、研究助手、3~5 个工具的单目的 agent。不适合复杂多步、需要规划、需要中途恢复的错误场景。
Planner-Executor(规划-执行分离):一个 planner LLM 提前制定完整计划,executor(更小的模型或确定性 runner)按依赖顺序执行,可选 replanning。优点:多步 workflow 更快更便宜(大模型不用每步都被问一遍);缺点:计划在第 0 步就冻结,真实任务常在中途暴露新信息,需要改计划。适合结构清晰、可预测的文档解析管线、数据转换任务;挣扎于开放式的、路径依赖发现的研究任务。
Orchestrator-Worker(编排者-工人):一个 orchestrator 负责把任务拆解、分发给多个 worker,再聚合结果。适合广度优先、可并行的工作。Anthropic 的研究助手就是这种结构,在内部评测中比单 Agent 好约 90%,但烧了约 15 倍 token。
怎么选:需要并行 → Orchestrator-Worker;需要场景规划且任务可预测 → Planner-Executor;任务简单自主 → ReAct。三者不是替代,是分层递进的复杂度。
6. 成本与可靠性的账:为什么多 Agent 是烧钱的
多 Agent 的「贵」不是玄学,是可以算的账。
- token 消耗:多 Agent 运行成本大约是单 Agent 的 2~10 倍。来源包括 supervisor 开销、每个子 Agent 各自加载 system prompt、交接时的 context 序列化重排。轻量的并行 fan-out 在低端,层级式辩论在高端。
- Anthropic 的对照:同等算力预算下,多 Agent 设计只换来约 4% 的提升,却付出 4 倍成本。而 orchestrator-worker 虽然评测好 90%,但 15 倍 token 的代价让它在很多场景不划算。
- 成功率衰减:多 Agent 顺序链路中,每个交接点都可能丢上下文、出错。第 4 节提过的乘法累积效应,就是 reliability 的最大杀手。
结论先行:多 Agent 的性价比是「用钱买并行度或买新视角」。如果任务不并行、也不需要生成-校验双角色,那多 Agent 就是纯亏损。
7. 框架怎么选:LangGraph / CrewAI / AutoGen / Swarm
定下架构后,选框架只是工具。四家主流横向权衡(参考 2026 年对比):
判断逻辑:需要严格执行控制 → LangGraph;想要快速搭建 + 自然直觉 → CrewAI;要实时低延迟 → Swarm(但它是实验性的);遇 AutoGen → 新项目别用了,维护模式已标注。
8. 可运行的选型决策代码:一个 Python 函数
下面是可直接复制跑的选型决策函数。它把你脑中的判断规范化成 4 个问题,输出建议架构。运行不需要任何外部依赖:
def recommend_agent_architecture(
steps_estimable: bool, # 步骤数能否预估
tool_count: int, # 需要多少个工具
needs_parallel: bool, # 任务能否拆成互不依赖的并行子块
needs_critic: bool, # 是否需要「生成 + 校验」双角色
flow_fixed: bool, # 流程能否在设计期固定下来
) -> str:
"""根据任务特征推荐 Agent 架构.
参数:
steps_estimable: 任务步骤是否能提前预判
tool_count: 单 Agent 需要的工具数量
needs_parallel: 是否可并行
needs_critic: 是否需要生成/校验双角色
flow_fixed: 流程能否在设计期固定(固定形状)
返回:
推荐架构: workflow / single_agent / orchestrator_worker / generator_critic
"""
# 1) 流程能固定,优先 workflow——Anthropic 的「workflow 优先」原则
if flow_fixed:
return "workflow(固定形状):最稳最省,先量出结果"
# 2) 步骤可预估 + 工具少,单 Agent 的 ReAct 即可
if steps_estimable and tool_count <= 5:
return "single_agent(ReAct):单模型循环,成本低好调试"
# 3) 需要并行,用 Orchestrator-Worker 换速度
if needs_parallel:
return "orchestrator_worker(编排者-工人):真并行才值,注意 token 成本"
# 4) 需要生成+校验,用双角色
if needs_critic:
return "generator_critic(生成-校验双角色):代价小提升大"
# 5) 都不满足,退回保守的单 Agent 多工具编排
return "single_agent(多工具)+ LangGraph:工具多了需要显式 graph 控制"
if __name__ == "__main__":
print(recommend_agent_architecture(
steps_estimable=False, # 财报内容不可预判
tool_count=6, # 需要读取、解析、对比等多类工具
needs_parallel=True, # 20 份可并行处理
needs_critic=False,
flow_fixed=False,
))
# 输出: orchestrator_worker(编排者-工人):真并行才值,注意 token 成本
这段代码把前面 1~7 章的判断浓缩成一条可执行的决策路径,复制即跑。
9. 选型对照表:症状 → 原因 → 解法
10. 结论:该用 / 不该用的判据
什么时候该用:流程能固定成 workflow 就别碰 agent;必须自治但工具少、步骤可预估时用单 Agent ReAct;任务能真并行、或需要生成-校验双角色时,才值得上多 Agent。
什么时候不该用:不能并行、也不需要新视角时,多 Agent 就是纯烧钱(210 倍 token 只换来 ±4% 提升);顺序链路超过 510 步时要警惕成功率暴跌,优先考虑拆分支或回退单 Agent。
本专栏《AI Agent 工具专栏》从工具调用、内存、Skill 路由一路讲到架构选型与工程防线,每篇都配可运行的代码与一张对照表,聚焦生产落地的真实取舍,每周更新一篇。想在 Agent 工程里少踩坑,可在专栏页订阅。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Core conclusion: The only principle for the Agent structure selection is to workflow first, angent bottom -- 95% of the scenes are not "want more Agent" first, asking "can this process be fixed?" If you can fix it, you can't fix it, you can't fix it, you can use it. Many Agent is not a step forward; it is an expensive pocket: Anthropic actually measured Orchestra-worker is about 90% better than a single Agent, but burned about 15 times as much token; under the same calculator budget, more Agent is only about 4% higher and four times more expensive.
Contents
- Word: workflow first, angent bottom
- Distinguishing two fundamental concepts: fixed shape vs run-time shape
When will it be enough: 3 judgments?
When is it real? There are only two scenarios.
- Formatting patterns: Rect / Planner-Executor / Orchestra-Worker
- Cost and reliability: Why?
- How to choose a frame: LangGraph / Crew AI / AutoGen / Swarm
- Runable optional decision code: a Python function
- Selective control table: symptoms, cause, solution
- Conclusions: Should / Should not be used
1. Word: workflow first, angent bottom
A lot of people come up and ask "Agent" or "Agent"? The real question is, can this mission be solved with workflow?
Anthropic's proposal in "Building Effective Actors" is very clear: always giving priority to workflow, only if really needed. The reason for this is that workforce provides most of the scenarios required for production applications: reliability and predictability, while angent provides flexibility for "demand is unpredictable".
Take the example: workflow is like a water line, the order of the jobs is set early, and every run is stable; angent, like a freelancer, you only give the target and the toolbox, and he decides what to do first. Water lines don't need to be smart, they need to be stable; freelancers are smart, but they can always give you Surprise.
Adjudication: processes are clear and repeatable; processes change with input and require intermediate decision-making, consider an anent; start with a workfell, measure the results weak and change angent.
2. Distinguishing two fundamental concepts: fixed shapes vs run-time shapes
These concepts must be established before the selection of models, or they are all confused.
Workflow (fixed shape): You define the steps, sequence, branch and fallback at the design stage. The system follows the same structure every time it operates. The model (if any) is only a filling text for a particular slot of the current line, and it does not determine what the current line looks like.
Agent (Run-time Shape): You give it a goal and a bunch of things, and the model decides which steps to take, which sequence to follow, whether to call the tools, whether to continue. There is no pre-written path to death.
Why is this distinction the cornerstone of the selection? Because decision-making is difficult. The complexity of workflow is clearly in your head, and the complexity of angent is postponed until every operation is rethought -- the latter means higher token costs, more uncontrollable output, and more difficult failure.
Reference to the definition of Anthropic: angent is "the system that LLM dynamically directs the use of its processes and tools" and workflow is "predefined code path". The two are continuous spectra from workflow to agent, not non-black or white.
3. Single Age: 3 judgements
Single Agent (a LLM with several tools, autonomously multiple steps) is the default option for most scenarios. Let's see if it's enough.
- The number of steps can be estimated - the task can be closed in roughly 3-5 steps. For example, the single Agent model of "Chattering Weather + Action" is natural.
- Few tools are relevant - only three or five tools are available, and models are not lost in choice. With more tools, Agent's hit rate is falling.
- There is no parallel - each step depends on the results of the previous step, and the symmetrical advance is sufficient, and there are no sub-blocks that can run simultaneously.
Satisfied with these three, single Agent is the best solution: low-cost, manageable, easy to debug. All you have to do is give the model a clear tool list and a good system program.
In retrospect: If the mission requires more than eight tools, steps more than 10 steps, and the middle steps can be corrected, the single Agent will become slow, expensive and unstable — this is when it comes to more Agent.
4. Agent, when is it real? There are only two scenarios.
Many Agent is not "higher" and is paying a high price for a particular gain. There are only two kinds of scenes that really deserve to be raised:
Scenes one: True parallel. Missions can be broken down into separate, non-dependent sub-sections, running in parallel faster than syllables. For example, "Study 10 companies at the same time" "System 20 documents at the same time." Research has confirmed that there has been a marked increase in the number of concurrent tasks, and that there has been a general deterioration in the sequenced reasoning tasks - as context is lost in the many Agent interfaces.
Scenario 2: Generate + Verify Double Role (Generator-Critic). One is in charge of writing, the other one is in a new perspective. This “writing-review” structure is the largest and relatively least costly increase. Because LLM has a weak self-correction ability, critics with a different perspective can capture a lot of problems that it cannot see.
Beyond these two categories, more Agent is basically negative. It is particularly important to be alert to the sequence chain: every additional anent, success rate accumulates by multiplication. Assuming a one-step reliability rate of 95 per cent, the chain of 5 steps success rate fell to 77.4 per cent and the chain of 10 steps fell to 59.9 per cent; if the one-step reliability rate is only 90 per cent (complex and vague tasks are common), only 34.9 per cent of the 10 steps are. That's the mathematical basis for the "one Agent" job, not more Agent."
5. Pattern mapping: Rect / Planner-Executor / Orchestra-Worker
If you confirm the need for anent, then choose the layout. Three mainstream cards compared:
React: Single-action cycle -- model "Think about → → → → 。 。 。 。 。 。 。. It's for simple questions and answers, research assistants, and a single purpose for 3-5 tools. It is not suitable for a complex, multi-step, planning, mid-term recovery scenario.
Planner-Executor (Planning-execution Separation): A Planner LLM prepares a complete plan in advance, executor (smaller model or certainty runner) executes it in the order of dependency, with options for reprogramming. Advantages: Multistep workwork faster and cheaper (LLM does not have to be asked every step); Shortcomings: The plan freezes at step 0, and real task often exposes new information in the middle and needs to change it. Fits to a well-structured and predictable document resolution line, data conversion task; struggles with open, path-dependent research tasks.
Orchestra-Worker: One orchestratr is responsible for disassembling the mission, distributing it to a number of workers, and collating the results. Work that is appropriate to the breadth of priority and can be carried out in parallel. Anthropic's research assistant is this structure, which is about 90 per cent better than Agent, but burned about 15 times token.
How to choose: Need to parallel Orchestra-Worker; Need to plan scenes with predictable tasks Planner-Executor; Simple tasks for autonomy The three are not substitutes, but layers of complexity.
6. Cost and reliability: Why is Agent burning money?
A lot of Agent's "expensive" is not an encyclopedia.
- Token consumption: More Agent running costs approximately 2-10 times more than single Agent. Sources include supervisor expenses, each of the sub-units Agent loads system prompt, and sequenced resets of constext at hand. Light parallel fan-out at the lower end, hierarchical debate at the higher end.
- Anthropic: Under the same calculator budget, more Agent designs are only about 4% higher, at four times the cost. And orchestrator-worker, while rating 90 percent, 15 times token's cost makes it uneconomical in many scenarios.
- success rate decay: context could be dropped at each point of the multiple Agent sequence link. The cumulative multiplier effect mentioned in section 4 is the largest killer of relibrity.
The conclusion goes first: many Agent's value for money is "to buy parallels or new perspectives". If the task is not parallel and does not need to produce a double-checking role, then much Agent is pure loss.
7. How to select a framework: LangGraph / Crew AI / AutoGen / Swarm
Once the architecture is in place, the selection framework is a tool. Four mainstream horizontal trade-offs (reference 2026 comparison):
Logic of judgement: Controls need to be strictly enforced → LangGraph; want to build quickly + natural intuition → Crew AI; have real time delay → Swarm (but it is experimental); in the case of AutoGen → new projects, maintenance models are indicated.
Runable optional decision code: a Python function
Below are the selected decision functions that can be copied directly. It turns the judgment in your head into four questions, an output structure. Run without any external dependence:
def recommend_agent_architecture(
Steps estimable: bool, # prognosis of steps
How many tools do you need?
# Can the mission break into separate parallel pieces
# Do you need to "generate + verify" double roles
Flow fixed: bool, # Is the process fixed during the design period
) -> str:
""Recommends the Agent structure according to mission characteristics.
Parameters:
steps testimable: Whether mission steps are pre-judged
tool count: number of tools required by singleAgent
Needs parallel: Is it possible to parallel
Need to create/validate double roles
Flow fixed: Is the process fixed during the design period (fixed shape)
Return:
Recommended architecture: workflow / single agent /orcher worker /generator critic
"""
#1) Process fixes, prioritizes workflow-Anthropic 'workflow first' principle
if flow_fixed:
Turn "workflow" (fixed shape): most steady, first measure the results."
#2) Steps can be estimated + fewer tools, only Agent's React
if steps_estimable and tool_count <= 5:
Return "single agent": single model cycle, low cost debugging.
#3) Need to be parallel, switch speed with Orchestra-Worker
if needs_parallel:
Return "orchestrator worker"
#4) needs to generate + validate, use two roles
if needs_critic:
Return "generator critic" (generation-validation of double roles): small price increases
# 5) Unsatisfactory, return conservative list Agent multitools Line
Return "single agent" + LangGraph: Many tools require visible graph control
if __name__ == "__main__":
print(recommend_agent_architecture(
Steps estimable=False, # The content of the financial statements is unpredictable
Tool count=6, # Multiple tools need to read, parse, compare, etc.
# 20 copies can be processed in parallel
needs_critic=False,
flow_fixed=False,
))
# Output: Orchestra worker: Real parallel talent, note token cost
This code concentrates the judgement of the first chapters 1-7 into an enforceable decision path, copying and running.
9. Selective control table: symptoms causes
10. Conclusion: Shouldn ' t Use / Shouldn 't Use
When it's time: the process is fixed into workwork, don't touch anent; it must be autonomous, but with few tools and predictable steps, use an Agent React; it's worth more when the task is really parallel, or it needs to produce a double-check role.
When should it not be used: when there is no parallel or need for a new perspective, more Agent is pure burning of money (210 times token only > 4% up); when the sequence chain exceeds 510 steps, guard against success rate collapse, giving priority to split or rollback single Agent.
This column, " AI Agent Tools Box ", from tool call, memory, Skyll route, addresses structure selection and project defenses, each with a runable code and a checklist, focuses on the real trade-off in the production site and updates it once a week. You can subscribe to the column page if you want to reduce the pits in the Agent project.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.