Retrieval-augmented generation

Also called RAG

Fetching relevant passages from documents or the web first, then having the model answer from them.

Instead of relying on what a model learned in training, retrieval-augmented generation (RAG) looks things up first. The question is used to search a set of documents (a company's policies, a product manual, the web), the best-matching passages are added to the prompt, and the model writes its answer from them, ideally saying which passage it used.

It's how most "chat with your documents" tools work, and why they can answer about things the model never saw. Many of its failures are retrieval failures: if the search pulls the wrong passage, or misses the right one, the model answers fluently from the wrong material.

For example

A shop's support bot answers "can I return opened headphones?" by first pulling the paragraph of the returns policy about opened items, then summarising it.

WITH PLUS

Put it to use

Where you'll meet retrieval-augmented generation in ChatGPT, Gemini and Claude, how to use it there, and the mix-up most people make.

Daily Bytes Plus is in the Android app.