An AI shopping assistant built on Shopify's Universal Commerce Protocol — streaming conversational commerce from discovery through multi-merchant checkout.
Protocol citizen
The app hosts its own agent profile at /.well-known/ucp, reads each merchant’s profile, and negotiates the intersection of capabilities before calling any checkout tool. Merchants that support the Embedded Checkout Protocol get payment delegated to their own flow inside the chat UI.
negotiation.ts
import { negotiateCapabilities, shouldEscalateToECP, buildECPUrl, } from '@/server/lib/ucp/negotiation'; // Intersect agent + merchant profiles before any transaction. const caps = negotiateCapabilities(agentProfile, merchantProfile); if (shouldEscalateToECP(checkout)) { // Delegate payment to the merchant’s embedded flow — // the agent never collects card details itself. return buildECPUrl(checkout, caps); }
44-second film · silent · loops
What's Inside
A single chat surface backed by a Nitro server, a Claude-driven orchestration loop, and three Shopify MCP servers — everything below the chat input happens through the protocol, not hand-wired merchant integrations.
orchestratorEvery turn loops Claude → tool calls → results, hard-capped at 10 rounds so a confused agent fails fast instead of chaining searches indefinitely. Each round leaves a compact audit trail for deterministic replay.
/.well-known/ucpDeclares two capabilities, two payment handlers, and three embedded delegations. ECP-capable merchants take payment in their own embedded flow — no per-merchant credentials or bespoke storefront code.
@shopagent/mcp-clientA workspace package speaking JSON-RPC 2.0 with three error classes. Transport errors retry with exponential backoff; business errors fail immediately — retrying one is how you double-charge a customer.
sseText deltas, tool announcements, and commerce events share one SSE channel with monotonic ids and a 100-event buffer. Reconnect replays missed events without re-running the agent loop.
StorageAdapterConversations persist through a five-method adapter interface — FileAdapter today, Redis or Postgres tomorrow. Ephemeral state like the checkout permission flag deliberately never survives a restart.
buyer_preferencesSizes, brands, and budgets are captured as structured records the agent consults on every search — persistent across restarts, and out of the ever-growing context window.
Design Principles
Most "AI shopping" bolts a chatbot onto one store’s cart. UCP makes the agent the primary interface: merchants advertise capabilities via a protocol profile, and the agent negotiates what it can do before any transaction begins.
Checkout tools are excluded from the agent’s toolset until the user explicitly confirms intent to buy — a browsing session can never accidentally escalate into a transaction.
Origin-based CSRF, sliding-window rate limits, per-IP conversation caps, and a daily tool-round alert threshold — the early-warning signal for prompt injection or an agent stuck in a loop.
More Work