Back to glossary

Term

RAG

RAG (Retrieval-Augmented Generation) connects a language model to an external knowledge source — relevant passages are retrieved and passed to the model alongside the question.

RAG — explained in more detail

RAG stands for Retrieval-Augmented Generation and describes a technique that connects a language model to an external knowledge source without retraining it. The typical flow: the question is converted into a vector, a vector database returns the most similar text passages from a knowledge base, and the model receives those passages together with the original question as context. Answers therefore rest on concrete evidence rather than on the knowledge baked into the model during training alone.

Example / Practical context

A classic application is chatbots over your own documents — product manuals, internal wikis, legal texts. The model has not seen those documents during training but, thanks to RAG, can cite relevant excerpts and surface their source. This also makes it possible to bring in content created after the knowledge cutoff or internal company material without modifying the model itself.

Unlike fine-tuning, RAG does not change the model — the knowledge source is swappable and can be updated at any time. Compared to long context windows, where entire documents are pasted directly into the prompt, RAG scales better to large corpora because only the relevant passages are loaded per request.

Entdecke mehr