Skip to content
BENIBIX Learn

Retrieval-Augmented Generation (RAG)

Also known as RAG, Retrieval Augmented Generation

First find the right pages, then let the model answer from them.

Think of it like

Think of it like an open-book test. You look up the right page, then you write the answer.

Example

Lucy's company bot gets 'How many days of leave do I get?'. It finds the two paragraphs of the staff handbook about leave and answers from them, with a link to the page.

Why it matters

It is the most common way to give an AI tool a company's own facts. It also cuts made-up answers.

Definition

Retrieval-augmented generation is a way to make a language model answer from your own documents. When a question comes in, a search finds the most relevant passages. Those passages are put into the prompt next to the question. The model then answers from that text and can point to its sources. It lets a model use private or fresh facts without any new training. The name comes from a 2020 research paper.
The search hands the model the right passages. The model answers from them and points to its sources.

Common mistake

Blaming the model when answers are wrong. Most RAG failures come from the search step handing over the wrong text.

Key takeaways

  1. 1
    Search first. Find the right passages.
  2. 2
    Answer from them. Text in the prompt.
  3. 3
    No new training. Facts stay current.

Compare

Learn it properly