Artificial Intelligence · Intermediate · 3 min read
The cheapest way to make AI useful on your own documents
Retrieval-Augmented Generation
The cheapest way to make a model useful on your own information is not to retrain it. It is to hand it the right page first.
What it is
Retrieval augmented generation, usually shortened to RAG, finds the relevant passages in your own documents and puts them in front of the model before it answers. The model then writes from what you gave it rather than from memory.
Why it matters
This fixes three problems at once. The model does not know your private information, its training stopped at some point in the past, and it cannot normally cite anything. Retrieval gives it current, private, citable material. It also makes the whole thing checkable, because you can look at what was retrieved and judge whether the answer follows from it.
What to do today
- Split documents into passages of meaningful size. Too small loses context; too large dilutes relevance.
- Judge the retrieval step separately from the generation step. Most poor RAG answers are retrieval failures.
- Keep the source reference with every passage so answers can cite.
- Decide explicitly what the system should do when retrieval returns nothing relevant.
The common mistake
Blaming the model for a wrong answer when the search step handed it the wrong pages. Check the retrieval first.
One idea a day
Something new every day across six subjects, plus a word, an idiom and a proverb.
See today