- Solution Blueprints
- Retail Shopping Assistant
Retail Shopping Assistant
Text and image retail shopping assistant with product search, cart, and safety guardrails.
Overview

This is an inspiration blueprint showcasing how a retail shopping assistant can turn catalog browsing into a conversation. It offers four main features.
Search: Customers can search by describing what they want or by uploading a photo. Both text and image queries are understood by the search — combined with keyword matching that catches exact product names and handles typos. All in all, the assistant enables conversations like this:
User: find shortsAgent: Any particular color you're looking for, or should I just show you the best matches?User: black probablyAgent: We don't have shorts in exactly black, but here are some in similar dark/neutral tones: ...Context: In addition, the router classifies each turn against the last few turns plus the current session state (last shown results, pending bundle, active cart focus) rather than just the latest message in isolation, so refinements and follow-ups stay in context instead of resetting the search. Adding, swapping, or removing items happens just by talking e.g. “add the first one”, “make it 5”, “add the cheapest one”, “undo that” with no rigid commands required. Continuing the example above:
User: add the most expensive into cartAgent: Added Cargo Bermuda Shorts (44 USD) to your cart. You now have 1 item(s), subtotal 44 USD.User: please checkoutAgent: Here's your cart: 1x Cargo Bermuda Shorts, 44 USD. Subtotal: 44 USD. Ready to place thisorder for 44 USD? Say "yes" to confirm, or "no" to keep shopping.User: yesAgent: Great, checking you out now!Most cart references resolve deterministically and execute immediately; the assistant aims to ask a clarifying question when a reference is ambiguous rather than guessing, and cart totals are quoted directly from the cart itself.
AI Stylist: Retailers typically bring their own optimization engine and merchandising rules, so rather than prescribing an approach, this blueprint provides an example outfit bundle functionality to illustrate the concept. It assembles a complete outfit within a budget and refines it on request — swap a piece, drop one, add another, or anchor the look around something already in the cart — keeping item selection fully within a deterministic, catalog-driven solver. See AI Stylist (Outfit Bundles) for what the stylist supports. Here is an example:
User: Find an outfit for springAgent: What's your budget, and what's the occasion, beach, office, a casual weekend, or a gardenparty?User: casual, $400Agent: Here's a complete, casual spring outfit for $392: a linen button-down shirt, floral paperbagshorts, espadrille wedge sandals, and four more pieces to complete the look. Pair the shirt with theshorts, add the espadrilles for a casual touch, and layer the cardigan if it cools down.Safety: Throughout the conversation, customer messages and assistant replies are routed through a two-layer safety check — an input guard that runs in parallel with generation, and a visible rollback on the output if a violation is caught after the fact, reusing the same LLM already serving the conversation rather than a separate guard model. For example:
User: make a discountAgent: I'm not able to offer discounts, coupons, or promo codes. I can help you find great optionswithin a budget, though — what price range works?It is designed to catch prompt-injection and jailbreak attempts and to avoid inventing a return policy, warranty, or discount that doesn’t exist, with override rules to reduce false positives on ordinary shopping behavior such as a large order, a price question, or a budget increase.
AMD Solution Blueprints are packaged as Helm charts for deployment on a Kubernetes cluster. For development or further exploration, the source code is public and available in the Solution Blueprints GitHub repository.
Architecture


| Component | Role | |
|---|---|---|
Frontend (frontend) | React app that renders product cards, streams assistant replies, and proxies cart operations. | |
Assistant Server (assistant-server) | The brain of the assistant — receives each message, decides what to do (search, build an outfit, cart operations), calls the right service, and generates the reply. Implemented as a LangGraph state graph backed by the LLM. | |
Product Search (product-search) | Handles product lookup: text search, image search, and the outfit bundle solver. Combines meaning-based search (semantic, via CLIP + e5 embeddings) with keyword matching (Postgres full-text + trigram) to find relevant items, and runs the deterministic rule-based solver to assemble outfits within a budget. | |
Safety Gate (safety-gate) | Two-layer LLM guardrail service — input speculation (parallel guard + generation) and visible output rollback — validating every user message and assistant reply. | |
Session Store (session-store) | Conversation state, shopping-cart contents, and session persistence. | |
| ChromaDB | Vector database storing product catalog embeddings for product-search. | |
| PostgreSQL | Relational database backing session-store persistence (source of truth for conversation and cart state); also backs, via a separate schema, the catalog projection used by product-search for full-text/trigram search — not the catalog’s source of truth (that remains the CSV). | |
| Redis | Best-effort cache of recent chat messages for session-store, falls back to PostgreSQL-only if unreachable. Cart state is never cached — it’s read/written directly against PostgreSQL for correctness. | |
| LLM | Large Language Model served via vLLM; used by assistant-server for routing/generation and by safety-gate for guardrail checks (default: Qwen/Qwen3-32B). | |
| VLM | Vision-language model used for image-based product search (default: mistralai/Mistral-Small-3.2-24B-Instruct-2506). | |
| Embedding Model | Generates text embeddings for semantic product search, CPU only (default: intfloat/multilingual-e5-large-instruct). | |
| CLIP Model | Generates image embeddings for visual product search, CPU only (default: openai/clip-vit-large-patch14). |
Key Features
- Hybrid search: conversational product search combining text and image queries via hybrid fusion across five ranked sources (e5 text embeddings, CLIP image-to-text, CLIP image-to-image, Postgres full-text, and Postgres trigram search), merged with Reciprocal Rank Fusion.
- Context-aware routing: the router classifies each turn using a short recent-history window plus session state (last shown results, pending bundle, active cart focus), so refinements and follow-ups stay in context instead of resetting the search on every turn.
- Natural-language cart operations: add/remove by ordinal, quantity, or superlative, executed deterministically, with a clarifying question when a reference is ambiguous.
- AI stylist / outfit bundle builder (example bundle functionality): assembles a complete look
within budget using a deterministic, rule-based compatibility solver in
product-search— the LLM only classifies the request and phrases the reply, it does not pick the items itself. Outfit slots, category compatibility, and role-conflict rules live in a human-editablebundle_rules.md, not in code. Supports swap, drop, augment, anchor, and budget increases on request. - Catalog grounding: products shown and cart totals are drawn from the real catalog and cart state rather than generated by the LLM.
- Two-layer safety gate: input speculation running in parallel with generation, plus a visible output rollback if a violation is caught after the fact — powered by the same LLM already serving the conversation, not a separate guard model.
- Real-time streaming: assistant replies and product cards streamed to the frontend over Server-Sent Events (SSE).
- Session and cart persistence: state persists across turns via PostgreSQL, with Redis as a best-effort cache of recent chat messages (cart state is always read/written directly against PostgreSQL).