Legal Precedent RAG Agent for Intellectual Property Disputes using LlamaIndex
Indian legal tech systems need rapid discovery across trademark court rulings and settlement documents. Build an advanced RAG agent with LlamaIndex using hierarchical indexing and document routing across legal texts to achieve 90%+ recall@5 on relevant precedent case references.
What you are building
The core problem, expected build, and operating context for this challenge.
Develop an advanced RAG retrieval agent using LlamaIndex with document routers to index and query Indian judicial trademark decisions.
How work is evaluated
Evaluates document retrieval recall and legal citation precision for query tasks.
Challenge datasets
Public datasets, plus the private datasets you have access to.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
citation_format_check
Ensures returned case IDs follow standard law report schema.
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
recall_at_5
Recall metric of ground truth precedent cases in top 5 retrieved documents. • target: 0.9 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
What you should walk away with
Build hierarchical document indices and sub-question query engines in LlamaIndex
Implement query rewriting and document routing strategies over legal judgment corpora
Extract core legal arguments and precedents for intellectual property disputes
Measure retrieval recall and precision across legal text benchmark queries
Reference links and supporting material
Dataset of 300 Indian Supreme Court and High Court trademark law rulings.
Challenge setup
Evaluates document retrieval recall and legal citation precision for query tasks.
Challenge input
JSON containing query_text and target_law_section.
LlamaIndex
Provides hierarchical indexing and query engine routing.
Evaluated output
JSON containing relevant_case_ids array, reasoning, and citation_precision score.
- Ensures returned case IDs follow standard law report schema.
- Recall metric of ground truth precedent cases in top 5 retrieved documents. • target: 0.9 • range: 0-1
- Benchmark: Legal Bench RAG Benchmark
- Recall At 5 target: 0.9
- 1 public reference case
- Python execution harness
- Python sandbox (unavailable on Versalist)
Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.
View technical recipe
Configured tools
- Llama Index · Required
- Hume AI · Optional
- Alibi Detect · Optional
Evaluation contract
- citation_format_check · Weight 1
- recall_at_5 · Weight 1
Metrics
- recall_at_5 · Target 0.9
Benchmarks
- Legal Bench RAG Benchmark
- general
Reference cases
- 1 public reference case
Workflow tasks
- Task 1
Input: JSON containing query_text and target_law_section.
Output: JSON containing relevant_case_ids array, reasoning, and citation_precision score.
Execution harness: Python
Evaluation tools
- LlamaIndex · RAG Framework
Recipe freeze marker
No recipe freeze time is recorded.