← Applied AI
Applied AI· 2 min read

Agentic RAG and Precedent Research

.NETAI EngineeringIndian Case Law

Summary

Decompose a privacy question, keep a human-review flag, and do not treat a citation string as an overruling.

Companion code: 07-agentic-rag in indian-legal-ai-lab.

Previous: Part 6: A Bounded Legal Research Agent

A privacy question may need more than one query. A citation string in a judgment is not a holding that one case overrules another.

Decomposition is explicit

`QueryDecomposer` always keeps the original question. `AddPrivacyQueries` adds `Kharak Singh surveillance personal liberty` and `Puttaswamy privacy` when the question contains `privacy`. `AddSpeechQuery` adds `Romesh Thappar freedom of speech Madras` when the question contains `speech` or `article 19`.

`CaseDiscovery` runs hybrid search with three hits per query, groups by chunk id, keeps the higher score, and stops at six passages. If that list is empty, `ResearchWorkflow` sets the stage to `insufficient` and writes a report whose finding is that the local corpus did not contain enough matching passages.

What verification is allowed to say

`CitationVerification.VerifyPassage` calls `GetPassage` and writes either `verified {chunkId} against stored text` or `missing {chunkId}`. `CiteNote` calls `FindCitedCases`. When links exist, the note is:

`{caseId} string-cites {count} catalog case(s). Overruling is not inferred.`

`CitationGraphBuilder` produces those links by matching `FICTIONAL yyyy SYN n` and neutral-citation-shaped strings in the extracted text. The link's `Note` says the same thing: a string match does not mean the later case overrules the earlier one. The fictional Article 19 fixture cites `FICTIONAL 2024 SYN 1`, which resolves to `SYN-ART21-001`. That edge is a test of the matcher.

Puttaswamy (`2017 INSC 801`) is in the manifest as metadata. The workflow can name the query. It cannot quote the judgment, because no text file was vendored.

dotnet run --project labs/07-agentic-rag

A privacy question completes with `1962 INSC 389` among the considered cases. `HumanReview` is `Required before any reliance.`

Next

Part 8: A Multi-Agent Legal Research Workflow

Verified in this revision

Query decomposition is still the keyword rules in `QueryDecomposer`. A citation string is still not treated as overruling. `CitationChecker.Assess` now separates catalog existence from passage support, which is the check a report should print before claiming a passage backs a citation.

More in Applied AI