A language model only knows what was in its training data and what is in front of it in the prompt. Retrieval-augmented generation, or RAG, puts the right passages from your own documents in front of it.
A RAG system has two halves. Indexing happens once, and again whenever the documents change: split each document into chunks, compute a vector for each chunk and build a keyword index. Answering happens for every question: search the index, take the best few chunks, put them into a prompt with an instruction and the question, and let the model write.
The search can match exact words, the way keyword search does, or match by meaning using embeddings, or combine the two. Each catches things the other misses.
RAG does not change the model’s weights, and it does not make the model “know” your documents. Remove a note from the index and the model can no longer use it. Because of that, you can see exactly which passages were retrieved and ask whether a person could answer from them. When an answer is wrong, you can usually tell whether the search failed or the model did.
Retrieval also has limits. If the passage that holds the answer is split badly, worded differently from the question, or never retrieved, the model cannot use it.
For local AI, RAG means your documents can stay on your own machine. The explainer runs the search half in your browser and stops at the prompt.