Anthropic 开源 Claude Commerce Agents:面向购物和商家智能体的 Apache 2.0 蓝图

内容摘要
Anthropic近日开源了名为Claude Commerce Agents的购物和商家智能体,提供了一套面向购物和商家智能体的Apache 2.0蓝图。该蓝图包含购物代理和商家代理,以及零售、旅行、电信和娱乐四个可运行的垂直领域。该代码库可在Python 3.11+和Node 22上本地运行,并支持Claude API、Amazon Bedrock、Microsoft Foundry和Google Cloud Vertex AI等多个平台。购物代理和商家代理均采用单一代理循环和技能设计,以减少状态丢失和延迟。此外,UI组件以类型化工具的形式提供,确保历史数据保持原生,布局可解析。通过提示缓存和内存提取等优化,系统实现了高达90-99%的命中率。
Anthropic近日开源了名为Claude Commerce Agents的购物和商家智能体,提供了一套面向购物和商家智能体的Apache 2.0蓝图。该蓝图包含购物代理和商家代理,以及零售、旅行、电信和娱乐四个可运行的垂直领域。该代码库可在Python 3.11+和Node 22上本地运行,并支持Claude API、Amazon Bedrock、Microsoft Foundry和Google Cloud Vertex AI等多个平台。购物代理和商家代理均采用单一代理循环和技能设计,以减少状态丢失和延迟。此外,UI组件以类型化工具的形式提供,确保历史数据保持原生,布局可解析。通过提示缓存和内存提取等优化,系统实现了高达90-99%的命中率。

Most teams building a shopping assistant or agent rebuild the same scaffolding: an agent loop, a tool layer over the catalog, an approval gate, and an eval suite. Anthropic has now released that scaffolding as code. This week, they published anthropics/commerce-agents, a reference blueprint containing a shopping agent and a merchant agent, along with four runnable verticals: retail, travel, telecom and entertainment. It ships alongside two write-ups: a product announcement and an engineering deep-dive, A guide to the anatomy of effective commerce agents.

Is it deployable? Yes. The repository is Apache 2.0, runs locally on Python 3.11+ and Node 22 with an ANTHROPIC_API_KEY, and the runtimes accept any anthropic client, so the same code deploys on the Claude API, Amazon Bedrock, Microsoft Foundry or Google Cloud Vertex AI.

The two agents

The shopping agent lives inside a merchant’s own app. It searches the catalog, handles multi-item requests, compares options, builds the cart, and answers order and returns questions in the same conversation. Its five skills are search-discovery, purchase-research, planning-goals, customer-care and memory-personalization. A deployment implements a StorefrontBackend over its catalog, cart, order and policy systems.

The merchant agent supports store staff: sales performance questions, inventory alerts, pricing and promotion recommendations, and campaign drafts. Its skills are performance-insights, catalog-listings, inventory-operations, pricing-promotions and marketing-campaigns, over a MerchantBackend.

Both run three ways — the Messages API, the Claude Agent SDK, and Claude Managed Agents (beta) — from one definition of prompts, skills, tool contracts and gates. A Claude Code plugin, commerce-builder, scaffolds a new agent (/scaffold-commerce-agent) or reviews an existing one (/review-commerce-agent).

Skills, not subagents

The architectural claim is the most transferable part. Anthropic argues against an intent router and against one subagent per domain. A commerce session is one tightly coupled conversation, and every handoff is state-lossy: the orchestrator holds the cart, preferences and history, and each handoff can cost several times the tokens and add seconds of latency. Domains also overlap, a returns flow needs order history, the cart and the catalog at once.

Agent skills give the same modularity without that tax, because skill instructions load into the agent that already holds the history. Across several enterprise deployments, Anthropic reports a single agent with skills beat both the one-big-prompt design and the subagent design on quality, often at lower cost and latency. Subagents still earn a place for narrow, self-contained work such as deep research.

The prompt-versus-skill split is decided by frequency: roughly a third or more of traffic goes in the system prompt, the rest into skills. Safety rules, brand constraints and key user facts always go in the prompt.

UI components are tools

Most commerce responses are components, not prose. Rather than prompting the model to emit custom tags, the blueprint makes each component a tool — present_products, present_itinerary, present_plan_comparison — with typed arguments the server validates before the client renders. Because those calls sit in the messages array natively, reloading history needs no custom parser, and the agent can resolve “the first hotel” from the last presentation call. For token-level streaming, eager_input_streaming: true skips server-side buffering and its schema guarantee.

Explainer: the five decisions, interactive

Latency, caching, memory

A rendered response runs 500–700 output tokens, which without streaming is five seconds of spinner. Anthropic separates end-to-end latency from perceived latency, streaming components as they form and rendering plain-language progress lines. Eager tool dispatch — executing each call as its arguments finish streaming, the Agent SDK default — reportedly cuts multi-second gaps to a few hundred milliseconds.

Prompt caching is the main cost lever. Requests are ordered global → session → volatile, since caching is prefix-based and a timestamp at the top of the system prompt breaks the cache on every request. Cached reads cost a tenth of fresh tokens, cache writes carry a ~1.25x premium, and the best deployments run at 90–99% hit rates. Memory extraction runs asynchronously in a separate process; Anthropic measured 13% higher fact recall than an in-turn save tool.

Key Takeaways

  • Apache 2.0 blueprint with shopping and merchant agents, four verticals, and a Claude Code plugin.
  • One agent loop plus skills outperformed subagent and single-prompt designs in Anthropic’s deployments.
  • UI components ship as typed tools, so history stays native and layout is resolvable.
  • Prompt caching targets 90–99% hit rates; volatile data belongs last, never first.
  • Money, writes and IDs are gated in code — the model proposes, the harness applies.

Check out the Anthropic engineering deep-dive, Product announcement, GitHub repository and Commerce demos. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.

原始发布方:MarkTechPost(RSS)

原文时间:2026-09-04 03:46:59 +08:00

阅读原文 · 数据来源:AIHOT

提示

本文用于信息整理与经验分享。第三方订阅、支付及账号服务可能调整,实际规则、价格和可用性请以下单页面及服务方最新说明为准。

咨询 GPT 充值咨询充值