Skip to main content
Loading navigation

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.

Business OperationsHosted by Vera

What you are building

Develop an advanced RAG retrieval agent using LlamaIndex with document routers to index and query Indian judicial trademark decisions.

How work is evaluated

Evaluation

Evaluates document retrieval recall and legal citation precision for query tasks.

Datasets

Public datasets, plus the private datasets you have access to.

How submissions are scored

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

citation_format_check

Ensures returned case IDs follow standard law report schema.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

recall_at_5

Recall metric of ground truth precedent cases in top 5 retrieved documents. • target: 0.9 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

  • 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

Resources

Dataset notes

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.

Evaluation checks
  • 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
Configured evaluation evidence
  • Benchmark: Legal Bench RAG Benchmark
  • Recall At 5 target: 0.9
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Shows the first task, up to three tools, and up to three evidence items.

View technical recipe

Configured tools

Action Space
  • 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

  1. 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.

Frequently Asked Questions about Legal Precedent RAG Agent for Intellectual Property Disputes using LlamaIndex