AI / RAG
Building Grounded AI Assistants for Ecommerce | Scouty
A practical guide to designing grounded AI product Q&A and guided buying assistants. Retrieval, citations, evaluation, and cost.
A bad ecommerce AI assistant is a chat box wired to a model. A good one is a retrieval system with a model on the front of it.
This guide is the working version of “how to build the second one.”
What “grounded” means
A grounded assistant answers using your real catalog and documents, not the model’s training data. Every claim it makes can be traced back to a product, a document, or an asset you own.
The shorthand:
- Ungrounded: “I think the Trailmaster boot is waterproof.”
- Grounded: “The Trailmaster GTX is waterproof. See page 4 of the care guide.”
The second answer is shorter, more useful, and more trustworthy. That is the entire bar.
Step 1. Decide the use case
Three common ecommerce assistant shapes:
- Product Q&A. Shopper asks a question on a PDP or in chat. Assistant answers using product data and documents.
- Guided buying. Shopper describes a need; assistant recommends 1–3 SKUs with reasons and citations.
- Support copilot. Internal tool. Agent searches products, manuals, and policies in one interface.
Each one needs different sources, different prompts, and different evaluation criteria. Pick one to ship first.
Step 2. Decide the sources
A grounded assistant is only as good as its source set. For ecommerce, the high-leverage sources are:
- Product titles, descriptions, and attributes.
- Spec sheets, manuals, and care guides.
- Warranty and return policy documents.
- Internal FAQs and “if asked X, answer Y” docs.
- Image metadata and asset taxonomy.
Sources you should not include without thinking:
- User reviews. Mixed quality, often contradictory.
- Old or discontinued product data.
- Sales-only or partner-only docs (without a permission filter).
Step 3. Index at the right granularity
Coarse indexing is the most common reason RAG fails. A 60-page manual indexed as one document can never produce a good answer.
Rules of thumb:
- Documents: index at the page level. Aim for 200–600 tokens per chunk with overlap.
- Products: index at the variant level if variants matter (size, color, fitment).
- Images: include metadata (alt, caption, taxonomy) so the assistant can reason about them.
Step 4. Hybrid retrieval
Keyword search for exact identifiers. Semantic search for natural language. Merge results, then optionally rerank.
A simple recipe:
- Run keyword and semantic in parallel.
- Merge with a deduping step.
- Apply business filters (in-stock, region, customer-segment).
- Rerank only if you see noisy ranking issues.
Step 5. Prompt with discipline
The system prompt should:
- Tell the model to answer using only the retrieved sources.
- Tell the model to say “I don’t know” if sources don’t cover the question.
- Cap output length explicitly.
- Define citation format up front.
A short example:
You are a product assistant for [store]. Answer the user's question using
only the sources provided. If sources don't cover it, say so.
Cite sources inline like [filename, page] and at the end as a list.
Keep answers under 120 words.
This is short on purpose. Long prompts drift.
Step 6. Cite always
Citations are the trust mechanism. They should be:
- Inline in the answer.
- Linked to the source product, document, or asset.
- Verifiable. Clicking the citation should land you on the relevant page or product.
Without citations, an AI assistant is a black box. With citations, it is a tool.
Step 7. Evaluate properly
You need a small evaluation set. 30 to 100 real shopper questions. And a way to measure quality on each.
Things to score:
- Did the answer cite valid sources?
- Were the cited sources relevant?
- Was the answer correct?
- Was the answer the right length?
- Did the assistant correctly say “I don’t know” when sources didn’t cover it?
Rerun this set whenever you change sources, retrieval logic, prompts, or models.
Step 8. Watch the cost equation
Two cost layers:
- Retrieval (Scouty AI meters retrieval calls).
- Generation (LLM provider tokens).
Prefer:
- Capped output length over unbounded generation.
- Smaller models for routine answers, larger models for high-stakes ones.
- Token-aware retrieval (don’t stuff 20 chunks into a prompt).
- Prepaid answer packs over open-ended overage.
Step 9. Plan for failure modes
A grounded assistant will still hit edge cases:
- Out-of-stock confusion. Index in-stock state and filter on it.
- Stale sources. Add an “effective date” to documents and prefer recent ones.
- Adversarial queries. Have a refusal policy for unsafe asks.
- Permission leaks. Apply permission filters at retrieval time, not just generation.
Step 10. Surface AI as a peer to search
Not every query needs an AI answer. Many shoppers want a list of products. The cleanest UX is:
- Default to product results.
- Show an AI answer above the fold when the query is well-suited (use-case, comparison, how-to).
- Always show citations.
- Let shoppers click through to products and documents.
How Scouty fits
Scouty AI provides hybrid retrieval over your products, documents, and assets, returns grounded answers with citations, and meters retrieval and generation separately. The retrieval surface is the same one used for product, semantic, image, and document search. So you don’t run two indexes.
If you want a manual review of whether an AI assistant is the right next investment for your store, request a free expert-led Search Audit.