Retrieval-augmented generation (RAG)
Retrieval-augmented generation, or RAG, is a way of building AI systems so that the model answers from content it has just looked up, not only from what it absorbed in training. Microsoft describes it as a pattern that extends a language model's capabilities by grounding its responses in your own content.1 The name comes from a 2020 research paper that paired a language model with a searchable index of documents.2
Why RAG matters to a firm with documents.
It is how a general model gets to answer from your material.
A general AI model knows nothing about your price list, your policies or last month's contract. RAG is how it gets to answer from them without those documents being built into the model. The paper that named the technique was addressing two limits of language models that still matter: showing where an answer came from, and keeping knowledge up to date.2
It is also what sits behind AI answers the public already sees. Google says its generative AI features in Search use retrieval-augmented generation: its ranking systems retrieve pages from the Search index, and a response is then written with links to them.3
For a business the attraction is control. The documents stay where they are, a well-built system shows which ones an answer drew on, and the index can be refreshed when a document changes.1
How RAG works, from question to answer.
Four stages. The first decides most of the quality.
1 · Prepare
Documents are split into passages and indexed so they can be searched by meaning as well as by keyword. Microsoft's guidance is blunt that RAG quality depends on how content is prepared for retrieval.1
2 · Retrieve
When a question arrives, the system searches the index and pulls out the passages most likely to hold the answer. It cannot send everything, because a model accepts a limited amount of text at once.1
3 · Generate
The question and the retrieved passages go to the model together, and it writes its answer from them.1
4 · Cite
A well-built system shows which documents it used, so a person can check the answer against the source.1
Retrieval is also where access rules belong. Microsoft's example is that finance data should be accessible only to the finance team, even when an executive asks the chatbot, which means the search step has to respect who is asking.1
RAG on a staff handbook.
An invented firm and four ordinary questions.
Example: a forty-person engineering firm lets staff ask questions of its HR policies
- The policies are indexed: holiday, sickness, expenses and remote working, each split into passages.
- An employee asks how much notice is needed to book two weeks off.
- The search step finds the holiday policy, although the employee wrote “two weeks off” and the policy says “annual leave”. Matching intent, not just words, is the first challenge Microsoft's guidance describes.1
- The model answers from those passages and names the policy and section it used.
- Asked about a directors' bonus scheme, the system finds nothing this employee is permitted to see and says it cannot answer.
- When HR replaces the holiday policy, the index is refreshed and the next answer follows the new document.
This illustrates the approach. It is not a description of a past project.
RAG is not training, and other confusions.
Five things it gets mistaken for.
RAG does not change the model. Google draws the same line for its own systems: grounding happens after a model has been trained and is completely independent of training.4
Google describes the technique as improving the quality, accuracy and freshness of responses, not as making them certain.3 If retrieval finds the wrong passage, the model answers from the wrong passage.
More is not better. Microsoft notes that sending everything wastes the model's limited input and degrades quality.1
Close, with one difference. A search returns documents for you to read. RAG reads them and writes the answer.
A different technique, which adjusts the model itself. The private AI page compares the two.
Getting RAG right in a small firm.
Six steps, starting smaller than you think.
- Start with one bounded set of documents. A handbook, a product catalogue or a set of standard terms.
- Clean it first. Out-of-date and duplicate documents produce out-of-date and contradictory answers.
- Carry permissions through. The assistant should not answer from a file the person asking could not open. Microsoft puts it as users and agents retrieving only authorised content.1
- Insist on citations, and treat “I cannot find that” as an acceptable answer.
- Test with real questions, and check a sample of answers against the documents.
- Decide where it runs. Which provider processes the questions, and where the index is kept, is a separate decision.
Where the documents are confidential, the choices are set out on the private AI page. Assistants that answer customers from your own content are covered under AI for customer service.
RAG: straight answers.
Three questions people ask before trusting one.
What does RAG stand for in AI?
Retrieval-augmented generation. The phrase was introduced in a paper submitted in May 2020 by Patrick Lewis and eleven co-authors. They paired a language model with a searchable index of Wikipedia and reported that the combination produced more specific, diverse and factual text than a comparable model working alone.2
Does RAG mean the AI is trained on my documents?
No. With RAG the documents are searched at the moment of each question, and the relevant passages are handed to the model along with it. The model itself is not changed. Google makes the same distinction about its own products, describing grounding as something that happens after training and is completely independent of it.4
Does RAG stop AI making things up?
It narrows the room for it and does not remove it. The model is given source passages to work from, and a good system shows which ones it used, so errors are easier to catch.1 The answer is still only as good as the passages retrieved, which is why a person should check anything that leaves the business.
SOURCES
- Microsoft Learn, “Retrieval-augmented generation (RAG) in Foundry IQ (Azure AI Search)” (last updated 17 November 2026), read 3 December 2026.
- Lewis and others, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”, arXiv:2005.11401, abstract page (submitted 22 May 2020), read 3 December 2026.
- Google Search Central, “Optimizing your website for generative AI features on Google Search” (last updated 2 December 2026), read 3 December 2026.
- Google Search Central, “Control how your content is used for generative AI at Google”, read 3 December 2026.
