Glossary
RAG (retrieval-augmented generation)
RAG means having a language model answer from selected documents: the system first retrieves the relevant passages, then the model writes its answer from them and cites its sources.
How it works
- Index: documents (procedures, contracts, regulations) are split into passages and indexed for search.
- Retrieve: for each question, the system finds the closest passages, by meaning and by keywords.
- Generate: the model receives the question and those passages, and writes an answer that points back to the sources.
Why it is useful in finance
- Answers rest on your up-to-date documents, not on the model's general memory.
- Every answer cites its sources: the user can check, and so can the auditor.
- No need to retrain a model: you update the index, and your data is not used for training.
Typical uses: questions on internal procedures, search across contracts and term sheets, help reading regulatory texts, support for compliance teams.
Points to watch
- Access rights: users must only retrieve documents they are allowed to see.
- Retrieval quality: if the right passage is not found, the answer will be wrong. That is often where quality is won or lost.
- Hallucinations: RAG reduces them without eliminating them. Measure answer quality continuously against a reference set of questions.
- Security: a booby-trapped document can carry hidden instructions (indirect prompt injection). See the OWASP Top 10 for LLMs.
Related terms
A RAG on your documents, in a few hours?
At the Lab we build a prototype that answers from your own documents, at a fixed price, so you can judge for yourself.