Skip to content
Ahmad Raza
Menu
All posts

5 min read

RAG Over Policies and FAQs Without Mixing Catalog Facts

Keep your store assistant honest by splitting knowledge in two: a RAG corpus for policies and FAQs, and live catalog tools for prices, stock, and variants. Here is how to draw the line.

RAG Over Policies and FAQs Without Mixing Catalog Facts
On this page

A customer asks your store assistant two questions in a row. "Can I return a sale item?" and "Is the blue jacket in medium still $89?" They look similar. They are not. The first answer lives in a policy document that changes maybe twice a year. The second lives in a product database that can change every few minutes.

When both kinds of knowledge get dumped into one vector index, the assistant starts blending them. It quotes last month's price because a chunk from an old product export ranked higher than anything else. It says an item is returnable because a general FAQ chunk outscored the "final sale" note on the product. Nothing crashed. The answer is simply wrong, and wrong answers about money hurt trust fast.

The fix is boring and it works: keep two separate sources of truth, and give the assistant a clear rule for which one to use.

Two kinds of knowledge, two different jobs

Slow, written knowledge. Return policy, shipping zones, warranty terms, sizing guides, care instructions, "how do gift cards work." This is prose. It is written by people, reviewed rarely, and it answers "how" and "why" questions. Retrieval augmented generation (RAG) is a good fit here because the answer is buried in paragraphs and the user's wording rarely matches the document's wording.

Fast, structured knowledge. Price, inventory, variants, compare at price, shipping eligibility for one product, current promotions. This is data with exact values. It answers "what is it right now" questions. RAG is a poor fit because embeddings capture meaning, not freshness, and a chunk written at index time is already a snapshot.

If you remember one sentence from this post, make it this: prose goes in the index, numbers come from a tool.

What goes in the policy corpus

Build the RAG corpus only from documents that you are happy to have quoted word for word:

  • Return and exchange policy, including exceptions like final sale and personalised items
  • Shipping policy and delivery zones
  • Warranty and repair terms
  • FAQ pages
  • Size and fit guides at the category level
  • Care and usage guides

Leave out product exports, CSV dumps, old PDP snapshots, and marketing pages that mention prices. Those are the usual sources of contamination. If a policy page mentions a specific price ("free shipping over $50"), that is fine, because the threshold is part of the policy itself. A line like "our bestseller is only $39 this week" is not.

Tag every chunk with metadata the retriever can filter on: doc_type: policy, topic: returns, region: US, last_reviewed: 2026-09-01. Region matters more than people expect. A store that ships to the UK and Pakistan may have different return windows, and you do not want the retriever mixing them.

What becomes a live tool

Catalog facts should come from a function the agent calls at answer time. With the Model Context Protocol (MCP), that looks like a small set of read only tools:

  • search_products(query, filters) returns handles, titles, and price ranges
  • get_product(handle) returns variants, prices, availability, and product level flags like final sale
  • check_shipping(handle, country) returns eligibility and estimated delivery

These tools hit your Shopify Storefront API or your own catalog service directly. The answer is as fresh as the source, and you never have to re-embed anything when a price changes.

There is a nice side effect too. Product level exceptions, like "this item is final sale," come back from get_product as a field. The assistant can combine the general return policy (from RAG) with the specific product flag (from the tool) and give a correct answer: "Our standard window is 30 days, but this jacket is marked final sale, so it cannot be returned."

The routing rule

You do not need a fancy classifier to decide which source to use. A clear system prompt plus well named tools gets you most of the way. Something like:

Use the policy search tool for questions about returns, shipping rules, warranties, and how the store works. Use catalog tools for anything about a specific product's price, stock, variants, or eligibility. Never state a price or stock level unless it came from a catalog tool in this conversation.

That last sentence does a lot of work. It gives the model permission to say "let me check" instead of guessing, and it makes violations easy to spot in logs.

When MCP lookup beats RAG

Use a live lookup whenever any of these are true:

  1. The value changes more often than you re-index. Prices, stock, and promos almost always qualify.
  2. The question names a specific item. A SKU, a product name, a link the user pasted.
  3. Being wrong costs money. Quoting a lower price than checkout will charge is a support ticket at best.
  4. The answer is a single value. You do not need semantic search to read a number from a field.

Use RAG when the question is open ended, the answer lives in prose, and the source is stable.

Some questions need both. "Can I get this delivered to Lahore before Friday?" needs the shipping policy (cutoff times, courier rules) and a live check on that product's eligibility. Let the agent call both and merge the results. That is normal and fine.

Keep the corpora from leaking into each other

A few habits stop contamination before it starts:

  • Separate indexes or strict namespaces. Do not rely on a metadata filter alone if a single missing tag lets a product chunk into policy results.
  • An ingestion allowlist. Only documents from specific folders or CMS types get indexed. Product exports are rejected at the door.
  • A price regex check on ingestion. If a chunk contains a currency pattern and is not tagged as policy, flag it for review.
  • Re-index on policy change, not on a timer. Hook your CMS publish event to re-embed only the changed document.

Test it with questions designed to fail

Write a small test set of questions that tempt the assistant to mix sources:

  • "What does the red hoodie cost and can I return it?"
  • "Is shipping free on the leather bag?"
  • "Do you still have the summer sale price on sneakers?"

For each, check two things: the price or stock came from a tool call, and the policy wording matches the current document. Run this set every time you change prompts, tools, or the index. Twenty questions is enough to catch most regressions.

The payoff

Splitting knowledge this way makes the assistant easier to trust and easier to debug. When an answer is wrong, you can tell immediately whether retrieval pulled the wrong policy chunk or the catalog tool returned bad data. You stop re-embedding your catalog every night. And customers stop getting yesterday's price.

If you are building a store assistant on Next.js and want help wiring up a policy RAG pipeline next to a live catalog MCP server, I do this kind of work. You can reach me through the contact section or email me at ahmadraza365pro@gmail.com.

  • 5 min read

    A 30-Day Agentic Commerce Rollout for a Next.js Store

    A practical, week by week plan to make a Next.js store ready for AI shopping agents: clean the data, ship a read only catalog MCP server, add carts, hand off to confirmed checkout, then log and cap everything.

  • 5 min read

    Fraud and Abuse When Agents Shop Your Checkout

    AI shopping agents look a lot like bots, and bots look a lot like agents. Here is how to tell them apart, where to put bot challenges, and why hosted checkout like Shop Pay is your best trust boundary.

  • 4 min read

    Hydrogen SDK vs Calling Storefront API Yourself in 2026

    Shopify's Hydrogen SDK now reaches beyond Remix and React Router into other frameworks. Here is what it gives you for agent ready storefronts, what a thin Next.js client gives you, and when each one pays off.