When an AI assistant answers with your company's data, it is easy to think it has “learned” your documents. That is rarely the case. The model was not trained on them: it searches them right before answering. This technique is called RAG (Retrieval-Augmented Generation) and was described in a 2020 research paper.

How it works, in three steps

  1. Prepare. Your documents are split into chunks and stored in an index. Each chunk is usually turned into a numeric vector (an embedding) that represents its meaning.
  2. Search. For each question, the system finds the chunks most similar to what was asked.
  3. Answer. The model receives the question with those chunks in front of it and writes the answer based on them.

The big advantage: change the document, the answer changes

Because the knowledge lives in the index and not inside the model, updating a policy or a catalogue is as simple as re-indexing the document. Nothing needs retraining. The system can also cite which chunk each answer comes from, which makes it easier to check.

The limits worth knowing

  • If the search fails, the answer fails. The model only sees what it is given. If the right chunk is not among those retrieved, the answer will be incomplete or wrong even though the document is in the index.
  • If the document is wrong, so is the answer. RAG does not fix outdated or contradictory information: it repeats it.
  • Chunking matters. A chunk that is too short loses context; one that is too long mixes topics. There are techniques to improve it, such as adding a short description of the source document to each chunk.

When it makes sense

RAG fits when information changes often, when you need to cite the source, or when documents are private and you neither want nor need to train a model on them. To teach a model a particular style or format, other techniques may be a better fit.

My takeaway: in a RAG system, search quality matters as much as model quality. Before switching models, check which chunks you are feeding it.