
Anthropic has just published a guide to the architecture of effective commerce agents, together with a reference GitHub repository covering retail, travel, telecom, and ticketing.
A commerce agent can help a prospective customer with more than a simple product question. It searches a catalog, compares options, considers preferences, adds products to a cart, and guides the customer toward checkout.
Anthropic defines a commerce agent as an agent that simplifies buying and selling across an online catalog. The AI does more than answer questions: it can search, make decisions, and stage actions within a shopping journey.
The guide is interesting because it goes beyond a list of features to build. It recommends a clear architecture: one model in an agent loop, tools connected to real commerce systems, skills loaded when needed, and a harness that keeps sensitive rules deterministic.
To test this architecture, I built a prototype in two hours with my usual Nuxt stack and connected it to the real Shopify store operated by maliā care. The agent searches its small catalog, recommends products, manages a cart, prepares the handoff to Shopify checkout, and retains preferences across conversations.
Two hours are obviously not enough to build a production-ready Shopify agent. They are enough to turn the guide into a working experience and verify where each responsibility should live.
From Chatbot to Agent
A traditional chatbot mainly returns text within a predefined flow. An agent pursues a goal: it identifies missing information, calls the tools it needs, observes their results, and chooses the next step.
For a request such as “I’m looking for a simple facial skincare product for dry skin,” Claude must query the current catalog, check product availability, and present only the options actually returned by the store. The answer does not live entirely inside the model.
| Traditional e-commerce chatbot | Commerce agent |
|---|---|
| Answers a question | Pursues a goal |
| Receives prepared data | Retrieves the data it needs |
| Follows a predefined flow | Chooses the next step |
| Advises the user | Can stage a reversible action |
Anthropic distinguishes between consumer-facing agents, which search, compare, and assemble an order, and merchant-facing agents, which analyze sales or prepare catalog operations.
My experiment focuses on the first category: a shopping agent for the customers of a Shopify store.
One Agent Loop Instead of a Collection of Subagents
Anthropic’s central architectural choice is to keep a single agent in a standard agent loop.
There is no intent router followed by one agent for the catalog, another for the cart, and a third for returns. A commerce conversation blends these topics and shares the same history. Every handoff risks losing context and adding latency.
Anthropic therefore favors one main agent that owns the conversation, supported by four building blocks with distinct responsibilities.
| Building block | Responsibility |
|---|---|
| System prompt | Frequently needed rules and general behavior |
| Skill | Specialized procedure loaded on demand |
| Tool | Typed access to data or an action |
| Backend / harness | Execution, permissions, and deterministic rules |
In this version, the system prompt continually reminds Claude to stay grounded in the catalog. A more detailed purchase research skill is loaded only when it needs to compare several products. I explained this mechanism in my article about Skills for AI agents.
This separation also reflects my approach to context engineering: not every piece of information should enter the context at the same time or with the same level of authority.
Shopify Provides Real Data and Actions
The model does not contain maliā’s catalog, prices, or cart state. It orchestrates the systems that provide this information.
Shopify offers its Storefront MCP for this purpose. It provides structured access to the catalog, store information, and cart operations. My Nuxt application acts as the MCP client between the agent and Shopify.
An MCP server can be compared to an API designed for agents: every tool has a name, a description, parameters, and a result the model can interpret. I explored this principle in my lessons from building MCP servers for my SaaS products.
I did not expose every Shopify tool directly to Claude. A narrower backend layer selects the domain, calls the appropriate server, sanitizes its response, and returns only the useful fields.
Claude can, for example, request:
searchProducts({ query: "soin hydratant visage" })
Shopify remains responsible for the catalog and cart. Claude applies judgment to the customer’s intent, the results worth selecting, and how to present them.
Even the UI Becomes a Tool
Product recommendations work better as cards than as a paragraph containing three names and three links.
Rather than asking the model to generate HTML, Anthropic recommends treating UI components as presentation tools. Claude passes the product IDs to display; the server validates and enriches the data; Nuxt renders the cards in the requested order.
This typed contract prevents the model from inventing card content. It also stores the exact layout shown to the user in the conversation. When the user says “add the second product,” Claude knows which item they mean.
The UI therefore becomes part of the agent loop’s state.
My Prototype in Three Steps
1. Search a Real Catalog
Claude decides whether it needs to search for products, inspect a specific product, or read a store policy. It observes Shopify’s response before continuing.
maliā’s small catalog makes an effective test bed: I can manually verify every recommendation, price, and availability status. Hallucinations are immediately visible.
2. Update the Cart Without Being Able to Pay
The agent can create a cart, set a product quantity, read the latest cart state, and display the official checkout link. It does not choose the Shopify domain, the cart’s internal ID, or the destination URL.
Most importantly, no tool allows it to complete payment. A request such as “add two serums” authorizes a reversible cart update. Placing the order remains a human action inside Shopify.
3. Preserve Conversations and Keep Memory Under Control
A local SQL database stores conversations, rendered product cards, and the associated cart. I separate three types of state that are often grouped together under the word “memory”:
Something said during a conversation does not automatically become a permanent preference. To remember “I prefer lightweight skincare textures,” Claude proposes the memory and the interface shows exactly what will be stored. The user can approve it, reject it, and later delete it.
Anthropic also describes asynchronous memory extraction for systems operating at a larger scale. For this test bed, I chose explicit approval to make the write path visible and controllable.
Claude Decides, the Harness Enforces
In a commerce system, an instruction in the system prompt cannot be the only guardrail. The model can misinterpret a request, receive malicious content from a product description, or invent an ID that looks valid.
Anthropic therefore recommends enforcing sensitive rules in the harness around the agent. My implementation follows four principles:
- Accept only server-issued IDs. A hallucinated product or variant ID—whether pasted into the conversation or hidden inside a description—is rejected before it reaches the cart.
- Treat catalog content as untrusted input. Product descriptions and policies are sanitized and bounded before entering the context. Claude can analyze them but never follow them as instructions.
- Validate the resulting state. The backend checks the cart after each update and serializes writes, preventing repeated or concurrent requests from exceeding quantity caps.
- Never expose payment. The most reliable way to prevent Claude from completing an order is to provide no tool capable of doing so.
The agent keeps the judgment. The harness keeps the authority.
What Those Two Hours Say About Product Engineering
The short timeframe came from the narrow scope, Anthropic’s detailed guide, and the commerce services already available through Shopify.
AI accelerated the implementation, but the speed also came from Product Engineering decisions: using a familiar technology stack, limiting the journey, testing against a small real-world catalog, and immediately separating the model from business rules.
I am Claude Certified Architect – Foundations, certified by Anthropic. This project gave me an opportunity to apply that knowledge to a concrete use case. It reflects how I work as a Product Engineer in the age of AI: build the smallest useful version to learn before adding complexity.
Next: Observing and Evaluating the Agent
The project will now serve as a test bed for different observability solutions. The goal is to reconstruct each journey: the user request, Claude’s decisions, loaded skills, tool calls, their arguments and results, latency, and any errors. A final answer alone is not enough to understand why a recommendation was relevant or why an action failed.
The second area is evals. I want to build reproducible scenarios to verify that the agent retrieves real products, uses the right tools, respects stated preferences, updates the cart correctly, and never crosses the limits enforced by the backend. These cases will also make it possible to compare a change in prompt, model, or tool without relying on a handful of successful conversations.
I will use this test bed to explore several approaches to both topics. Observability and evals will be the focus of future articles.
My View: An Excellent Blueprint for Getting Started
Anthropic’s Commerce Agents repository is not a product to deploy as-is. It provides an architecture to adapt to your own systems and, more importantly, makes the boundaries between the model, tools, harness, interface, and user visible.
With a clear scope and a familiar stack, it is now possible to move very quickly from an architecture guide to an experience connected to an existing store.
For a Product Engineer, this is particularly interesting territory: it combines conversational experience, interface design, business-system integration, state management, and safety.
What about your product: which decisions would you leave to the model, and which rules would you always keep in code?
📌 Do you run a Shopify store and want to build a conversational agent that can advise customers, query your catalog, and guide them to the cart? Let’s discuss your use case. I can help from scoping through implementation with an end-to-end Product Engineering approach, including MCP server development.
Sources
- Anthropic, “A guide to the anatomy of effective commerce agents”.
- Anthropic, Commerce Agents reference repository.
- Shopify, Storefront MCP documentation.