---
title: "What Is RAG (Retrieval-Augmented Generation)?"
description: "RAG (retrieval-augmented generation) gives an AI model relevant documents to read at answer time, so its response is grounded in your data instead of memory. Meaning, how it works and RAG vs fine-tuning."
type: "glossary"
locale: "en"
term: "RAG (Retrieval-Augmented Generation)"
canonical: "https://agenticschool.dev/glossary/rag"
dateModified: "2026-07-03"
---

# What Is RAG (Retrieval-Augmented Generation)?

- Definition: RAG (Retrieval-Augmented Generation)
- Updated: 2026-07-03
- Keywords: rag, what is rag, retrieval augmented generation, rag meaning, rag vs fine-tuning
- Canonical URL: https://agenticschool.dev/glossary/rag
- Locale: en

> RAG (retrieval-augmented generation) gives an AI model relevant documents to read at answer time, so its response is grounded in your data instead of memory. Meaning, how it works and RAG vs fine-tuning.

RAG, short for retrieval-augmented generation, is a technique that gives an AI model relevant information to read at the moment you ask a question, so its answer is grounded in real, current documents instead of only what it memorised during training. Instead of hoping the model already knows your data, a RAG system first retrieves the most relevant snippets from a knowledge source (your docs, a database, a set of PDFs), pastes them into the prompt as context, and then asks the model to answer using that material. The result is answers that cite your actual content, stay current as your data changes, and hallucinate less, without the cost of retraining the model.

## How RAG works

A RAG pipeline has two halves: retrieval and generation. First you index your knowledge into a searchable store, often a vector database of embeddings. At query time the system finds the passages most relevant to the question, adds them to the prompt, and the model generates an answer from that grounded context.

- Index: split your documents into chunks and store them so they can be searched by meaning, not just keywords.
- Retrieve: for each question, pull back the handful of chunks most relevant to it.
- Generate: paste those chunks into the prompt as context and let the model answer from them.

## RAG vs fine-tuning

RAG and fine-tuning both adapt a model to your needs, but they solve different problems. Fine-tuning changes the model weights to teach it a style or skill, and it is slow and expensive to update. RAG leaves the model untouched and instead feeds it fresh knowledge at query time, so it is the right tool when your facts change often or must be cited. Many real systems use both: fine-tuning for behaviour, RAG for knowledge.

## Why RAG matters for builders

RAG is how most production AI features stay accurate and trustworthy. It lets a support bot answer from your real help center, a research agent cite its sources, and an internal tool reason over private data the base model never saw. Because retrieval controls what the model reads, RAG also reduces hallucination and gives you a place to enforce permissions, keeping the model honest and grounded in the context you allow it to see.

## FAQ

### What does RAG stand for?

RAG stands for retrieval-augmented generation. It is a technique where an AI system retrieves relevant documents at query time and adds them to the prompt, so the model generates an answer grounded in that retrieved context rather than only its training data.

### What is the difference between RAG and fine-tuning?

Fine-tuning changes a model weights to teach it a style or skill and is costly to update. RAG leaves the model unchanged and feeds it fresh, relevant knowledge at query time. Use RAG when facts change often or must be cited; use fine-tuning to shape behaviour.

### Does RAG stop AI hallucination?

It reduces it but does not eliminate it. By grounding answers in retrieved source text, RAG gives the model real facts to rely on, so it invents less. The model can still misread or ignore the context, so verification and good retrieval quality still matter.

### Do I need a vector database for RAG?

Usually, but not always. A vector database stores embeddings so you can retrieve by meaning, which suits most RAG systems. For small or highly structured data, plain keyword search or a normal database query can be enough to retrieve the right context.
