# RAG (/academy/rag)



Ask a model about *your* refund window and it will often invent one. Last week's price was never in the training set. Your help center was never in the training set. The model still answers, because that is what it does — it predicts the next [token](/academy/token). That is a [hallucination](/academy/hallucination) wearing a product face.

**RAG** is the habit of fetching first.

You keep your own pile — markdown, tickets, a Notion export. A question comes in. A search runs, usually over [embeddings](/academy/embedding) in a [vector database](/academy/vector-database). A few relevant scraps get pasted into the [context window](/academy/context-window). Then the model writes, with those scraps on the desk. Retrieval-augmented generation: fetch the pages, then generate.

The model did not get smarter. You stopped asking it to recite a world it never lived in.

This is the pattern under almost every "AI that knows our business" demo. The support bot that quotes *your* FAQ. The [agent](/academy/agent) that answers from a project file and the repo instead of a blog post from 2023. Nobody retrained the weights. They pointed a normal model at a folder and told it to read before it spoke.

Two traps:

* **Wrong scraps.** RAG is only as honest as what it retrieved. Closest chunk is not correct chunk. If the folder has no answer, you still get a confident paragraph about the nearest cousin.
* **Stale scraps.** Update the file. Re-index. Otherwise the bot is citing Tuesday.

[Fine-tuning](/academy/fine-tuning) is the other lever — you change how the model *writes*, not which page it can see. Facts that move weekly belong in retrieval. A style that never moves can wait.

**What this unlocks**

You can ship a Saturday product that answers from *this* repo, *this* pricing page, *this* [schema](/academy/schema) — without a training run. The [builder](/builder) gets you an app. RAG is how that app stops guessing about your world.
