Skip to content
All projects
01

NIYAM

Legal AI that checks every authority against time.

Year
2026
Status
Live
Category
AI Product
lextemporal.vercel.app
NIYAM drafting a plaintiff's arguments, every sentence tagged with the paragraph it rests on
NIYAM drafting a plaintiff's arguments, every sentence tagged with the paragraph it rests on

01 / Overview

NIYAM is an AI legal research workspace built around a gap the team found in existing tools: an authority is rarely verified against India's amendment history (22,914 amendment events across 883 acts) before a lawyer relies on it, and the reasoning is rarely tied to the paragraphs it comes from.

A lawyer drops in the case papers. NIYAM extracts the matter's timeline (agreement, cause of action, suit dates), searches the judgment corpus with hybrid retrieval, and runs every authority through a deterministic temporal validity engine that marks it checked-clear, recast, superseded or unverified. Drafting uses only retrieved judgments, one citation per sentence, and a hearing simulation lets the defence attack the weakest citation first.

It runs locally on one laptop from a 4 GB SQLite corpus, cache-first, so it keeps working with the network down. NIYAM is the final build of LexTemporal, the team's earlier prototype, and is deployed at the prototype's original address.

02 / Problem

General-purpose LLMs hallucinate on legal questions, and even grounded legal research tools still do. None of the tools the team surveyed support their reasoning with the paragraphs it comes from.

Indian law changes in waves. An authority can be overtaken by an amendment that is not visible on the face of the judgment, so it has to be checked against the matter's own timeline before a lawyer can rely on it.

03 / Solution

  1. 01Timeline extraction reads the agreement, cause-of-action and suit dates from the papers; those dates govern every check.
  2. 02Hybrid retrieval: a binary-vector scan (1 bit per dimension, Hamming distance), cross-encoder reranking, and provision and citation graph expansion.
  3. 03A deterministic temporal validity engine, with no LLM in it, compares the provisions an authority relies on with the statute amendment graph and the matter's timeline, and flags it checked-clear, recast, superseded or unverified.
  4. 04Governed output: a citation rail checks every drafted sentence against the paragraph it cites, the autonomy policy is enforced server-side, and nothing is exported until a named person signs off.

04 / Features

  1. 01Drop in case papers: born-digital PDFs through unpdf, scans through tesseract.js, all on the device
  2. 02One agent conversation per matter, with an intent router for research, drafting, simulation and chat
  3. 03Drafted arguments where every sentence carries the document and paragraph it stands on; click a tag to read that paragraph
  4. 04Hearing simulation in a fixed order: openings, the bench's question, debate, verdict
  5. 05Every model call cached in SQLite by prompt hash
  6. 06Append-only audit of every search, flag, draft, override, hearing and sign-off

05 / Architecture

  • 01Next.js 16.3, React 19.2, TypeScript 5; Tailwind CSS v4, shadcn/ui and Zustand; react-markdown for work product
  • 02Next.js Route Handlers on the Node runtime: 16 API routes
  • 03NVIDIA NIM for embeddings, reranking and the agent (Nemotron); Gemini drives drafting and simulation
  • 04Binary vector index, brute force: 1.19 s across 3.4M vectors
  • 05SQLite data layer: 4 GB, 23 tables, 13.2M rows, 5.7K full texts, 134K chunks; cache-first
  • 06Offline ingest: DuckDB streams remote Parquet (AWS, Hugging Face), pypdf plus a statute-relevance gate (about 1.7% kept), orchestrated with uv
  • 07Statute graph mined from 883 acts and 22,914 amendment events, core rows hand-verified against India Code

06 / Screens

A research answer: timeline found, 133,947 passages searched, two amendments flagged
A research answer: timeline found, 133,947 passages searched, two amendments flagged
Architecture from the team's pitch: workspace, local validity core, LLM layer, governed output
Architecture from the team's pitch: workspace, local validity core, LLM layer, governed output

Let's build something.

© 2026 GLAZY, a freelance web & SaaS agency · Founded by Krutik Mhatre
Footage: Mixkit (7 clips)