Glossary

What is Retrieval-augmented generation (RAG)?

Updated By Reviewed by Kashif Khan, Founder

Retrieval augmented generation (RAG) is a method where an AI system first retrieves relevant passages from a document collection or the web, then has a language model write its answer from them. That lets the answer use current facts and cite them, and it's the pattern behind AI search answers and most store support ch

Retrieval augmented generation (RAG) is a method where an AI system first retrieves relevant passages from a document collection or the web, then has a language model write its answer from them. That lets the answer use current facts and cite them, and most AI search answers work this way.

How does retrieval augmented generation work, step by step?

Retrieve first, then write. The method was named in a paper by Lewis and colleagues first posted on 22 May 2020, who combined a language model’s built-in “parametric” memory with a “non-parametric” memory: in their case, a searchable index of Wikipedia (arXiv 2005.11401).

Retrieval augmented generation steps: question, retrieve passages, model writes from them, answer with citations

The paper’s motivation still describes the problem: plain language models struggle with “providing provenance for their decisions and updating their world knowledge”. Retrieval fixes both, because the facts come from documents you can point to and update. Today’s AI search tools apply retrieval augmented generation to the live web; Google’s Gemini API, for example, offers grounding that “connects the Gemini model to real-time web content” (Gemini API docs).

What did our retrieval test show?

That the retrieval step decides everything that follows. We ran it on our own text on 17 October 2026: 345 passages from 28 of our glossary pages, 5 real buyer questions, ranked with BM25, a standard keyword-matching formula.

Retrieval augmented generation test: the right passage ranked first for 3 of 5 questions; for 2 it ranked second or third

For 3 questions the right passage came first. For the other 2 the right page appeared only at #2 or #3, because the answering passage didn’t use the question’s words: it said “match the request’s IP address” where the question asked how to “check a visit”. A model given the top passage would have answered from the wrong one. Real systems use better retrievers, but the lesson carries over to any rag pipeline: write answers in the words people ask with.

When is RAG better than fine-tuning?

When the facts change or need a source. Fine-tuning adjusts the model itself, so its knowledge is fixed until you train again; retrieval looks facts up each time and can cite them.

Retrieval augmented generation vs fine-tuning: RAG looks facts up at answer time and can cite them; fine-tuning changes the model and can't

Google puts the cut-off problem plainly: grounding lets Gemini “cite verifiable sources beyond its knowledge cutoff”. A model trained months ago can’t know about a sale you started on 17 October 2026; a retrieval step can read it from the live page within seconds.

For a store, prices, stock, delivery times and policies change too often to train into a model, which is why support bots and AI search both retrieve. Fine-tuning suits tone and format, not facts. A useful test: if a fact could change in the next 30 days, it belongs in a document the system retrieves, not in training.

Where does a store meet RAG?

In 2 places: AI search engines that retrieve your pages to answer shoppers, and any chatbot or assistant that answers from your own help pages and catalogue. In both, the retrieval step reads your text as passages.

It also matters for anyone using AI to write. Google’s ML Crash Course says that LLMs hallucinate, “meaning their predictions often contain mistakes”. Drafting these pages, our source checks caught 5 confident but wrong statements in 18 drafts before publishing. Retrieval helps a model, and checking against sources still matters. Our AI consulting team scopes RAG assistants for stores; for the search side, see generative engine optimization and the AI search optimization hub.

Back to the glossary

Free growth audit

Find out what’s holding your store back.

Tell us about your store. We’ll review your tracking, campaigns and SEO and send you a written audit with the top fixes, ranked by impact.

  • Written audit as a PDF, delivered within 2 workdays (see a sample)
  • A video meeting to go through it, if you want to discuss next steps
  • Free and no obligation
  • Read-only access or screenshots are enough

Free audit
Chat on WhatsApp