All posts

What is RAG? Retrieval-augmented generation in plain English

What is RAG? Retrieval-augmented generation explained without the math: how a chatbot answers from your content instead of guessing.

AI that doesn't make things up7 min read
Retrieval, Not Guessing - a hand pulling one glowing document out of a card index

I design interfaces for a living, so I came to this question sideways. When we started building an AI support product, my honest answer to "what is RAG" was a shrug performed with confidence. Every explanation I found was either a vendor diagram with fourteen arrows or a paper with math in it. This is the explanation I wanted at the time: what retrieval-augmented generation is, what problem it solves, and how to tell the real thing from a sticker on a pricing page. No math. One metaphor, used carefully.

The problem: the model has never met your business

A large language model has read a very large slice of the internet. It can explain photosynthesis, write a passable limerick, and summarize the plot of a film it has technically never seen. It knows nothing about your return window, your shipping cutoff, or the fact that your warehouse closes over midsummer.

Ask it about returns on sale items and it will answer from the average of every returns page it has ever read. The average returns page is not your returns page.

And when a language model does not know something, it does not go quiet. It guesses, fluently, in the same calm tone it uses when it is right. That tone is the dangerous part. A support bot guessing about your policies is writing fiction with your logo on it, and I wrote a separate post on why that happens.

Two fixes look obvious and are not. You could paste your entire site into every prompt, but prompts have size limits, cost scales with length, and models get worse at spotting the one relevant line in a very long prompt. Or you could retrain the model on your content, which is slow, expensive, and stale by the next site update. Retrieval-augmented generation is the third option, and it is the one that stuck.

Retrieval-augmented generation in one sentence

Before answering, the system looks up the relevant parts of your content and hands them to the model with instructions to answer only from them.

That is the whole idea. Retrieval: look it up. Augmented: put what you found into the prompt. Generation: write the answer from it.

The overlooked word is augmented. The model stops being consulted as an authority on your business and gets used as a writer instead: handed source material, asked to stay inside it. That demotion is the entire trick.

Here is the one metaphor. A plain chatbot takes a closed-book exam about your business, having never attended the class. A RAG chatbot takes an open-book exam. The book is your content, the relevant pages are bookmarked before each question, and the good ones cite the page they used.

Split panel: a closed book exam answered confidently from memory, next to an open book exam with the relevant page bookmarked and cited
Same model. Different exam.

The pipeline, in plain words

Two phases. Preparation happens once, and again whenever your content changes. Answering happens on every question.

Preparation:

  1. Your content gets split into chunks, a few paragraphs each. One about the refund window, one about shipping to Norway, one about the sizing chart. Good systems keep each chunk attached to its headings, so a paragraph about sale items remembers it lives under "Returns". Chunk size is a real design decision: too small and answers lose their context, too large and retrieval gets blurry.
  2. Each chunk becomes an embedding: a long list of numbers that encodes what the chunk means. The useful property is that texts about the same idea land near each other numerically. "Refund", "money back", and "can I get reimbursed" all end up in the same neighborhood, whatever the wording.
  3. The chunks and their embeddings go into a database built for finding nearest neighbors quickly.

The way I hold this in my head: embeddings turn your content into a map. Every chunk gets coordinates, and the neighborhoods are meanings. Returns over here, shipping over there, sizing two blocks down.

Answering:

  1. The visitor's question gets embedded too. Same map, new pin.
  2. The system fetches the chunks closest to that pin, typically a handful.
  3. The model receives the question, the fetched chunks, and an instruction that amounts to: answer from these, and if these do not contain the answer, say so.
  4. The answer comes back with citations, so anyone can see which chunks produced it.

Run one through. A visitor types "can I send back sale items?" The question lands as a pin near your returns chunks. The sale-items paragraph comes back first, helped by the attached heading path that says it belongs to the returns policy. The model gets that paragraph and writes two sentences quoting your fourteen-day window, citing the page. At no point did anything rely on the model's memory of how returns usually work.

Pipeline diagram: pages split into chunks, chunks placed as pins on a meaning map, a question pin landing near the refund cluster, retrieved chunks feeding a model that outputs a cited answer
Content becomes a map. Questions become pins. Answers come from the nearest neighborhood.

Why retrieval beats fine-tuning for support

The other approach people ask about is fine-tuning: training the model further on your data so the knowledge lives inside it. For support content, retrieval wins on the things you feel weekly.

