跳到主内容
精选88Claude 博客(web_list)技巧与观点多源精选 ×2

Anthropic发布电商Agent架构指南:技能优于子智能体

A guide to the anatomy of effective commerce agents

原文
发到 X
推荐理由

Agent工程落地必读,清晰论证了为何单模型+Skills优于多子智能体架构,并给出具体取舍标准和开源代码,直接指导开发实践。

A guide to the anatomy of effective commerce agents

高效电商智能体解剖指南

The architecture, latency & cost techniques, and eval practices for agents that make it easier to buy and sell online.

构建更便捷在线买卖体验的智能体,其架构、延迟与成本优化技术及评估实践。

  • Category
  • Agents
  • Product
  • Claude Platform
  • Date
  • September 2, 2026
  • Reading time
  • 5
  • min
  • Share
  • Copy link
  • https://claude.com/blog/the-anatomy-of-effective-commerce-agents
  • Author(s)
  • Ali Shazal
  • Matthew Koen
  • 分类
  • 智能体
  • 产品
  • Claude 平台
  • 日期
  • 2026年9月2日
  • 阅读时间
  • 5
  • 分钟
  • 分享
  • 复制链接
  • https://claude.com/blog/the-anatomy-of-effective-commerce-agents
  • 作者
  • Ali Shazal
  • Matthew Koen

Over the past year, we've worked with teams across the commerce industry — retailers, marketplaces, travel, entertainment, and telecom providers — to build commerce agents using Claude.

过去一年中,我们与电商行业的各个团队——包括零售商、市场平台、旅游、娱乐和电信提供商——合作,利用 Claude 构建电商智能体。

These agents are in production, and enterprise customers have seen larger carts and more efficient seller operations when using them. They also share a simple architecture: Claude in an agent loop equipped with a set of skills, tools, and a strong eval suite.

这些智能体已投入生产环境,企业客户在使用它们后实现了更大的购物车规模和更高效的卖家运营。它们还共享一种简单的架构:在智能体循环中使用配备了一系列技能、工具和强大评估套件(eval suite)的 Claude。

This post is for the engineers and engineering leaders building these (or other consumer facing) agents. Part 1 covers the architecture, which you decide once. Part 2 covers latency and cost. Part 3 covers production: memory, safety, evals, and scaling the work across an organization.

本文面向正在构建此类(或其他面向消费者)智能体的工程师和技术负责人。第一部分介绍架构,这是你需要一次性确定的部分;第二部分涵盖延迟和成本;第三部分涉及生产环境:记忆机制、安全性、评估以及如何在组织内扩展工作流。

Reference implementation

参考实现

We've also provided a blueprint to help build commerce agents on Claude. It contains the harnesses, patterns, and guardrails an engineering team needs to get a commerce agent running in days, with reference implementations of a shopping agent and a merchant agent for retail, travel, telecom, and ticketing platforms.

我们还提供了一份蓝图,以帮助在 Claude 上构建电商智能体。其中包含工程团队在几天内让电商智能体运行所需的测试框架、模式和护栏,并提供了针对零售、旅游、电信和票务平台的购物智能体和商家智能体的参考实现。

anthropics/commerce-agents →

anthropics/commerce-agents →

In this guide

本指南内容

  • Part 1: The architecture
  • What is a commerce agent?
  • Skills, not subagents
  • System prompt or skill: decide by frequency
  • Engineering agent tooling
  • The UI components are tools
  • Part 2: Making it fast and affordable
  • Minimizing task completion latency
  • Perceived latency
  • Prompt caching
  • Choosing the model and its configuration
  • Part 3: Running it in production
  • Memory that survives the session
  • Safety: enforcement lives in the harness
  • Evals: shipping a non-deterministic system
  • Shipping with a large organization
  • Looking ahead
  • 第一部分:架构
  • 什么是商务智能体?
  • 技能,而非子智能体
  • 系统提示词或技能:根据使用频率决定
  • 工程智能体的工具链
  • UI 组件即工具
  • 第二部分:实现快速且经济实惠
  • 最小化任务完成延迟
  • 感知延迟
  • 提示词缓存
  • 选择模型及其配置
  • 第三部分:在生产环境中运行
  • 跨会话持久化的记忆
  • 安全性:执行机制位于编排层
  • 评估:发布非确定性系统
  • 在大型组织中发布
  • 展望未来

01

01

The architecture

架构

One model in a standard agent loop, with skills for the long tail and tools that call the systems you already run. You decide this once.

在标准智能体循环中使用一个模型,针对长尾场景配备技能,并通过工具调用你已运行的系统。这一决策只需做一次。

