A RAG design for adding legal citations to exam questions
A small legal-tech team is trying to attach legal support to more than 2,700 real questions from an official government notary exam. Each question has a marked correct answer, but it does not include the article, case law, or other legal basis that proves why the answer is correct. The goal is to help exam candidates understand the reason behind the answer, not just memorize it.
Manually matching all questions to the right legal text would take too much work, so the proposed system uses RAG to search a national legal code and suggest supporting sources automatically. A human would review the results later before they are trusted. The proposed stack uses , Cohere’s legal , hybrid retrieval, and a high-end LLM to generate explanations or citations from the retrieved material.
The larger product is a study platform that finds each candidate’s weak legal topics and gives targeted practice instead of generic .
Key points
- The dataset has more than 2,700 official notary exam questions with correct answers but no legal basis attached.
- The system is meant to find the article, case law, or legal text that supports each answer.
- RAG is used to retrieve candidate legal sources before an LLM writes explanations or citations.
- The proposed setup includes , Cohere’s legal , and hybrid retrieval.
- Retrieving only the most relevant legal text can reduce token use compared with sending very large source material to the model.