What is retrieval-augmented generation (RAG)?
Also known as: Grounding, Grounded generation, Retrieval-augmented LLM
Retrieval-augmented generation (RAG) is a way of building AI tools so that, before a language model answers, the system searches a chosen set of documents for relevant passages and hands those passages to the model along with the question. The model then writes its answer with that source material in front of it, rather than relying only on what it absorbed during training.
The term comes from a 2020 research paper by Patrick Lewis and colleagues, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”, presented at NeurIPS 2020. The authors combined a pre-trained language model (knowledge stored in its weights, which they called parametric memory) with a separate, searchable index of Wikipedia (non-parametric memory) accessed through a neural retriever. They pointed to two open problems with language models alone: showing where an answer came from, and updating what the model knows. Today, “RAG” is used more broadly for almost any system that fetches documents at query time and passes them to a model as context.
How RAG works
Most RAG systems follow the same four steps, though the details vary by tool:
- Prepare the collection. Documents are split into smaller passages and indexed so they can be searched. Many systems use embeddings, numerical representations of meaning, so a search can find passages that match a question’s intent and not just its exact words.
- Retrieve. When someone asks a question, the system searches the index and selects the passages it judges most relevant.
- Augment. Those passages are added to the prompt, usually with instructions such as “answer only from the sources provided” and “cite the passage you used.”
- Generate. The language model writes the answer. Well-designed tools show which passages it drew on, so a person can check them.
RAG and grounding
“Grounding” is a looser term for tying an AI system’s output to a specified source of truth, such as a document set, a database or a search result. RAG is one of the most common ways to ground a model. NIST’s Generative AI Profile (NIST AI 600-1) lists grounding and retrieval-augmented generation among the techniques organizations may use to manage generative AI risk, and it suggests re-assessing model risks after implementing RAG, since adding a retrieval layer changes how the system behaves.
Why it matters for pharma marketing
Pharma marketing runs on approved sources: the prescribing information, an approved claims library, the references behind each claim, brand guidelines and past review decisions. A general-purpose model doesn’t know which of these are current for your brand, and it can’t tell approved wording from something it read on the internet. RAG lets a team point the model at the sources it should use.
| Without retrieval | With retrieval over approved sources |
|---|---|
| Answers come from whatever the model learned in training | Answers draw on passages from a collection the team controls |
| Hard to tell where a statement came from | The tool can show the passage behind each statement |
| Knowledge is fixed at the model’s training date | Updating a document updates what the system can retrieve |
| One model serves every brand the same way | Each brand can have its own collection and access rules |
In practice, teams use RAG-style tools to answer questions about a brand’s guidelines, find the reference passage that supports a claim, check draft copy against approved language or brief a new team member. For agencies working across several brands, keeping each brand’s collection separate matters as much as the retrieval itself.
Limits and common misconceptions
- “If it cites a source, it’s correct.” The model can still misread a passage, combine two passages into a statement neither supports, or add detail that isn’t there. NIST calls confidently stated but false output “confabulation,” and retrieval reduces the room for it without removing it. See AI hallucination.
- “The collection takes care of itself.” Retrieval only finds what is in the index. Superseded labels, unapproved drafts or another brand’s documents in the collection will be retrieved just as readily as approved ones.
- “Retrieval always finds the right passage.” Search can miss the relevant passage, rank a weaker one higher or return only part of a table or footnote. If the right text never reaches the model, the answer can’t reflect it.
- “A sourced answer is an approved answer.” Output from a RAG tool is still draft material. Supporting evidence for a claim is a judgment for qualified reviewers, and promotional content still goes through MLR review.
Note. RAG is different from fine-tuning. Fine-tuning changes a model’s weights by training it further on examples; RAG leaves the model as it is and supplies documents at the moment of the question. Many tools combine both.
Questions to ask about a RAG-based tool
- Which documents does it search, who decides what goes in, and how are superseded versions removed?
- Does it show the exact passage behind each answer, with enough location detail to find it in the source?
- Are collections separated by brand or client, and who can see each one?
- What does it do when nothing relevant is found: say so, or answer anyway?
- How has it been tested on your own material? See AI evaluation for what a useful test looks like.
References
Last reviewed December 2026. This glossary explains terms in general; it isn’t legal or regulatory advice.