Retrieval-Augmented Generation
Also called RAG.
Fetching relevant documents at question time and handing them to a model so it answers from them.
What it is
A design where an application searches a document store, usually by meaning rather than keywords, and places the best matches into the model's input before it answers. It grounds answers in current, private data without retraining the model.
Why it matters
Whatever is in the store becomes part of the prompt. A poisoned document, an over-shared folder or stale data shapes every answer, and access controls on the source documents have to carry through to retrieval.
In practice
An internal helpdesk assistant answers from the IT wiki. A contractor edits one page to say password resets go through an outside form, and the assistant starts recommending it.
What to look for
- Answers that cite documents the asking user should not be able to open.
- Recent edits to high-traffic source documents by unusual accounts.
- Retrieved passages that contain instructions rather than information.
Common mistake
Indexing everything and filtering nothing. Retrieval should respect the same permissions as the source, per user, at query time.
Read next
- Indirect Prompt Injection: Instructions hidden in content a model reads on someone else's behalf, such as a web page, an email or a document.
- Large Language Model: A model trained on large amounts of text that predicts the next token, which lets it write, summarize and answer.
- Data Poisoning: Tampering with the data a model learns from so that it learns the wrong thing.