← All work
04 / Legal text → Plain English

NyayaDiary

A RAG assistant that answers questions about Indian law in plain English, grounded in the Constitution and 10 major legal acts.

FastAPILangChainFAISSSentenceTransformersGroqTailwindCSS
NyayaDiary screenshot
The problem

Most citizens can't parse legal text, and a generic chatbot will hallucinate law with total confidence — a dangerous combination when the answer is about your actual rights.

The system

A FastAPI backend chunks 10 major Indian legal acts — the Constitution, Bharatiya Nyaya Sanhita, Criminal Procedure Code, and more — into a FAISS index built on SentenceTransformers embeddings. Queries retrieve the relevant passages and a Groq-hosted LLM answers in plain English, backed by a browsable catalog of 58+ citizen rights with voice input and text-to-speech.

The hard part

Keeping answers grounded. Legal text has zero tolerance for hallucination, so retrieval has to surface the exact clause an answer rests on rather than a plausible paraphrase — every response carries its citation back to source.

Result

A legal assistant that turns dense statutory language into answers an ordinary citizen can act on, with the sources to back every claim.

Top