What is a commerce agent?

什么是商务智能体?

We define a commerce agent as an agent that simplifies buying and selling across an online catalog.

我们将商务智能体定义为简化在线目录中买卖流程的智能体。

Some agents face consumers: they search, compare, substitute, and assemble the order. That could be a retail cart, a travel itinerary, a mobile plan change, or seats held for a show. Some agents face the business: they answer questions about sales, run promotions and campaigns, and manage inventory and pricing.

某些智能体面向消费者:它们进行搜索、比较、替换并组装订单。这可能是零售购物车、旅行行程单、移动套餐变更,或是为演出预留的座位。另一些智能体面向企业:它们回答销售相关问题,执行促销和营销活动,并管理库存与定价。

The core architecture is a model in a standard agent loop: reasoning about a goal, exploring context, taking actions through tools, learning procedures through skills, asking clarifying questions, and observing the results until the goal is accomplished.

核心架构是一个处于标准智能体循环中的模型:围绕目标进行推理,探索上下文,通过工具采取行动,通过技能学习操作流程,提出澄清性问题,并观察结果直至目标达成。

There is no intent router in front of it that segments the conversation and no set of domain specific agents behind it.

其前方没有意图路由器来分割对话,后方也没有一组领域特定的智能体。

Engineering context

工程上下文

Skills, not subagents

技能,而非子智能体

A commerce agent has to cover a wide range of capabilities across many categories and intents, which makes it tempting to create one subagent per domain.

电商智能体必须覆盖众多类别和意图下的广泛能力,这很容易让人产生为每个领域创建一个子智能体的想法。

In practice this proves suboptimal, because a commerce conversation is one tightly coupled session across multiple intents and turns, and requires considerable shared context.

在实践中,这被证明并非最优方案,因为一次电商对话是跨越多个意图和轮次的紧密耦合会话,需要大量的共享上下文。

In a subagent architecture, the orchestrator holds the cart or staged changes, the user's preferences, and the conversation history.

在子智能体架构中,编排器持有购物车或暂存的更改、用户偏好以及对话历史。

Every handoff to a subagent is a state-lossy operation, which often impacts the quality of the subagent’s response and, consequently, the overall response. On top of that, each handoff can cost several times the tokens and adds seconds of latency.

每次向子智能体的移交都是有状态丢失的操作,这通常会影响到子智能体响应的质量,进而影响整体响应。此外,每次移交消耗的 Token 数量可能是原来的数倍,并会增加数秒的延迟。

The domains also rarely separate cleanly. A returns flow might need the order history, the current cart, and the product catalog, meaning a subagent-per-domain approach either duplicates that access everywhere or hands off mid-task.

这些领域也很少能清晰分离。退货流程可能需要订单历史、当前购物车和产品目录,这意味着按领域划分子智能体的方法要么在所有地方重复访问这些数据,要么在任务中途进行移交。

As models get smarter, they also handle longer context, more skills, and more tools, so the limits behind today's placement rules loosen with each model generation.

随着模型变得越来越智能,它们也能处理更长的上下文、更多的技能和工具,因此今天部署规则背后的限制会随着每一代模型的更新而放宽。

Instead, agent skills give you similar per-domain modularity and context control without the handoff tax, because the skill instructions load into the main agent that already holds the entire history.

相反,智能体技能提供了类似的按领域模块化能力和上下文控制,且无需承担移交带来的开销,因为技能指令会加载到已经持有完整历史的智能体主进程中。

In our comparisons across several enterprise deployments, a single agent with skills consistently has outperformed both the one-prompt-for-everything design and the subagent design on quality, and often at a lower cost and latency per task.

在我们对多个企业部署的比较中,带有技能的单一智能体在质量上始终优于“全用一条提示”的设计和子智能体设计,并且通常以更低的任务成本和延迟实现。

Where subagents do earn their place is when the orchestrator can call them as a tool for a narrow or self-contained task that would benefit from its own dedicated context window.

子智能体确实能赢得其位置的情况是,当编排器可以将其作为工具调用,用于执行一个狭窄或自包含的任务,且该任务能从其专用的上下文窗口中受益时。

A common production example is a deep-research subagent, where the subagent searches and reads documents, writes and runs code, traverses data models, and hits dead ends. All the work happens inside one or more subagents, and only a compact answer comes back to the orchestrator.

一个常见的生产示例是深度研究子智能体,其中子智能体搜索并阅读文档、编写和运行代码、遍历数据模型,并遇到死胡同。所有工作都在一个或多个子智能体内部完成,只有紧凑的答案会返回给编排器。

