About Nyaya-Sahayak Inspiration India's transition from the colonial Indian Penal Code (IPC) to the Bharatiya Nyaya Sanhita (BNS) in 2023 marked a historic shift toward a justice system rooted in Indian values. However, this change created an immediate accessibility gap:

Citizens lack clarity on how new laws affect them Junior lawyers struggle to navigate the updated legal framework Rural communities remain unaware of government schemes designed to help them Language barriers exclude non-English speakers from legal information Nyaya-Sahayak was born from the conviction that technology should democratize justice, not concentrate it. We built this project to ensure that every Indian—regardless of education level, location, or language—can understand their legal rights.

What We Learned Legal complexity requires intelligent retrieval: Generic search fails for nuanced legal queries. We learned that RAG (Retrieval-Augmented Generation) combined with legal-specific embeddings dramatically improves answer relevance.

Language is non-negotiable in India: English-only legal tools exclude 80%+ of India's population. Building with IndicTrans2 for Hindi/Indian language support transformed our project's reach.

Trust in AI + Law is paramount: Users need citations, section references, and clear disclaimers. We integrated source attribution and confidence scoring throughout.

Government schemes are invisible without search: Citizens don't know about welfare programs designed for them. Our eligibility checker bridges this critical gap.

How We Built It ┌─────────────────────┐ │ User Queries │ │ (Hindi/English) │ └──────────┬──────────┘ │ ▼ ┌─────────────────────┐ │ IndicTrans2 │ │ (Multilingual) │ └──────────┬──────────┘ │ ▼ ┌─────────────────────┐ │ RAG Pipeline │ │ - Vector DB │ │ - Dense Retrieval │ └──────────┬──────────┘ │ ┌────┴────┬──────────┬──────────┐ ▼ ▼ ▼ ▼ ┌──────┐ ┌──────┐ ┌──────────┐ ┌─────────┐ │ BNS │ │ Const│ │ IPC→BNS │ │ Schemes │ │2023 │ │itution│ │ Mapping │ │ DB │ └──────┘ └──────┘ └──────────┘ └─────────┘ │ │ │ │ └────┬────┴──────────┴──────────┘ │ ▼ ┌─────────────────────┐ │ LLM (with context) │ │ (Claude/Llama) │ └──────────┬──────────┘ │ ▼ ┌─────────────────────┐ │ Response + Sources │ │ (Hindi/English) │ └─────────────────────┘

Architecture Key Components

  1. Data Pipeline

Ingested BNS 2023 full text, Constitution, and gov_myscheme dataset Built legal embeddings using domain-specific models (BhashaBench-Legal) Created vector database (Pinecone/Weaviate) with section-level granularity

  1. RAG Engine

Dense retrieval for multi-hop legal queries Hybrid search combining semantic + lexical matching Reranking for relevance in legal context

  1. Multilingual Layer

IndicTrans2 for Hindi ↔ English translation Maintained legal terminology accuracy Support for regional languages (Tamil, Telugu, Kannada, Bengali)

  1. Feature Modules

BNS Explainer Chatbot: Contextual Q&A with section references Scheme Eligibility Checker: Rule-based matching with gov schemes IPC → BNS Comparison Tool: Side-by-side clause mappings with implications Challenges We Faced

  1. Legal Domain Complexity Problem: Generic LLMs hallucinate on legal details Solution: Fine-tuned on legal corpus, enforced citation-backed responses, added confidence thresholds
  2. Translation Quality in Legal Context Problem: IndicTrans2 struggled with legal jargon (e.g., "habeas corpus" → अस्पष्ट हिंदी) Solution: Built legal term glossary, post-processed translations, human validation
  3. Data Sparsity for New Laws Problem: BNS is new; limited interpretative case law exists Solution: Augmented with constitutional principles, legislative intent, expert annotations
  4. Rural Accessibility Problem: Scheme eligibility involves complex eligibility criteria Solution: Simplified UI, voice interface exploration, conversational flow design
  5. Accuracy vs. Accessibility Trade-off Problem: Legal precision requires caveats; users want simple answers Solution: Layered responses (simple summary → detailed explanation → legal caveat) Impact Vision By 2025, Nyaya-Sahayak aims to:

Enable 100,000+ citizens to self-serve on basic legal queries Reduce junior lawyer research time by 40% through automated clause comparison Increase government scheme enrollment by 25% via awareness Establish a benchmark for AI in Indian legal tech

Built With

Share this project:

Updates