Cymbal Retail Agent with UCP Extension and A2A
April 17, 2026 ยท View on GitHub
This sample demonstrates how to build an AI-powered shopping assistant using Universal Commerce Protocol (UCP) - an open standard that enables interoperability between commerce platforms, merchants, and payment providers.
UCP provides standardized data types for the entire commerce transaction lifecycle: product discovery, checkout sessions, fulfillment options, payment processing, and order confirmation. By implementing UCP, your commerce agent can communicate with any UCP-compatible client or platform using a common vocabulary.
The sample uses Google ADK (Agent Development Kit) to build the AI agent and A2A Protocol (Agent-to-Agent) for agent discovery and communication.
| Key Features | |
| ๐ | UCP Checkout Capability: Implements dev.ucp.shopping.checkout for checkout, line items, totals, and order creation with standardized status lifecycle (incomplete โ ready_for_complete โ completed). |
| ๐ฆ | UCP Fulfillment Capability: Implements dev.ucp.shopping.fulfillment for shipping address collection, delivery options, and fulfillment method selection. |
| ๐ณ | UCP Payment Handling: Supports PaymentInstrument types with configurable payment handlers and merchant business configuration via UCP profile. |
| ๐ค | Capability Negotiation: Client and merchant exchange UCP profiles at /.well-known/ucp to agree on supported features before transactions begin. |
| ๐ค | Google ADK Agent: Gemini 3.0 Flash model with 8 shopping tools (search, checkout, payment) demonstrating how to build UCP-aware agents. |
| ๐ | A2A Protocol: Agent discovery via /.well-known/agent-card.json and JSON-RPC 2.0 communication - showing UCP as an A2A extension. |
| ๐ป | React Chat Client: TypeScript UI that renders UCP data types (Checkout, LineItem, PaymentResponse, OrderConfirmation) with proper capability handling. |
Demo
Complete Shopping Flow
Product search โ Add items to Checkout โ Payment โ Order confirmation
โถ๏ธ Watch the full demo video
Architecture
System Architecture
How Client, A2A Protocol, Cymbal Retail Agent, and Store interact
Key points:
- Client sends requests with
UCP-Agentheader containing its profile URL - Cymbal Retail Agent serves both
/.well-known/agent-card.json(A2A) and/.well-known/ucp(UCP Profile) - Capability Negotiation happens before processing - agent and client agree on supported features
- RetailStore uses UCP SDK types internally for checkout, fulfillment, and payment data
Quick Start
โฑ๏ธ Setup time: ~5 minutes
Prerequisites
Before you begin, ensure you have:
- Python 3.13+ with UV
- Node.js 18+
- Gemini API Key
1. Start the Cymbal Retail Agent
cd a2a/business_agent
uv sync
cp env.example .env
Edit .env and add your GOOGLE_API_KEY, then start the agent:
uv run business_agent
Expected output:
INFO: Started server process
INFO: Uvicorn running on http://0.0.0.0:10999
This starts the Cymbal Retail Agent on port 10999. You can verify by accessing:
- Agent Card: http://localhost:10999/.well-known/agent-card.json
- UCP Profile: http://localhost:10999/.well-known/ucp
๐ธ Server Endpoints (click to expand)
Agent Card/.well-known/agent-card.json
Declares UCP extension with capabilities |
UCP Profile/.well-known/ucp
Defines supported capabilities & payment handlers |
2. Start the Chat Client
In a new terminal:
cd a2a/chat-client
npm install
npm run dev
Expected output:
VITE v5.x.x ready
โ Local: http://localhost:3000/
The Chat Client UCP Profile can be found at http://localhost:3000/profile/agent-profile.json
3. Try It Out
โถ๏ธ Watch full video |
|
Note: This sample is for demonstration purposes only. See Production Notes for security considerations and deployment requirements.
Next Steps
Ready to understand how it works?
| Goal | Resource |
|---|---|
| Understand the architecture | Developer Guide |
| Deep dive into code | Architecture |
| Extend the sample | Extending Guide |
| AI assistant context | SKILLS.md - Context for Claude Code, Gemini CLI, Cursor, Codex |
What is UCP?
Universal Commerce Protocol (UCP) is an open standard that enables interoperability between commerce platforms, merchants, and payment providers. It provides standardized data types for commerce transactions.
This sample uses the following UCP capabilities:
dev.ucp.shopping.checkout- Checkout session management with status lifecycle:incompleteโready_for_completeโcompleteddev.ucp.shopping.fulfillment- Shipping and delivery handlingdev.ucp.shopping.discount- Discount and promotional codes
Technology Stack
| Technology | Purpose | Used For |
|---|---|---|
| Google ADK | Agent Framework | AI agent with tools, Gemini LLM integration, session management |
| A2A Protocol | Communication | Agent discovery via Agent Card, JSON-RPC messaging, task management |
| UCP | Commerce Standard | Standardized product, checkout, payment, and order data types |
Related Resources
Disclaimer
This is an example implementation for demonstration purposes and is not intended for production use.