How to prevent an ecommerce AI shopping assistant from hallucinating
Aug 11, 2026
An ecommerce AI shopping assistant will be more reliable when it retrieves approved evidence before answering, treats each source type according to its authority, checks live data for changing facts, and refuses to guess when evidence is missing or conflicting. Product specs, reviews, policies, and inventory should not be blended into one undifferentiated knowledge base: each needs its own fields, freshness rules, and answer guardrails.
Create a source hierarchy before you connect your catalog
A source hierarchy tells the assistant which evidence wins when product specs, reviews, policies, and inventory disagree. Without one, retrieval can find a plausible sentence without knowing whether it is authoritative, current, or relevant to the shopper’s exact variant.
A practical hierarchy looks like this:
| Question type | Preferred source | Why |
|---|---|---|
| Price, variant, size, color, dimensions, ingredients, compatibility | Structured product catalog or product feed | These are product facts and should be tied to a specific SKU or variant. |
| Stock, availability, delivery estimate | Live inventory and fulfillment system | These facts can change after the knowledge base was indexed. |
| Returns, shipping, warranty, subscriptions | Current policy source | The answer may depend on region, product category, promotion, or order status. |
| Customer experience and common objections | Reviews | Reviews provide customer observations, not guaranteed product specifications. |
| Brand tone and recommendation logic | Approved brand guidelines and rules | These shape how the assistant responds without replacing factual evidence. |
Give every source metadata such as product ID, variant ID, market, publication status, effective date, and last-updated time. Then filter retrieval before generation. A United Kingdom returns policy should not be retrieved for a shopper in Canada, and a product review should not be used to answer a question about a different model merely because the product names are similar.
Anagram’s guide to answering product questions recommends preparing product names, variants, prices, ingredients, sizes, use cases, policies, reviews, and product-page content before the assistant starts answering. Its source table also separates catalog data, product-page copy, and FAQs or policies by the questions they help answer. Read the guide to answering shoppers’ product questions for that implementation framing.
Keep product facts separate from review evidence
The assistant should state catalog facts as facts and describe reviews as reported customer experience. A review can support “some customers found the fit narrow”; it cannot safely establish the official width, safety rating, or compatibility of the product.
Use response rules such as:
- Product specifications: quote or paraphrase only retrieved fields for the requested product and variant.
- Review themes: attribute claims to reviews with language such as “reviewers commonly mention…” and show the review date where useful.
- Unverified anecdotes: never turn one customer’s experience into a universal promise.
- Conflicting evidence: surface the conflict or use the approved catalog field; do not average incompatible claims.
- Missing attributes: say the information is unavailable rather than filling the gap with a similar product’s details.
Review ingestion also needs controls. Remove duplicates, identify the product and variant attached to each review, retain moderation status, and distinguish verified-purchase or structured review attributes if your system provides them. Keep review text searchable for themes, but do not let it outrank a current specification for a specification question.
Treat policies as conditional rules, not snippets
Policy answers should include the conditions that change the outcome. “You can return it” is unsafe if the policy has exclusions, a region restriction, a time window, final-sale terms, or a different process for personalized goods.
Represent policies as structured rules where possible:
- Scope: which market, product type, channel, and order status apply?
- Condition: what must be true for the rule to apply?
- Outcome: refund, exchange, credit, coverage, or another remedy.
- Exception: which products or situations are excluded?
- Action: where should the shopper go to start the process?
- Effective date: when did this version become active?
Retrieve the full relevant policy section, not only a matching sentence. The assistant should link to the official policy when the shopper is making a consequential decision, and it should escalate questions involving a specific order, disputed eligibility, or an exception it cannot verify.
Do not let promotional copy override legal or operational policy. If a campaign says “free returns” while the policy excludes a product category, the assistant should use the approved policy rule and flag the discrepancy for the team.
Never generate inventory from memory
Inventory is a live lookup problem, not a writing problem. A language model can produce a convincing stock answer even when no current quantity was provided, so availability, backorder status, and delivery estimates should come from a live commerce or fulfillment endpoint at the time of the response.
Use a tool or API for questions such as:
- Is this exact variant in stock?
- Is it available at this location?
- Can I buy two units?
- When can it ship to this destination?
- Is the item backordered or discontinued?
Return an explicit state from that system—such as available, unavailable, preorder, or lookup failed—and define what the assistant says for each state. If the lookup fails, the safe response is that availability cannot be confirmed right now, followed by a product or support link. It should never convert a stale catalog field into “in stock.”
For multi-location brands, include location, warehouse, shipping destination, and time of lookup in the inventory request. Cache only when the business accepts the risk and displays the timestamp or qualification clearly. Inventory answers should also avoid promising delivery unless the fulfillment system supplies a destination-specific estimate.
Add an abstention rule and a verification step
Grounding reduces hallucinations; it does not make them impossible. The assistant needs permission to stop, explain the limit, and route the shopper to a person or authoritative page.
Write guardrails in operational language:
- Answer only when the retrieved evidence directly supports the claim.
- Do not infer an unstated attribute from a similar product.
- Do not invent prices, stock levels, delivery dates, certifications, measurements, or policy exceptions.
- If sources conflict, prefer the designated source and disclose uncertainty where the conflict affects the purchase.
- Ask for the missing product, variant, destination, or use case when that detail determines the answer.
- Escalate account-specific, order-specific, safety-sensitive, and legally consequential questions.
Add a post-generation check that maps each factual sentence to retrieved evidence. Reject or rewrite an answer if a claim has no supporting source, cites the wrong product or region, or uses a policy outside its effective period. Structured response fields can make this easier: answer, product_id, variant_id, source_ids, inventory_checked_at, and escalation_required.
Citations are useful only when they lead to the evidence behind the claim. A generic link to a product page does not prove a return exception or a live stock state. Show the relevant product, policy, or review source when the interface allows it.
Test the assistant with failure cases, not just happy paths
A reliable evaluation set should include questions that tempt the assistant to guess. Test every important product family and market with cases such as:
| Test case | Expected behavior |
|---|---|
| A shopper asks for a specification that is absent | State that it is not available; do not infer it. |
| Two variants have different measurements | Ask which variant or return the matching variant’s value. |
| A review contradicts the catalog | Keep the catalog fact separate and describe the review as an experience. |
| A policy has a product exclusion | Include the exclusion or link to the applicable rule. |
| Inventory changes after indexing | Check the live source before answering. |
| The question names an ambiguous product | Ask a clarifying question. |
| The retrieval service returns no evidence | Abstain or escalate. |
| A shopper asks for a guarantee the brand does not make | Say the guarantee cannot be confirmed. |
Score more than whether the answer sounds natural. Check factual accuracy, product and variant matching, policy scope, source attribution, freshness, correct refusal behavior, and whether a live inventory call happened when required. Re-run the set after catalog, policy, prompt, retrieval, or integration changes.
Use shopper questions to find gaps after launch
Monitoring should reveal where the assistant lacks evidence, not just whether shoppers clicked a recommendation. Review unanswered questions, low-confidence answers, escalations, source conflicts, repeated clarifications, and questions that end without a useful next step.
Anagram positions its Site Agent for shoppers comparing options and deciding what to buy, and its broader workflow connects on-site conversations with learning about customer questions and improving site and brand visibility. That makes the conversation log useful for finding missing attributes, unclear policy language, and recurring objections—but the team should still approve any new source or answer rule before it becomes authoritative. See Anagram’s Site Agent overview and AI Visibility product page.
A simple operating cycle is:
- Review failed or escalated questions.
- Classify the gap as catalog, review, policy, inventory, retrieval, or wording.
- Fix the authoritative source rather than adding an unsupported answer.
- Add the question to the evaluation set.
- Re-test the answer and its fallback.
- Monitor whether the same failure returns.
The goal is not an assistant that answers every question. It is an assistant that answers supported questions precisely, checks changing facts at the right moment, distinguishes evidence from opinion, and makes uncertainty visible before it costs a shopper’s trust.