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

Building Effective AI Agents

Anthropic 官方 agent 构建指南,workflows vs agents 分类,五种 workflow 模式,ACI 设计原则
SOURCE · BUILDING EFFECTIVE AGENTS · Schluntz & Zhang · Anthropic 2024

Building Effective AI Agents

Schluntz & Zhang (Anthropic, 2024-12-20) — lessons distilled from dozens of customer agent builds

Core claim: the most successful implementations don’t lean on heavy frameworks — they use simple, composable patterns. The base building block is the “augmented LLM”: retrieval + tools + memory, with standardized interfaces via protocols like MCP. A single LLM call + retrieval + in-context examples is usually enough — only add complexity when there’s evidence it improves outcomes.

Five workflows + one agent pattern
Prompt ChainingTask decomposed into sequential steps; gates optional between them
RoutingClassify input, then dispatch to specialized handlers — semantic routing
ParallelizationSectioning (split work) + voting (ensemble of answers)
Orchestrator-WorkersCentral LLM dynamically decomposes the task, dispatches to workers, synthesizes results
Evaluator-OptimizerGenerate-evaluate iteration — feedback-driven refinement
Agent (autonomous)LLM dynamically directs its own flow — open-ended problems with unpredictable step counts
ACI design principle
ACI matters as much as HCI
Write tool definitions with the clarity you’d use in docs for a junior developer — the agent is the primary user of the tool
→ Prompt Chaining · Orchestrator-Workers · Augmented LLM · ACIAnthropic (2024-12-20)

Building Effective AI Agents

摘要

Anthropic 基于与数十个客户团队合作构建 LLM agent 的经验总结。核心论点:最成功的实现不依赖复杂框架,而是用简单、可组合的模式构建。文章区分了 workflows(预定义代码路径编排 LLM)和 agents(LLM 动态指挥自身流程),并系统梳理了五种 workflow 模式和一种 agent 模式。

关键要点

  1. 从简单开始。只在有证据表明复杂度能改善结果时才增加复杂度。单次 LLM 调用 + 检索 + 上下文示例通常已经够用。
  2. 基础构建块是增强型 LLM(augmented LLM):检索、工具、记忆三项增强能力,通过 MCP 等协议标准化接口。
  3. 五种 workflow 模式
  4. Agent 适用场景:开放式问题、步骤数不可预测、需要自主决策。代价是更高成本和错误累积风险。
  5. ACI(Agent-Computer Interface)设计与 HCI 同等重要。工具定义要像写给初级开发者的文档一样清晰。

与其他 source 的关联

  • 本文是 Anthropic 官方 agent 架构模式总览,后续的 harness 系列文章 深入讨论了长时运行场景下的 harness 设计。
  • Claude Agent SDK 是本文推荐的实现框架。

References

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