How AI Works
$definerag--plain-english
TLDRThe open-book exam: look it up, then answer.
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. That is a 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 in a vector database. A few relevant scraps get pasted into the 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 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:
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 — without a training run. The builder gets you an app. RAG is how that app stops guessing about your world.