# RAG (Retrieval-Augmented Generation)

> Part of the AI Garage Jargons glossary: https://aigarage.in/jargons (all terms: https://aigarage.in/jargons.md)

**Category:** LLM
**Tags:** retrieval, knowledge-base, grounding

A pattern that retrieves relevant source material and gives it to a language model as context before it generates an answer.

**In plain terms:** The AI gets an open-book step. It looks up useful notes, puts the best ones beside the question, and then writes the answer.

**Use cases:**
- Internal knowledge assistants
- Policy and documentation Q&A
- Customer support answers grounded in approved material

**Why it matters:** RAG can make answers more grounded and inspectable because the knowledge source can be updated independently and the retrieved passages can be shown. Reliability still depends on source quality, retrieval quality, and generation.

**AI Garage example:** Example: an AI Garage workshop assistant could retrieve from approved facilitator guides and setup notes before answering a participant, then cite the document it used.

**Mental model:** Think of RAG as an open-book step at answer time. A retriever searches an external knowledge source for material related to the question. The selected passages become temporary context for the language model, which uses them while generating the response. The documents are not baked into the model, and weak retrieval can still lead to a weak answer.

**Builder scenario: Answer from the latest workshop handbook**

- **Context:** Imagine an AI Garage workshop assistant that answers participant questions from approved facilitator guides, workbook templates, and setup notes.
- **Failure:** A language model answering from its built-in knowledge may give a generic response, miss a recent workshop change, or confidently fill a gap that the handbook does not cover.
- **Intervention:** Index the approved workshop documents. For each question, retrieve the most relevant passages and place them, with their source titles, into the model's context before asking it to answer.
- **Outcome:** The participant receives an answer tied to the current workshop material and can inspect the cited source. When retrieval finds no relevant passage, the assistant can say that the handbook does not provide an answer.

**Common misconceptions:**
- **Claim:** RAG teaches the model the retrieved documents.
  **Correction:** RAG normally supplies retrieved material as temporary context during a request. It does not update the model's trained parameters in the way fine-tuning does.
- **Claim:** Adding RAG makes every answer correct.
  **Correction:** RAG can ground an answer only in what it successfully retrieves. Poor sources, missing passages, weak ranking, or unsupported generation can still produce a bad answer.

**Visual model (system):** RAG changes what the model can consult during a request. The retriever finds evidence first; the model then generates an answer from that temporary context.

**Visual description:** A question and an external knowledge source feed a retriever. The retriever selects relevant evidence, which is placed in the language model's context to produce a grounded answer with a source.

**Related concepts:** [Embeddings](https://aigarage.in/jargons/embeddings), [Context Window](https://aigarage.in/jargons/context-window), [Large Language Model](https://aigarage.in/jargons/llm), [Hallucination (AI)](https://aigarage.in/jargons/ai-hallucination)

**Video explainer:** [RAG: find evidence, then answer](https://nqqbubjesbyuwrdhqxnk.supabase.co/storage/v1/object/public/aigarage-public-media/jargons/rag/v2/rag.mp4) (48 seconds)

See how retrieval finds and ranks approved workshop material, places selected evidence into temporary context, and helps a language model produce a sourced answer.

**Published:** 2026-10-11T23:40:13+05:30
**Captions:** [English](https://aigarage.in/jargons/rag/captions.vtt)
**Narration:** generated

**Transcript:** A learner asks a workshop assistant what changed in the setup.

A language model only knows what it learned in training. It may guess.

RAG adds a lookup first. The question becomes a search.

A retriever, the part that searches, scans approved guides and setup notes.

It ranks the passages and picks the best ones.

Those passages go into the model's context, the text it reads for this request.

Now it can answer from them and point back to the source.

The documents do not train the model.

The answer is grounded and checkable, but it is not a truth machine.

If the source is wrong, or the search misses the right passage, the answer can still fail.

RAG changes what the model can read before it speaks.

**Last researched:** 2026-10-10

**Sources:**
- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://papers.neurips.cc/paper/2020/file/6b493230205f780e1bc26945df7481e5-Paper.pdf)
- [Google Cloud - Vertex AI APIs for building search and RAG experiences](https://docs.cloud.google.com/generative-ai-app-builder/docs/builder-apis)
- [Google Cloud - Check grounding with RAG](https://docs.cloud.google.com/generative-ai-app-builder/docs/check-grounding)

**URL:** https://aigarage.in/jargons/rag
