RAG: the details
The name comes from a 2020 research paper. The process has three steps: documents are split into chunks and indexed, usually as vectors that represent their meaning; when a question arrives, the most similar chunks are retrieved; and the model writes the answer citing those chunks. Quality depends more on retrieval than on the model: if the right chunk doesn’t arrive, the answer will be plausible and wrong.
RAG isn’t the only way to give a model context. When the data lives in a system with good search or an API, giving the model a tool to query it usually works better. And when the corpus is small, it fits in the context whole. RAG pays off with many documents that change often and when you need to show the source of every statement.