Nyaya Sahayak
A privacy-first legal assistant for Indian practice. It keeps the language model on your own machine and still does the work end to end, built as an agentic RAG system.
How it works
- It runs locally through Ollama, so client data stays on the lawyer's machine. Heavier reasoning goes to Llama 3.3 70B on Groq when speed matters.
- Three pipelines share one engine: a research pipeline (about six agents that retrieve, draft and check), a courtroom pipeline (speaker diarisation with PyAnnote and live contradiction alerts), and a simplifier that turns legalese into plain language.
- Answers are grounded with agentic RAG and a second verification pass. Every claim is labelled [FROM RAG] or [FROM WEB], and a separate agent resolves conflicts between web results and the actual text of an act.
- Built on FastAPI, with LangGraph and CrewAI for orchestration and SQLite for state. Documents are chunked into 500-character segments to stay inside context limits.
Results
- Phi-3 could not hold the agentic flow. A smaller local Llama worked but took minutes per answer. Moving heavy reasoning to Groq's 70B brought it down to 90 to 180 seconds, fast enough for a real session.
- The team measured roughly a 70% cut in legal-research time on the research pipeline.
- My part was the retrieval and grounding design, Approaches 1 and 2 in the team deck.
Slides
The full project deck. You can read it right here.