Free guide

RAG explained simply: how an assistant answers from your documents

RAG, explained simply, is a way of letting an AI assistant look things up in your documents before it answers, instead of relying on what it memorised in training. It finds the most relevant passages, puts them in front of the model and asks it to answer from them. That's why it suits facts that change, and why it still needs checking.

Verified 27 Sep 2026 3 live tool facts · How this is maintained


Ask a general chatbot about your company's parental leave policy and it will answer confidently, from a blend of every policy it saw in training. Ask a system built with RAG and it will look up your actual policy first, then answer from that. The difference is the difference between a well-read stranger and a colleague with the handbook open on the desk.

RAG explained simply

RAG, short for retrieval-augmented generation, explained simply: before the model answers, a search step finds the passages in your documents most likely to hold the answer, and those passages are handed to the model along with your question. The model then writes its answer from what it was given, ideally citing where each part came from.

A language model on its own only knows what was in its training data, up to its knowledge cutoff. It doesn't know your handbook, last month's price list or yesterday's board minutes. RAG fixes that without retraining the model.

Step one: your documents are cut into pieces

Before anyone asks a question, the system prepares the documents. Long files are split into smaller passages, called chunks: a few paragraphs each, or a section under one heading. Picture an HR team in Leicester loading their staff handbook, leave policies and expenses rules. Each document becomes dozens of chunks.

What you'd see: usually nothing. This happens when files are uploaded or the collection is set up. Chunking matters more than it looks. A chunk that splits a rule from its exception can produce an answer that's half right.

Step two: each piece is turned into a searchable fingerprint

Each chunk is converted into an embedding, a long list of numbers that captures what the passage is about. Passages about similar things get similar numbers, even when they use different words. "Maternity leave" and "time off after having a baby" end up close together.

The embeddings go into an index, often a vector database. What you'd see: still nothing, unless you're the one building it.

Step three: you ask a question

Now the visible part. Someone in the Leicester team types: "Can I carry over unused holiday into next year?" The question is turned into an embedding too.

Step four: the system finds the closest passages

The system compares the question's embedding with every chunk's and picks the closest few. This is semantic search: matching on meaning rather than exact words. Many systems combine it with ordinary keyword search, because a policy number or a product code is better found by exact match.

What you'd see: in a good tool, a list of sources or highlighted passages alongside the answer.

Step five: the passages go into the prompt

The retrieved chunks are placed into the model's context window, with an instruction along the lines of "answer using only the passages below". The model doesn't search anything itself; it reads what it's handed. Understanding context windows explains why there's a limit on how much can go in.

Step six: the model answers, with citations

The model writes an answer from the passages and, if the tool supports it, cites which passage supports which sentence. This is called grounding: tying an answer to a source.

Step seven: you check it

RAG makes checking possible, not unnecessary. Open the cited passage and read it. Did the answer reflect it, including any exception? If no passage was cited, assume the model answered from memory.

Answer only from the documents I've uploaded. For every statement, quote the sentence it comes from and give the document name and section. If the documents don't answer the question, say so plainly instead of answering from general knowledge.

Two tools that show the pattern

You've probably used RAG already. Gemini Notebook answers from documents you upload. Its strength: Answers and audio overviews built only from your own documents✓. Its catch: It only knows what you upload, and the free plan limits sources per notebook✓. Perplexity does something similar over the web rather than your files, retrieving pages and citing them. Its catch is worth remembering for every RAG tool: Cited answers can still be wrong: open the sources✓.

Why RAG beats fine-tuning when facts change

Fine-tuning is the other way to give a model your knowledge: further training on your own examples so the knowledge lives inside the model. It's good for teaching a style or a format. For facts that change, it's the harder route.

RAGFine-tuning
Where your facts liveIn documents, looked up at question timeInside the model, from training
Updating a factReplace the document; re-indexTrain again
Showing a sourceNatural: it cites the passageHard: the fact has no address
Removing somethingDelete the documentVery difficult to make a model forget
Best forPolicies, prices, procedures, anything that movesTone, format, a specialised task
Typical effortModerate, mostly in preparing documentsHigher, and needs training data

If your expenses rate changes, a RAG system needs one updated document. A fine-tuned model would keep giving the old rate until someone retrained it, and might blend the two. Small versus large AI models shows how a smaller model plus retrieval can sometimes match a much bigger one.

Where RAG goes wrong

Learning the ideas behind it

On Teach me AI, the released modules closest to this are How large language models work, on the machinery RAG builds on, and Checking AI's work, on the habit in step seven. The glossary has a plain page for each term used here. Teach me AI's own Ask box shows the pattern from a user's side: it answers only from the site's checked content, cites where each answer came from, and declines off-topic questions. AI answers with citations describes how that looks.

Who this won't help: if you're building a RAG system for your organisation, you need engineering guidance on security and access as well as the concepts.

Common questions

What does RAG stand for?

Retrieval-augmented generation. Retrieval means finding relevant passages in a set of documents. Augmented means adding them to what the model is given. Generation is the model writing its answer. Put together, the model writes an answer with the right material in front of it.

Is uploading a file to a chat assistant the same as RAG?

It's closely related. When a document is short, many assistants simply put the whole thing in the model's context window. For long documents or large collections, tools typically retrieve only the relevant parts, which is RAG proper. From your side the habits are the same: ask for the source passage and check it.

Does RAG stop AI from making things up?

It reduces the problem but doesn't remove it. The model can still misread a passage, blend two passages into something neither says, or answer from memory when retrieval found nothing useful. Ask for quotes and page references, and treat an answer with no source as unchecked.

Do I need to be technical to use RAG at work?

No, to use a tool built on it. Several assistants let you upload documents and ask questions about them. Building your own system over a company's files is a technical project, with decisions about access, security and keeping the index up to date, so involve your IT team.

Go deeper

Modules that teach this properly

More on this

Practical AI skills

Every guide on this topic →

Next step

Find out where you actually stand

A short placement assessment scores you across five skill areas and builds a path through our 18 released modules, skipping whatever you already know. No card needed.

Find your level
When this changes

The facts on this page are re-checked on a schedule. One email a month says what moved in AI tools and the rules, and what it means for you.

Once a month. We’ll email you a link to confirm, and every issue has a one-click unsubscribe. How we use your address.