Skip to content

Stockertim Dictionary · Artificial intelligence · Technology

Retrieval-augmented generation

Also called RAG, retrieval augmented generation

In short

Retrieval-augmented generation is a system design in which relevant documents are first searched for and fetched, then given to the model with the question so its answer can draw on them.

  • Intermediate
  • Technology
  • Checked

In detail

Retrieval-augmented generation, often shortened to RAG, joins a search step to a language model. When a question arrives, the system first searches a chosen collection, such as policies, product manuals or past cases, for the passages most likely to be relevant. Those passages are placed into the prompt alongside the question, and the model is instructed to answer from them, usually with references.

The search step often uses embeddings, lists of numbers that capture meaning, so that a question about annual leave can find a passage about holiday entitlement even though the words differ. Keyword search is sometimes combined with it. Because only the most relevant passages are supplied, the approach works with document collections far larger than any context window.

RAG makes answers more current and specific, but it brings its own failure points. If the search returns the wrong passages, the answer is grounded in the wrong material. Outdated or duplicate documents in the collection produce outdated answers. Access rights must carry through, so that a user cannot retrieve documents they are not allowed to see.

Worked example

Lagoon Logistics builds an internal assistant over 2,000 policy documents.

  1. A staff member asks how long damaged-goods claims stay open.
  2. The search step finds the three most relevant passages, including section 7 of the claims policy.
  3. The model answers from those passages and cites section 7, and the staff member checks the cited text.
  4. A later audit finds an outdated copy of the policy in the collection, which is removed so it can no longer be retrieved.

Answers cite current company documents, and keeping the collection clean becomes part of the process.

In practice

Organisations use RAG for internal help desks, customer support, research over reports and policy questions, with owners for the document collection and checks on what is retrieved.

Watch out

  • RAG does not make answers correct; it makes them traceable to whatever was retrieved.
  • Retrieval must respect permissions, or the assistant can leak documents to the wrong people.

Learn it properly

Official sources

Facts last checked on 3 November 2026.

Education, not advice: the Stockertim Dictionary explains what terms mean. It never recommends buying or selling anything.

English