Retrieval-Augmented Generation (RAG)
A model's knowledge is frozen at the end of training, and it has no idea which parts of it are reliable. Retrieval-augmented generation sidesteps both problems by looking things up: fetch relevant passages at question time, put them in the prompt, and ask the model to answer from them.
The loopDocuments are chunked, embedded and indexed ahead of time. When a question arrives it is searched against that index, the best chunks are placed in the prompt above the question, and the model answers with the evidence in front of it. Nothing about the weights changes — the knowledge lives in the index, which is why correcting a stale policy document is a re-index rather than a training run.
What it fixes, and what it does not- Private and recent knowledge becomes usable without fine-tuning, and the answer can cite the chunk it came from.
- Hallucination drops but does not vanish: a model handed irrelevant passages will still fabricate, and a model handed contradictory ones will pick one.
- The failure mode moves upstream. Most bad RAG answers are retrieval misses rather than generation errors, which makes chunking and search quality the real levers.
The pattern was named in a 2020 paper that trained retriever and generator together; what shipped instead is the simpler version anyone can build with a vector store and an API call — LlamaIndex or LangChain over Faiss or Pinecone. It remains the default way to point a general-purpose model at knowledge it was never trained on.
Retrieval-augmented generation answers a question by first retrieving relevant passages from an external index and placing them in the model's prompt, so the response is grounded in fetched evidence rather than in frozen training weights. It gives a model access to private, proprietary or recent knowledge without fine-tuning, and makes citation possible. Accuracy then depends on retrieval quality: passages that miss the point produce confident, well-sourced-looking errors.
Picture a very well-read friend who answers from memory — brilliant, but sometimes out of date and sometimes just misremembering. Now hand them the actual document before they answer. That is retrieval-augmented generation. The system searches a collection of files — your company handbook, a product manual, last week's news — picks the few passages that look relevant, and shows them to the AI along with your question. The answer then comes from what it just read, not only from what it absorbed during training. That is why it can tell you about things that happened after it was built, and point at where it got the answer.