Meet RAG: the AI checks outside documents before it answers.
By Tony Yu / tkal · October 31, 2026 · One-minute visual guide
An open-book test, in one picture
look it up first~
OUTSIDE DOCUMENTS
↓ the best matches come along
CONTEXT FOR THIS ANSWER
1 · Your questionWhat you asked
2 · Look it upSearch the documents
3 · Best matchesAdded to the context
4 · The answerGrounded in what it found
Without RAG, the model has only its pretraining. With RAG, the passages it retrieves sit on the desk next to your question.
Keep this bitRAG (retrieval-augmented generation) connects an outside data source to a language model. It retrieves the most relevant information first, then grounds its answer in it.
Why care?
On its own, a model knows only its pretraining data. RAG lets it use up-to-date or specialist documents, and cite them, without retraining the model.
The catch
It works only as well as the documents it searches. If they are low quality or off topic, the answer will be too.