Free | No tracking | Every fact with a source|German and English

Glossary / Text and chat

RAG – explained simply

RAG lets a language model look things up in your own documents before answering and read along with the relevant passages.

Also: Retrieval-Augmented Generation, Knowledge base, Document search

RAG stands for Retrieval-Augmented Generation. Instead of relying only on the knowledge in its parameters, the model gets matching text passages from a document collection for each question. Comparison: taking a test with the book open instead of from memory.

To do this, your documents are first split into sections and converted into vectors with an embedding model. When you ask a question, the system looks for the sections that are most similar in content and adds them to the context. The original paper showed that this produces more specific and more factually accurate answers.

The found sections take up room in the context length. If the context is too small, some of the hits are cut off.

What does that mean for you? RAG is the easiest way to let a local model work with your own notes or PDFs, without any training at all.

Related terms

Errors where that matters

Sources