What is retrieval-augmented generation?
Retrieval-augmented generation (RAG) combines two steps: retrieval, which finds the most relevant information from a trusted source, and generation, where a language model writes an answer using that information. The term comes from a 2020 research paper and has since become a common way to build AI assistants on company knowledge.
Without retrieval, a language model answers from patterns learned in training, which may be out of date or simply not include your business. RAG gives it the right material to work from at the moment of the question.
How does RAG work?
- Prepare the sources. Documents or records are indexed so they can be searched, often by meaning rather than exact words.
- Retrieve. When a question arrives, the system finds the passages or records most relevant to it.
- Augment. The retrieved content is added to the model's input alongside the question.
- Generate. The model writes an answer based on that content, ideally citing where it came from.
What is an example of retrieval-augmented generation?
Answering from the brand guidelines
A copywriter asks an internal assistant whether a product can be called "eco-friendly" in a specific market. Without retrieval, the model gives generic advice.
With RAG, the assistant first retrieves the relevant section of the company's brand and legal guidelines, then answers from it and links to the source, so the copywriter can check it.
RAG vs. fine-tuning vs. a semantic layer
These approaches solve different problems and are often used together.
| RAG | Fine-tuning | Semantic layer | |
|---|---|---|---|
| What it does | Feeds relevant content to the model at question time | Retrains the model on examples | Defines what business data and metrics mean |
| Best for | Documents, policies, knowledge | Style, format, specialized tasks | Consistent numeric answers from business data |
| Keeps answers current | Yes, as sources update | Only after retraining | Yes, reads live governed data |
| Shows sources | Can cite retrieved passages | No | Traces numbers to their source |
Why does RAG matter, and what are its limits?
- More accurate answers. Grounding in trusted sources reduces made-up facts.
- Current information. Answers reflect the latest documents without retraining a model.
- Checkable output. Answers can point to the sources they used.
- Limits with numbers. Retrieving text is not the same as calculating metrics correctly. For performance data, AI also needs governed data and shared definitions.
- Quality in, quality out. If the retrieved content is wrong or outdated, the answer will be too.
How does Alli do this?
Ask Alli, part of Alli by PMG, grounds its answers in your governed data rather than general knowledge. Every request resolves against shared definitions in Alli Semantic Layer, mapping the question to the governed metrics, dimensions, and business rules your teams already agreed on.
Each answer is traceable: you can see the data, the logic, and the source behind it. Because every Alli product reads the same governed foundation, an answer in Ask Alli agrees with the dashboards and reports built on the same data.
Explore Ask AlliRetrieval-augmented generation FAQ
What does RAG stand for?
RAG stands for retrieval-augmented generation: retrieving relevant information first, then generating an answer from it.
Does RAG stop AI hallucinations?
It reduces them by grounding answers in trusted sources, but it does not eliminate them. Showing sources and keeping people in the loop still matter.
What is the difference between RAG and fine-tuning?
RAG supplies relevant information at the moment of the question. Fine-tuning retrains the model on examples to change how it behaves. RAG is usually the better fit for keeping answers current.
Is RAG enough for analytics on business data?
Not on its own. Numbers need to be calculated consistently, which takes governed data and shared metric definitions, such as a semantic layer, alongside any retrieval.
Last updated ‹ Back to the glossary
