Skip to main content

Retrieval-augmented generation (RAG)

Constraining an AI answer to documents retrieved from a real database before generation.

Retrieval-augmented generation (RAG) is a technique that retrieves relevant documents from a real source — case law, statutes, a firm's own files — and supplies them to the language model as context before it generates an answer. The goal is to ground the output in real material rather than the model's parametric memory.

RAG reduces, but does not eliminate, hallucination: a model can still misread or over-extend retrieved context. That is why grounding is paired with post-hoc citation validation and human review.

Related terms

We use essential cookies to keep you signed in and privacy-friendly, cookieless analytics to improve Draftiro. No third-party advertising trackers.