Updates are instant. Change the shipping page, re-index it, and the next answer reflects it. Fine-tuning means a training run every time your prices change, which in practice means nobody does it.

Answers are auditable. With retrieval, an answer traces back to specific chunks of specific pages. With fine-tuned knowledge baked into model weights, there is no receipt. When the bot says something odd, you cannot ask where that came from.

Your content stays yours. Chunks in a database can be inspected, replaced, and deleted. Knowledge folded into a model's weights effectively cannot. That difference gets practical fast: when someone asks what the bot knows about a topic, or asks you to remove something, a database has an answer. A model that absorbed your data into its weights has nothing to point at.

The honest tradeoff: RAG adds moving parts. Chunking decisions, retrieval quality, similarity thresholds. Each one can fail, which is the next section. Fine-tuning still has real uses, mostly tone and narrow output formats. For "answer questions from my docs", retrieval is the right tool.

Where RAG still fails

Three failure modes cover most of it.

The answer is not in the content. Retrieval always returns the nearest chunks, but nearest does not mean near. If nobody ever wrote down the warranty terms, no amount of searching finds them. A careless system answers anyway, from the model's general memory. A good one scores how close the best matches actually are and refuses below a threshold: I do not have that information, want me to get a person? A refusal that routes somewhere useful beats an invention every time.

Retrieval misses. The answer exists but the wrong chunks come back, usually because the question is phrased far from the document's wording, or because chunking cut a sentence off from the context that made it meaningful. Good systems over-fetch and rerank (grab twenty candidates, then have a second pass pick the best five) and keep heading context attached to every chunk. How your content gets split matters more than people expect; there is a full post on the indexing side.

The content is stale. RAG is faithful to your content, including content that is wrong. If the shipping page still lists last year's prices, the bot will cite it, accurately and confidently. The fix is boring: re-crawl on a schedule, skip pages that have not changed, and treat the knowledge base as a product surface rather than a one-time import. (Hey Support does this on a schedule and skips unchanged pages, so freshness does not depend on anyone remembering.)

A chat answer about a return window with two small source citations underneath, one pointing to the returns policy page and one to the FAQ
A cited answer is an auditable answer.

How to tell if a chatbot actually uses RAG

"Powered by RAG" appears on a lot of pricing pages now. Three tells separate the real thing from the sticker, and you can test all three in any free trial.

Citations. Every substantive answer should show its sources. If you cannot see where an answer came from, treat it as improvised.

Refusals. Ask something your content genuinely does not cover. A grounded bot says it does not know and offers a way forward. A bot that always has an answer is a bot that guesses.

Freshness. Change a page, then ask about it. How fast, and by what mechanism, does the answer change?

A fourth check costs nothing: ask the vendor what happens when retrieval finds nothing at all. If the answer involves the model's general knowledge filling in, the sticker is doing a lot of work.

For what it's worth, this is how we built Hey Support: every answer cites its sources, questions below the similarity bar get an honest refusal plus a handoff, and any link the bot shares has to exist in your indexed content. The wider machinery is on the features page.

RAG is the difference between a bot that represents your business and one that improvises about it. The concept fits in one sentence; the craft is in the thresholds, the refusals, and the freshness. If you would rather poke at one than read another diagram, you can set one up free on your own content and interrogate it. Start with a question your site does not answer, and watch what it does with nothing.

Frequently asked questions

Is RAG the same as fine-tuning?

No. Fine-tuning changes a model's internal weights through training runs. RAG leaves the model alone and hands it your content at answer time, which makes updates instant and every answer traceable to a source.

Does RAG stop hallucinations completely?

No, it narrows them. A model can still misread a retrieved passage or answer when retrieval found nothing relevant, so good systems add similarity thresholds, citations, and an explicit refusal when the content does not cover the question.

What are embeddings?

Embeddings are lists of numbers that encode what a piece of text means, so texts about the same idea end up numerically close together. They are how a question about getting money back finds your refund policy even though the wording is different.

Do I need RAG for a support chatbot?

If the bot must answer from your policies, docs, or catalog, then yes, retrieval in some form is the standard way to do it. Without it you are relying on a general model's memory of the internet, which does not include your business.

Written by
HA
Hampus

Design at Hey Support. Owns the widget and the details nobody notices until they are wrong.

Your customers are asking questions right now. Give them answers worth reading.

No credit card · Live in a day · Cancel any time