← Projects

personal · Built

Indian Legal AI Lab

Offline legal research lab over public Supreme Court judgments

A .NET 8 lab that retrieves public Supreme Court judgment text, checks citations against a catalog, and keeps tool use inside an allow list. It is not legal advice.

Overview

Twelve console labs plus an ASP.NET Core API and a Blazor page share one library. Retrieval, agents, MCP, ingestion, and sessions run offline in tests. A live chat or embedding model is optional and was not executed in the recorded test run.

Problem

A legal research demo has to show which passage was retrieved, whether a citation exists in the catalog, and whether that passage supports the citation. A hash vector and a model completion are different claims.

Outcome

How a legal research assistant can stay grounded in retrieved passages without claiming legal advice or a live model result.

Architecture

  1. 1Core, retrieval, agents, workflows, MCP host, API, and Blazor UI
  2. 2Microsoft.Extensions.AI chat abstraction
  3. 3MCP SDK 1.4.0 stdio
  4. 4File ingestion queue and atomic session files

Public-judgment retrieval, citation checks, a bounded research agent, an MCP host and client test, and an API that validates requests and can require a token.

Engineering decisions

  • The target framework stays net8.0.
  • Hash embeddings stay labeled offline. Semantic vectors come only from an embedding HTTP call.
  • The official MCP SDK host is the stdio server the integration test starts. The JSON handler remains a teaching printout.
  • Sensitive POST and DELETE routes require X-Api-Key only when Api:Token is configured.

Technologies

C#.NET 8ASP.NET CoreBlazorMCP

Limitations

  • No live model call and no deployment are part of the recorded results.
  • pgvector SQL is not executed in the test run.
  • The sample corpus is small and includes labeled fictional fixtures.
  • Articles live on yashshah.ai. They are not copied into this repository.

Source code on GitHub