Home Learn Class 9
Classes 4–12 · Digital literacy and AI

What is RAG? Fetch first, then answer

RAG stands for retrieval-augmented generation, which is a terrible name for a simple idea: <b>look it up first, then answer.</b> It is the single most effective fix for AI making things up, and it is not a cleverer model — it is a filing cabinet next to the desk.

The problem it solves

A model has no facts inside it that you can look up, so asked about something specific it produces something plausible instead.

Ask it about a book that does not exist and it invents the book. Ask it about your school's timetable and it invents a timetable.

What RAG actually does

Before answering, the system searches a real source — a document, a database, a catalogue, the web — and puts the relevant page into the context window.

Then the model answers from that page, which is now on the desk.

Same model. Same question. Completely different answer, because this time there was something real to read.

Why it matters to a student

You already do RAG by hand every time you paste your notes into the chat before asking a revision question. That is the whole technique.

It is also why an AI that can search the web gives better factual answers than one that cannot — not because it is smarter, but because it fetched.

The same question, twice

Asked with nothing attached"A 2016 debut novel set in coastal Karnataka…"
Is any of that true?No — the book does not exist
Catalogue searched first0 results for that title or author
Asked again, with the page on the desk"I do not think this book exists."

Thirty seconds apart, same model. The only thing that changed was whether it looked before it spoke.

Practice

Your AI keeps giving general answers instead of your syllabus. Fix?
Show the answer
Give it your actual notes to read.
Your syllabus is not inside it and never will be. It can only answer from your syllabus if your syllabus is on the desk.
Is RAG a different kind of AI?
Show the answer
No.
It is the same model with a search step bolted on in front. Nothing about the model changes.
Does RAG completely stop hallucination?
Show the answer
No, but it hugely reduces it.
If the retrieved page is wrong or irrelevant, the answer can still be wrong. Garbage in front, garbage out.

See the before and after

In our free course you get the invented answer first, then open the cabinet and ask again. The two answers sit side by side.

▶ Play Lemonade Empire free

Common questions

Do I need to build anything to use RAG?
No. Pasting the relevant document into the chat before you ask is RAG done by hand, and it works.
Why do companies build RAG systems then?
To do that pasting automatically, at scale, across thousands of documents nobody has time to find by hand.

Next concepts