RAG, embeddings and fine-tuning
Retrieval-augmented generation (RAG) combines information retrieval with generation: it finds documents or excerpts and gives them to a model as context. Embeddings represent information as vectors to support similarity searches. Search may also combine keywords, filters and result reranking.
Quality depends on document preparation, retrieval, permissions and how answers use sources. RAG does not eliminate hallucinations or make documents automatically safe. Fine-tuning changes a model’s behaviour using examples; it is not the same as maintaining an up-to-date document collection.
In an internal assistant, filter documents by the person’s access rights before passing them to the model. Then test whether the answer relies on the right passages and admits when it cannot find enough information.
Separate retrieval failures, generation failures and authorisation failures.
Try it yourself
Design ten evaluation cases for a document assistant: include an answer that is present, one that is absent, conflicting sources, an outdated document and a document the user is not authorised to read. Define how to distinguish each failure type.
