What is RAG?

Retrieve relevant documents, augment the prompt, then generate an answer.

RAG in one sentence

Retrieval-Augmented Generation = search your knowledge base first, then let the LLM read those snippets and answer. The model stays general; your data stays external and updatable.

Formula: Question → Retrieve → Prompt + Context → LLM → Answer (with sources)

Each step below answers: What is this? Why? How? What if removed?

The RAG pipeline

Step 1: User asks a question in natural language.

What:

Why:

How:

If removed:

Open guided notebook for this pipeline

Why not fine-tune?

Fine-tuning bakes knowledge into weights (expensive, slow to update). RAG updates documents instantly without retraining.

Why not dump all docs?

Context windows are finite. Retrieval picks only the top-K relevant chunks.

RAG vs raw LLM

Grounding
Honesty
Fresh data
Click to compare behaviors.