Skip to main content

How it works

UCP (Universal Checkout Protocol) enables AI agents to interact with e-commerce systems through a standardized interface. This example uses Upsonic’s Chat feature to provide a conversational interface for the shopping assistant. The Chat feature enables stateful conversations with automatic memory management, allowing the agent to remember context across multiple interactions.

Available UCP Tools

ToolDescription
get_available_products()Browse product catalog
get_available_discount_codes()View discount codes
get_your_user()Get user info & addresses
discover_merchant()Merchant & payment info
create_cart()Create shopping cart
apply_discount()Apply discount to cart
set_shipping_address()Set delivery address
complete_purchase()Complete checkout

Installation

uv venv
uv pip install "ucp-client[server]==0.0.11"
uv pip install upsonic==0.69.3
uv pip install streamlit

Usage

Terminal 1 - Start the mock server:
uv run ucp mockup_server
Terminal 2 - Run the agent (CLI):
uv run upsonic_shopping_agent.py

Streamlit UI

You can also use the Streamlit web interface:
uv run streamlit run streamlit_app.py
Then open http://localhost:8501 in your browser.

Repository

Explore the complete implementation and contribute:

Learn More