RAG connects retrieval to generation
Retrieval-augmented generation supplies retrieved material to a model as part of producing an answer. The original RAG research combined a learned model with external retrieval. In practical applications, the term now covers a range of architectures; inspect the actual pipeline rather than assuming one design. [source]
For a legal document question, the key issue is whether the right material reaches the answer stage with enough context and a traceable identity.
Follow the pipeline
- Ingestion: recognize files and preserve their identities.
- Extraction: obtain text or other usable representations.
- Indexing: organize passages and metadata for retrieval.
- Retrieval: select candidates for the question.
- Context assembly: supply useful passages and instructions within the model's limits.
- Generation: produce an answer from that material.
- Verification: check support, completeness, and source locations.
Retrieval documentation describes multiple arrangements, including predetermined retrieval and retrieval chosen during an agent's work. Your audit should identify which steps actually ran. [source]
Diagnose a wrong answer
Question: “Was the revised date unconditional?” Answer: “Yes.” Original A02 says: “Subject to inspection.”
If A02 never entered the system, investigate ingestion. If it entered but the condition was missing from extracted text, investigate extraction. If the text was indexed but not retrieved, inspect the query, filters, and candidates. If the condition was supplied to the model and ignored, investigate the generation task and evaluation. These are different repairs.
Do not ask only whether the system has RAG. Ask whether the relevant support and qualifications reached the answer and survived it.
Build an abstention route
Answer only from the supplied passages. Cite each material statement to its source and location. If the passages do not resolve the question, identify the missing information. If they conflict, describe the conflict. Do not infer that a missing search result proves the event did not happen.A bounded answer can be more useful than a confident answer. “A02 makes the date conditional; the supplied material does not establish whether the inspection occurred” tells the next reviewer what to investigate.
Try it: citations everywhere
An answer has a citation after every sentence. Each citation opens a relevant document, but several conclusions are not supported by the quoted passages. Has grounding succeeded?
Check your understanding
The output has source links but has failed support verification. Check whether each source entails the statement at its expressed level of certainty. Also check whether material qualifications were omitted. Citation formatting and substantive grounding are separate properties.
Keep a failure ledger
Record the question, expected support, actual retrieved passages, generated claim, error category, and repair. Retest after changing any pipeline stage. That ledger teaches you more than repeatedly asking the model to “be more accurate,” because it identifies where the missing evidence or unsupported interpretation entered the process.