What is RAG?
Retrieval-augmented generation, told as a story about a librarian who finds the right page and puts it on the tray before the parrot answers.
The guest asks about our company refund rule. The parrot never read that rulebook.Yet it answers plausibly — it is the plausible parrot.
Our rule is not in its books. And drilling new facts in barely works.The short drill is for manners, not new facts. And you can't re-drill every time a rule changes.
RAG: before the parrot answers, the librarian finds the relevant page and puts it on the tray.The parrot is never retrained. Each time, a page goes on the tray with the words answer from this. That way it can cite its source too.
The question becomes a tag, and a few near pages travel from the shelf to the tray.The tag is the coordinate tag; the shelf is the shelf organized by tags. The tray holds only so many beans, so just a few pages go on.
If the librarian brings the wrong page, the parrot answers wrongly. And a page bigger than the tray must be cut down.Search quality is answer quality. And the page has to fit the tray. The answer can still be wrong, so check the source — the plausible parrot never fully goes away.
RAG = before the parrot answers, the librarian finds the relevant page and puts it on the tray. No retraining, yet it answers from our books and can cite sources. If the librarian finds the wrong page, the answer is wrong too.
The question is embedded, a retriever pulls related chunks from a vector DB, a reranker orders them, and they go into the context window so the LLM answers from that evidence. Unlike fine-tuning, knowledge lives outside the model, so it is easy to update and can be cited. Retrieval quality and chunking decide answer quality; hallucination drops but never vanishes.
When grown-ups say it
- RAG
- The page the librarian brought. Retrieval-augmented generation: find it, put it on the tray, then answer.
- Retriever
- The librarian. The part that takes the question tag and pulls near pages from the shelf.
- Chunking
- Cutting the book into pages. Pre-cut to tray size before shelving. Too big won't fit; too small loses the surrounding context.
- Reranking
- Re-ordering the pages found. Pull 10 from the shelf, re-sort by true relevance, put only 3 on the tray.
- Citation
- The source attached to the answer. It says which page it came from, so the guest can check.
- Context window
- The tray. Where the found pages go. It has a fixed size. → the tray in front of the parrot
- vs. fine-tuning
- The drill is manners; RAG is knowledge. New facts go on the tray; tone gets fixed by drilling. → the short drill
- Hallucination
- The plausible lie. Giving it the page reduces it but never removes it. → the plausible parrot