Ablaufdiagramm RAG: Nutzerfrage → Vektorisierung → Suche in Wissensdatenbank → relevante Textstellen → Sprachmodell kombiniert Frage und Textstellen → Antwort mit Quellenangaben

Retrieval-Augmented Generation

Retrieval-Augmented Generation is a method in which an AI language model specifically looks things up in a knowledge database before answering — much like a student who checks a book before giving an answer. This allows the model to use current or company-internal information that it did not know at the time of training.

An AI language model — that is, a program that understands and generates text — only knows what was in its training data after training is complete. It cannot look up new information and has no memory of events after its training cutoff. Retrieval-Augmented Generation solves this problem: before the model answers, an additional step searches a knowledge database for matching passages of text. These passages are attached to the question, and the model formulates its answer on this basis. The result is an answer grounded in concrete, up-to-date sources — not just in whatever the model happened to learn at some point.

Why outdated knowledge is a real problem

Language models are trained on huge amounts of text — a process that takes weeks and costs millions of euros. After that, the model is frozen. It knows nothing of yesterday’s news, no updated product prices, and no internal company documents. For many applications, this is a serious drawback.

A customer service bot that relies solely on its training might cite outdated warranty terms or quote the wrong prices. With RAG, it instead looks up the current product database before answering. This significantly reduces the risk of errors. In the industry, such invented yet confidently worded wrong answers are called “hallucinations” — RAG is one of the most effective methods for reducing them.

Another advantage: the model itself does not need to be retrained when the underlying data changes. You simply update the knowledge database. This saves enormous amounts of time and computing effort.

The three steps behind the lookup

RAG consists of a retrieval step and a generation step — hence the name. First, the user’s question is converted into a mathematical representation, a so-called vector. Vectors are lists of numbers that encode the meaning of a text. Similar meanings produce similar number sequences, which enables machine comparison.

In the knowledge database, all stored documents are likewise available as vectors. A search algorithm finds the documents whose vectors are most similar to the query — that is, the passages most relevant in content. This process typically takes only a few milliseconds.

In the second step, the language model receives the original question together with the retrieved passages as context. It reads them and formulates an answer in natural language. The model does not invent anything in the process: it summarizes what has just been presented to it. The sources can even be displayed as footnotes, so users can verify the statements themselves.

RAG in products and headlines

Microsoft's Copilot, which is integrated into Windows and Office, uses RAG to access a user’s own files and emails. Without this mechanism, the model would know nothing about the content of documents stored on one’s own computer. Google does the same in its search engine: when an AI answer appears there, the sources are listed below it — that is RAG made visible.

In businesses, RAG has become one of the most common use cases for AI altogether. Banks have their systems look things up in contract databases, hospitals in medical guidelines, software companies in their internal documentation. The alternative would be to retrain the model every time — which is neither economically nor practically feasible.

In tech media, RAG mostly comes up in comparison with another method: so-called fine-tuning, in which a model is actually retrained on new data. RAG and fine-tuning are not mutually exclusive — many systems combine both. But for frequently changing content, RAG is almost always the faster and cheaper choice.

Related Products

Latest News

  • Anthropics Leak macht weiter Schlagzeilen (q.e.d.)
    Apr 02, 2026

    Der Artikel behandelt einen Datenabfluss bei Anthropic, also den Umgang eines führenden KI-Unternehmens mit internen Informationen, was eng mit Wissensquellen von KI-Systemen zusammenhängt.

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.