NyayaAI — Judiciary Legal Intelligence System
RAG-driven judicial decision-support, statutory fact extraction, and bail prediction with explainable AI (XAI)

AI/ML Engineer & GenAI Systems Architect • Savitribai Phule Pune University (SPPU)
The Problem Statement
Solution Architecture & Implementation
NyayaAI implements a microservice-driven dual-pipeline architecture. The ingestion tier cryptographically hashes submitted FIRs and pleadings using SHA-256 for chain-of-custody verification. A hybrid retrieval engine (BM25 sparse search coupled with dense Cosine Similarity vectors derived from fine-tuned BERT and Gemini embeddings) queries an indexed statutory corpus. A custom Softmax/Sigmoid classification head estimates bail granting probabilities while an automated 'AI-as-Judge' module synthesizes point-by-point explainable reasoning (XAI) citing exact precedent paragraphs.
+---------------------------------------------------------------------------------------+ | NYAYAAI SYSTEM ARCHITECTURE | +---------------------------------------------------------------------------------------+ | [Case Docket / FIR] ---> [SHA-256 Hash & DPDP Sanitizer] | | | | | +------------v------------+ | | | FastAPIGateway (Async) | | | +------------+------------+ | | | | | +----------------------------+----------------------------+ | | | | | | +-----v----------------------+ +-------------v-----------------+ | | | Dense Vector Embedding | | Bail Scoring Classifier | | | | (Fine-tuned BERT + Gemini) | | (PyTorch Softmax / Sigmoid) | | | +-----+----------------------+ +-------------+-----------------+ | | | | | | +-----v----------------------+ | | | | Hybrid RAG Vector Search | | | | | (Cosine Similarity + BM25) | | | | +-----+----------------------+ | | | | | | | +----------------------------+----------------------------+ | | | | | +-------------v-------------+ | | | Groq Ultra-Low Latency | | | | Llama 3 70B Orchestrator | | | +-------------+-------------+ | | | | | +-------------------------v-------------------------+ | | | Explainable AI (XAI) Legal Report & Precedent Map | | | +---------------------------------------------------+ | +---------------------------------------------------------------------------------------+
Key Engineering Innovations
Cryptographic Chain-of-Custody: Document integrity preserved using SHA-256 fingerprinting, ensuring zero evidence tampering in alignment with India's DPDP Act 2023.
Sub-Second LPU Execution: Integrated Groq API for inference acceleration, driving latency down from 4.2 seconds to 820ms on longform legal summaries.
Transparent XAI Attribution: Replaced black-box LLM generation with strict citation anchoring, returning exact statutory sections and Supreme Court case numbers.
Dual-Head Classification: Fine-tuned PyTorch classification head predicting bail hearing outcomes with ~85% empirical accuracy on historical case datasets.
Performance Benchmarks & Empirical Impact
| Metric | Before / Baseline | Engineered | Net Impact |
|---|---|---|---|
| Precedent Research Time | 4.5 Hours | 28 Seconds | 99.8% Time Saved |
| Bail Classification Accuracy | 61% (Heuristic) | 85.2% (BERT) | +24.2% Precision |
| Document Verification Latency | 18.0s (Manual) | 0.82s (FastAPI) | 21.9x Throughput |
| Statutory Hallucination Rate | 14.8% (Vanilla LLM) | <0.6% (Strict RAG) | Production-Grade Trust |
Technology Stack Architecture
Core Backend & APIs
Machine Learning & NLP
Vector Retrieval & Data
Security & Compliance
Looking for an AI/ML Engineer or GenAI Consultant?
Yash Jondhale delivers production-ready RAG pipelines, FastAPI microservices, and computer vision systems. Available for machine learning roles and enterprise AI advisory.