CDRAG narrows document search before answering legal questions
CDRAG splits document retrieval into two stages before an AI produces an answer. It first groups by meaning and uses a to create keywords that describe each group. When a question arrives, the model selects the relevant groups and decides how many documents to retrieve from each one.
It then uses to search only inside those groups. Standard RAG simply takes the top matching documents from the whole collection, which can miss useful material connected at a broader level. On 100 questions from the Legal RAG Bench dataset, scores from an AI judge showed 12% higher and 8% higher overall quality than standard RAG.
CDRAG performed better on five of six measured areas, and its code and notes are available on GitHub.
Key points
- Documents are grouped by meaning before questions are processed.
- A model selects relevant groups and divides the document budget among them.
- search runs only within the selected groups.
- The 100-question legal test reported 12% higher and 8% higher overall quality.
- No direct measurement of token use or total cost savings was provided.