← Library | Agentic Commerce Protocol
Open spec · ACP v1

The Agentic Commerce Protocol — how any agent talks to grocery.

ACP is the open contract between an agent (the planner) and a commerce backend (the executor). Three layers, one shape: A2A capabilities declare what an agent can do; MCP tools expose it to LLM clients; A2UI events stream agent state to a rendering surface. The same protocol powers Eagle AI for Your Grocer, the multi-persona demos in this library, and any third-party agent client integrating with Delectable.

3
Layers: A2A (capabilities), MCP (tools), A2UI (events).
N
Agent clients. Open contract — OpenClaw, custom planners, or any A2A-compatible agent.
1
Backend. The same Delectable Commerce module serves every agent.

Why ACP exists

Most "agentic commerce" today is a thin wrapper: a prompt + an API + some retries. That breaks when the agent client changes, when the model changes, or when a new surface (kiosk, voice, in‑aisle assistant) needs the same intelligence. ACP separates the planning layer from the executing layer with a stable contract on both sides — so the agent can be Claude today, Gemini tomorrow, and the OpenClaw open-source agent next month, all hitting the same backend without the grocer rebuilding integrations.

The three layers

A2A

Agent-to-Agent capabilities

Declarative capability registry. An agent advertises what it can do; clients dispatch by capability ID, not by URL. Capabilities have typed parameters and response schemas that any A2A-compatible client can validate against.

commerce_pkg/protocols/a2a.py
MCP

Model Context Protocol tools

The same capabilities exposed as MCP tools. Drop-in usable by Claude, OpenAI, or any FastMCP-compatible client. Tool definitions auto-generate from the A2A capability registry — no duplication, no drift between protocol surfaces.

commerce_pkg/protocols/mcp.py
A2UI

Agent-to-UI events

Server-sent event stream that lets a UI render agent state in real time: tool calls, intermediate results, drift signals, citations. The chat experiences in this library all consume A2UI — same event types, different render targets (web, mobile, kiosk).

commerce_pkg/protocols/a2ui.py

A2A capability registry

The current COMMERCE_CAPABILITIES set in production. Any A2A-compatible agent can invoke these without understanding the underlying architecture (BigQuery, Memgraph, Redis, model routing) — the protocol abstracts it away.

search_products
query, dietary_filters, max_results
Semantic product search with shopper-level personalization. Returns ranked SKUs with grounding metadata for citation.
build_cart
ingredients, loyalty_id, budget
Build the Perfect Cart from an ingredient list. ILP solver respects package sizes, dietary constraints, and active promotions; returns the optimized basket with a swap-cost matrix.
check_inventory
skus, store_id
Real-time inventory availability per store. Surfaces in-stock alternates if the requested SKU is out.
get_pricing
skus, loyalty_id
Resolve effective price with active promotions and loyalty-tier discounts applied. Returns price provenance so the agent can explain “why” in chat.
find_alternatives
sku, reason, dietary_filters
Substitution engine. Finds replacements that respect the original purchase intent and dietary constraints. The reason code (out-of-stock, cheaper, allergen-safe) routes to different ranking strategies.
plan_meals
days, household_size, constraints
Generate a personalized meal plan grounded in the Food & Shopper HyperGraphs. Returns recipes, ingredient lists, and a starter cart in one call.

Why this is strategic

Model-portable

Switch from Gemini to Claude to GPT-5 by changing one config. The protocol layer is stable; the model is interchangeable. Hedge against single-vendor risk.

Channel-portable

Web, mobile, in-store kiosk, voice, in-aisle scan all consume the same A2UI event stream. Build the agent once; render anywhere the shopper is.

Partner-portable

Third parties (CPG brands, ad networks, social platforms) integrate via A2A capabilities without exposing internals. The Ads and Social modules ride the same protocol; future modules will too.

Open-spec compatible

A2A is an emerging open spec; MCP is from Anthropic and growing fast. Building on these means external agents (OpenClaw, custom planners) can integrate with us without bespoke work.

UCP — speaking Google's Universal Commerce Protocol

When Google announced the Universal Commerce Protocol (UCP) in October 2025, the bar moved: Search agents will start calling retailers directly with typed A2A requests, and Merchant Center adds a new conversational‑attribute feed. Delectable's UCP gateway is the on‑ramp — a curated, externally‑safe subset of our A2A surface, deployed in the grocer's own GCP project so shopper data stays put and the GCP consumption bills to the retailer (not us).

UCP

Hybrid-tenant gateway

A Cloud Run service that fronts the grocer's commerce stack. Discovery at /.well-known/ucp; dispatch at /ucp/v1/agent. Speaks the UCP request/response envelope; routes intents to the A2A capability registry above.

commerce/src/commerce/protocols/ucp.py
UCP

Customer-tenant data stores

Terraform-provisioned BigQuery dataset (products, inventory, prices, embeddings) plus Cloud SQL + pgvector for private RAG. Real-time inventory and loyalty data never leave the customer's VPC.

commerce/deploy/customer-tenant/
UCP

Conversational feed

PIM → Merchant Center conversational-attribute transform. Emits dietary attributes, meal contexts, shopping missions, substitutability classes — the new fields Google's Search agent expects.

commerce/src/commerce/merchant_center/
UCP REQUEST
{
  "agent": { "name": "google-search", "version": "1.0" },
  "intent": "build_cart",
  "parameters": {
    "ingredients": ["oat milk", "rolled oats", "blueberries"],
    "household_size": 2
  }
}
UCP RESPONSE
{
  "grocer": "giant-eagle",
  "tenant_env": "prod",
  "intelligence_source": "delectable-saas:food-graph",
  "duration_ms": 184
}
{
  "items": [
    {"sku": "GE-0012", "name": "Oat milk, 32oz", ...},
    {"sku": "GE-0034", "name": "Rolled oats, family pack", ...},
    {"sku": "GE-0099", "name": "Frozen blueberries, 12oz", ...}
  ],
  "subtotal": 21.97
}

Cross-tenant demo + the FSR-facing one-pager live in commerce/examples/cross_tenant_demo/ and commerce/intake/google-retail-pitch/.

ACP is the moat around the moat.

The HyperGraph is the data moat. ACP is the integration moat. A grocer plugged into ACP today gets every future agent client, every future channel, every future LLM — without rewiring. That's the difference between an LLM wrapper and an infrastructure layer.