What Is a RAG Chatbot? Retrieval-Augmented Generation Explained
How a RAG bot works step by step, where it fails, and how to test one on your own data.
A RAG chatbot (retrieval-augmented generation) answers each question in two stages: it first retrieves the most relevant passages from your own data, such as product pages, policies and documents, then has a language model write the reply from those passages only. Because the answer is grounded in retrieved text, it can cite sources, stay current without retraining, and say "I do not know" when nothing relevant exists.
Last updated
Step-by-Step Guide
Gather the sources
Decide what the bot may answer from: the product catalogue, the pages worth crawling, and the policy and FAQ documents. Remove duplicates and outdated files before uploading anything.
Connect the catalogue and crawl the site
Install the platform plugin or paste the script, run the sync and the crawl, then upload PDF, DOC, CSV or Markdown files and import any FAQ spreadsheet.
Write a 50–100 question test set
Pull real questions from chats and email, including short ones, other languages and at least ten the bot should refuse. Note the expected facts for each.
Run the set and score grounding and correctness 0–10
Check that each answer used the right product or page, and that refusals happen when nothing relevant exists. Record every score.
Fix data, not phrasing
For each low score, add the missing fact, correct the conflicting document or rename the unclear product, then re-run the affected questions.
Go live with handover and re-test on every change
Enable human handover for unanswered questions, then re-run the test set after each catalogue sync, new document or settings change, and read low-graded transcripts weekly.
RAG chatbot meaning: how it differs from other chatbots
The word "chatbot" covers three different machines, and the difference explains why RAG exists.
| Type | Where the answer comes from | Strength | Weakness |
|---|---|---|---|
| Rule-based (scripted) bot | A decision tree written by a person | Predictable, cheap | Cannot answer anything the author did not anticipate; brittle with free-text questions |
| Plain LLM bot | Whatever the language model absorbed in training, which ends at its training cut-off and knows nothing about your store | Fluent in any language, handles any phrasing | Invents plausible answers ("hallucination"); cannot know your prices, stock or returns policy |
| RAG chatbot | Passages retrieved from your own data at question time, written up by the language model | Fluent and grounded; updates the moment the data updates; can show its sources | Only as good as retrieval and the data behind it; needs an index and a pipeline |
So "RAG vs chatbot" is not really a contest between two products. RAG is an architecture that turns a general language model into one that answers from a specific body of text. The model itself is not changed; the model is given the right material to read before it answers, every single time.
How a RAG chatbot works, step by step
Every production RAG system does roughly the same nine things. Two of them happen when data changes; the rest happen on every question.
- Ingest sources. Product catalogue (through a platform plugin or feed), website pages (crawl), uploaded files (PDF, DOC, CSV, Markdown), pasted text and FAQ lists. Each source becomes a set of records with metadata such as URL, price, stock and last-updated time.
- Clean and chunk. Navigation, cookie banners and boilerplate are stripped. Long pages are split into chunks small enough to be specific but large enough to keep meaning, typically a few hundred words, with overlap so a sentence at a boundary is not lost.
- Embed. Each chunk is converted into an embedding, a numeric vector that represents its meaning, so that "does it fit a 15-inch laptop" and "compatible with 15" notebooks" land close together.
- Store in a searchable index. Vectors go into a vector index. Good systems also keep a keyword index alongside it and run hybrid search, because semantic search alone is poor at exact tokens like SKUs, model numbers and brand names.
- Retrieve top matches per question. The visitor's question is embedded the same way and compared against the index; the best-scoring chunks, often five to twenty, come back.
- Filter and rank. Structured filters are applied on top of similarity: only products under the stated budget, only items in stock, only this store's data. Results may be re-ranked by a second model or by business signals such as units sold.
- Build the prompt. The retrieved snippets, the conversation so far and the instructions ("answer only from the passages below; if they do not contain the answer, say so") are assembled into a prompt for the language model.
- Generate. The model writes the reply in the visitor's language. Its job is phrasing, not knowledge; the knowledge is in the snippets.
- Show sources or product cards. The reply is returned with the products or pages it drew on, as cards with image, price and link, or as citations, so the visitor and the merchant can check it.
Steps 1 to 4 run when the catalogue or a document changes; steps 5 to 9 run in a second or two for each message.
Why RAG beats fine-tuning for a store
Fine-tuning means further training a language model on your own text so that its weights absorb it. It sounds like the more thorough approach. For a store it is almost always the wrong one.
| Question | Fine-tuning | RAG |
|---|---|---|
| Price changes at 09:00; when does the bot know? | After the next training run, which may be days or weeks away | After the next sync, typically minutes |
| Cost of adding 500 products | A new training job each time | Embedding 500 records, a routine background task |
| Can you see why it answered that? | No; the knowledge is diffused through the weights | Yes; the retrieved snippets are logged with the answer |
| Can you delete a discontinued product? | Not reliably without retraining | Remove it from the index and it is gone |
| Does it stop the model guessing? | No; a fine-tuned model still hallucinates, now with your brand voice | Largely, if the prompt forbids answers outside the retrieved text |
| Multi-store isolation | One model per store, expensive | One index with a store filter, or one index per store |
Fine-tuning has a real use: teaching a model a tone, a format or a specialised vocabulary. It is a poor way to store facts that change. For facts, retrieval wins on freshness, cost, auditability and the ability to forget.
Where RAG chatbots fail
RAG reduces hallucination; it does not make a bot correct by default. These are the failure modes you should ask any vendor about, and test for yourself.
- Poor chunking. If a product's price ends up in a different chunk from its name, the bot retrieves the name and invents the price. Fix: chunk by record (one product, one policy clause) with metadata attached, not by fixed character count alone.
- Stale index. The sale ended on Sunday; the index still says 20% off on Tuesday. Fix: sync on change, and put the last-sync time where the merchant can see it.
- Retrieval misses on very short queries. "Blue?" or a bare model number gives an embedding little to work with. Fix: hybrid keyword search, using the conversation history to expand the query, and asking a clarifying question instead of guessing.
- Answering when nothing relevant was retrieved. The most damaging failure. The retrieved chunks are off-topic, the model answers anyway from general knowledge, and the visitor is told a returns window that does not exist. Fix: a relevance threshold, and a prompt rule that forces "I do not know, would you like to speak to someone?" when nothing passes it.
- Wrong-store data leaks. On a multi-tenant platform with weak isolation, a query on one store can retrieve another store's products. Fix: a hard store filter enforced at the index level on every query, not a soft instruction in the prompt.
- Over-long context. Stuffing 40 chunks into the prompt makes the model pick the wrong one and costs more. Fix: retrieve more, re-rank, pass fewer.
- Language mismatch. The visitor asks in Greek, the index is in English. Fix: multilingual embeddings so meaning matches across languages, and generation in the visitor's language.
None of these are exotic. They are the difference between a demo and a bot you can leave alone with customers.
How to evaluate a RAG chatbot before you trust it
Do not judge a RAG bot on five demo questions. Build a small test set and score it the same way every time.
- Collect 50 to 100 real questions. Take them from chat logs, support email and search queries on the site. Include short ones, misspelled ones, ones in other languages, and at least ten the bot should refuse because the answer is not in your data.
- Write the expected answer for each, or at least the facts it must contain and the facts it must not invent.
- Run every question and score two things 0–10: grounding (did the answer come only from your data, with the right product or page attached?) and correctness (is it right?). A fluent, wrong answer scores 0 on correctness however good it sounds.
- Check the refusals. The ten unanswerable questions should produce "I do not know" or a handover, not a guess. A bot that scores 9 on the answerable set and invents answers for the unanswerable set is not ready.
- Re-run after every knowledge change. A new catalogue sync, a new policy document or a prompt tweak can silently break a question that used to pass. Keep the scores in a sheet and compare.
- Read low-scoring transcripts weekly in production. Real visitors phrase things you did not think of. Each low score is either missing data or a retrieval gap, and both are fixable.
A platform that grades conversations for you speeds this up but does not replace your own test set; you know which answers are wrong, the grader only knows which look unsupported.
Data-hygiene checklist for a RAG knowledge base
Most RAG problems are data problems. Before blaming retrieval, run through this list:
- One source of truth per fact. If the returns window appears in three documents with three numbers, the bot will pick one at random. Delete or correct the extras.
- Product titles that mean something. "Item 4471" retrieves badly; "Oak dining table 180 cm, seats 6" retrieves well.
- Prices, stock and variants come from the catalogue sync, never from a pasted PDF that will go stale.
- Policies as clean text or a document, not a screenshot. Image-only PDFs have nothing to embed.
- Remove discontinued products from the index, not just from the storefront menu.
- Keep FAQs short and one question per entry; a 40-question FAQ page as a single chunk answers nothing well.
- Date-stamp promotions inside the text ("valid until 30 November 2026") so the model can see they have ended even if the sync is late.
- Check what the crawler actually captured: cookie banners, menus and footers crowd out the content if they are not stripped.
- Re-test the 50–100 question set after each clean-up.
The guide to training a chatbot on your data goes through source types and file formats in more detail.
RAG vs "trained on your data" marketing
Almost every chatbot vendor now says its bot is "trained on your data". In nearly all cases this means RAG, not fine-tuning: your content is indexed and retrieved at question time, and the underlying model is a general one from OpenAI or another model provider. That is the right design for a store, so the phrase is not dishonest, but it hides the questions that actually separate products. Ask any vendor:
- Is retrieval semantic only, or hybrid with keyword search? (SKUs and model numbers need keywords.)
- How is the product catalogue kept current: a native plugin sync, a feed, or a periodic crawl?
- Can the bot apply filters such as price and stock, or only text similarity?
- What happens when nothing relevant is retrieved? Ask for a demo of the bot refusing.
- Is store data isolated at the index level?
- Are the retrieved sources shown to the visitor, and logged for you?
- Which model generates the answer, and is your data used to train it? (Look for API use with no training on your content.)
- How can you test it: is there a way to run your own question set and see scores?
Chatbase, Botpress, Tidio's Lyro, Intercom's Fin and Vatdi all answer these differently; the pricing units differ too, from flat plans to per-resolution fees. Comparing the answers tells you more than the phrase on the homepage. For a broader comparison see the best AI chatbots for e-commerce.
How Vatdi implements RAG
For transparency, this is how the pipeline above maps onto Vatdi, stated plainly.
- Ingest: native catalogue sync through plugins for WooCommerce, OpenCart 3 and 4, PrestaShop, Magento 2, Shopware 6, Joomla and Drupal Commerce; website crawl and pasted URLs; PDF, DOC, DOCX, CSV, TXT and Markdown uploads up to 10 MB each; manual text; FAQ import from CSV or Excel. On Shopify the app indexes pages, collections and policies plus the dashboard knowledge base.
- Retrieve: hybrid search, vector plus keyword, over the store's own content; catalogue results carry price, sale price and stock so the answer and the cards reflect them.
- Generate: OpenAI GPT-4o-mini writes the reply from the retrieved snippets in the visitor's language (95+ languages, auto-detected). Requests go to OpenAI via API and are not used to train models.
- Show sources: product cards with image, price, sale price while a sale is on, link and optional stock.
- Refuse when unsupported: when retrieval finds nothing relevant the bot says it does not know and can offer a human, rather than guessing.
- Isolation: per-store data isolation, credentials encrypted at rest, details on the trust page.
- Evaluation: every conversation is graded 0–10 with plain-English advice on what to fix, and per-answer thumbs and a 1–5 visitor rating feed the same reports.
Limits that matter for RAG: knowledge items are capped at 100 on Free, 500 on Starter and unlimited on Grow; synced products at 200, 2,000 and 10,000. Every plan has the full pipeline; see pricing and features. Vatdi does not offer an API or webhooks, so it is a hosted RAG chatbot for a website, not a framework for building your own.
Key Benefits
Answer product questions from the live catalogue, with price and link attached
Quote shipping, returns and warranty terms from the documents you actually publish
Update the bot by updating the data, with no retraining step
Say "I do not know" instead of inventing a policy
See which products and pages an answer drew on, in the cards the visitor is shown
Frequently Asked Questions
A RAG chatbot is a chatbot built on retrieval-augmented generation. For every question it first retrieves the most relevant passages from a specific body of data, such as a store's products, pages and policies, and then a language model writes the answer from those passages. It combines the fluency of a language model with facts that are current and traceable.
RAG stands for retrieval-augmented generation. Retrieval is the search step that finds relevant text in your data; generation is the language model writing a reply; augmented means the generation is supplied with the retrieved text rather than relying on what the model memorised in training. The phrase describes the architecture, not a product.
A general assistant answers from what its model learned during training, which ends at a cut-off date and knows nothing about your store. A RAG chatbot uses a similar model but feeds it passages retrieved from your own data on every question, so it can quote your current prices and policies, show sources, and decline when the answer is not in your data.
No. Fine-tuning retrains a model so your text is absorbed into its weights; it is slow to update, hard to audit and does not stop guessing. RAG leaves the model unchanged and retrieves your text at question time, so a price change is live after the next sync and every answer can be traced to its source. For changing facts, RAG is the better fit.
Less than a plain language model, but it can. The main risks are retrieving the wrong passage, answering from stale data, or answering when nothing relevant was retrieved. A well-built RAG bot applies a relevance threshold and refuses when unsupported. Test it with questions whose answers are not in your data and check that it says it does not know.
A hosted service that runs the whole pipeline for you: ingesting your catalogue and documents, chunking and indexing them, retrieving per question, generating the reply and showing sources, usually as a website widget. Vatdi, Chatbase and Botpress are examples with different pricing and focus; Vatdi is aimed at online stores with native catalogue plugins and human handover.
Yes, with a hosted platform. You connect the store through a plugin or one-line script, crawl the site, upload documents and test. Building your own from components is a developer project involving an embedding model, a vector index, a retrieval layer and prompt design, which is worthwhile only if you need behaviour a platform does not offer.
Less than people expect. A synced catalogue plus your shipping, returns and warranty pages covers most store questions. Quality matters more than volume: one correct returns policy beats three conflicting ones. Vatdi allows 100 knowledge items and 200 synced products on the Free plan, 500 and 2,000 on Starter, and unlimited items with 10,000 products on Grow.
Test a RAG chatbot on your own catalogue
Sync your store on the Free plan, ask it your 50 hardest questions and read the retrieved sources for yourself.