The other exception is a domain that already has its own purpose-built agent. If your pharmacy or financial-services experience runs a dedicated agent with its own compliance surface, the right move can be a hand-off, where that agent takes over the task and works with the user directly through its own loop until the task is done.

另一种例外情况是那些已经拥有专用智能体的领域。如果你的药房或金融服务体验运行着一个具有自身合规界面的专用智能体,正确的做法可能是一次移交,由该智能体接管任务,并通过其自身的循环直接与用户协作,直到任务完成。

The distinction is ownership of the conversation. A hand-off makes the domain agent the user's counterpart, while delegation keeps the orchestrator, bouncing the domain agent in and out within a single turn and degrading on every exchange.

区别在于对话的所有权。移交(hand-off)使领域代理成为用户的对应方,而委派(delegation)则保留编排器,在单个回合内将领域代理进出切换,并在每次交互中降级。

System prompt or skill: decide by frequency

系统提示或技能:根据频率决定

The main factor when deciding whether to put a set of instructions within a system prompt or skill is how often the agent will need it. Loading a skill costs a model turn, so anything the agent needs on most turns generally goes in the system prompt.

决定将一组指令放入系统提示还是技能中的主要因素是代理需要它的频率。加载技能会消耗一个模型回合,因此代理在大多数回合中需要的内容通常放在系统提示中。

This does, however, depend on how your traffic is distributed, and what agent behavior your evals show. A good starting point is that anything relevant to a third or more of your traffic, whether anticipated before launch or observed in production, goes in the system prompt, and the rest goes in skills.

然而,这确实取决于你的流量分布以及评估结果所显示的代理行为。一个好的起点是:任何与你三分之一的流量相关的事项,无论是发布前预期的还是在生产中观察到的,都放入系统提示,其余的放入技能。

If a skill is predictable from a signal you already have, such as the page the user arrived from, we recommend injecting it from the harness before the first model call and skipping the extra turn to load the skill.

如果技能可以从你已有的信号中预测出来,例如用户到达的页面,我们建议从控制框架(harness)在第一次模型调用之前注入它,并跳过加载技能的额外回合。

Critical instructions, such as safety and legal rules, brand constraints, and key user facts such as allergies, always go in the system prompt.

关键指令,如安全和法律规则、品牌约束以及关键用户事实(如过敏信息),始终放在系统提示中。

For commerce agents, this means product search lives in the prompt, since nearly every session touches it, and skills carry the long tail of features.

对于商务代理而言,这意味着产品搜索位于提示中,因为几乎每个会话都会涉及它,而技能则承载长尾功能。

In our reference implementation, the shopping agent's prompt holds grounding, cart and checkout semantics, and presentation rules, and the following skills cover the rest: search-discovery, purchase-research, planning-goals, customer-care, and memory-personalization.

在我们的参考实现中,购物代理的提示包含基础数据、购物车和结账语义以及展示规则,以下技能涵盖其余部分:search-discovery(搜索发现)、purchase-research(购买研究)、planning-goals(规划目标)、customer-care(客户服务)和 memory-personalization(记忆个性化)。

The merchant agent splits the same way, with performance-insights, catalog-listings, inventory-operations, pricing-promotions, and marketing-campaigns as its skills, one per operational domain.

商家代理以相同方式拆分,其技能包括 performance-insights(性能洞察)、catalog-listings(目录列表)、inventory-operations(库存操作)、pricing-promotions(定价促销)和 marketing-campaigns(营销活动),每个运营领域一个。

In the promptShopping agentGrounding, cart and checkout semantics, presentation rules, and product search.

在 promptShopping 代理中:基础数据、购物车和结账语义、展示规则以及产品搜索。

Shopping skillsThe long tailsearch-discovery · purchase-research · planning-goals · customer-care · memory-personalization

购物技能:长尾 search-discovery · purchase-research · planning-goals · customer-care · memory-personalization

Merchant skillsOne per operational domainperformance-insights · catalog-listings · inventory-operations · pricing-promotions · marketing-campaigns

商家技能:每个运营领域一个 performance-insights · catalog-listings · inventory-operations · pricing-promotions · marketing-campaigns

Engineering agent tooling

工程代理工具

Our post on writing effective tools for agents covers tool design in general. Two points have mattered most in commerce:

我们关于为代理编写有效工具的帖子涵盖了工具设计的一般情况。其中两点在商务领域最为重要:

Build agent tools on top of your core systems and logic.

在你的核心系统和逻辑之上构建代理工具。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

关联讨论

同一事件的更多信源

相似阅读

另一事件,读法相近