In late 2023, India witnessed a monumental shift in its legal framework. The colonial-era Indian Penal Code (IPC 1860) was officially replaced by the new Bharatiya Nyaya Sanhita (BNS 2023). Nyaya Sahayak is an AI legal assistant that helps citizens navigate India's transition from the IPC to the BNS through interactive chat, scenario comparisons, section translations, and scheme eligibility matching. We built Nyaya-Sahayak using Apache Spark and Delta Lake in a Medallion Architecture, integrated Databricks AI Vector Search for semantic retrieval, and used Sarvam AI LLMs in a RAG pipeline, deployed via Databricks Apps with fallback reliability. Parsing unstructured, inconsistent colonial-era IPC PDFs into clean data required complex PySpark pipelines. Additionally, preventing the AI from hallucinating sensitive legal advice forced us to engineer strict RAG prompt boundaries. Finally, we built local fallbacks to ensure absolute zero downtime. We explored an alien platform that we never used, i.e., Databricks. worked on the data lakehouse that seamlessly manages CDC. We built an end-to-end application for data processing, ingestion, retrieval, and deployment using Databricks tools. Using an AI-backed system in a slow legal and judicial process can significantly improve efficiency, impact millions of users, and enable a smoother transition from the Indian Penal Code (IPC) to the Bharatiya Nyaya Sanhita (BNS). It can assist law enforcement agencies, the judiciary, and public institutions in delivering faster, more accurate, and accessible legal services.
In future, we plan to extend Nyaya-Sahayak with agentic capabilities, enabling autonomous multi-step legal reasoning and task execution. We aim to improve retrieval using advanced hybrid and re-ranking techniques, and incorporate reinforcement learning from historical case data to enhance accuracy.
Additionally, we plan to build an end-to-end agentic charge-sheet generator, which can assist law enforcement and legal professionals in drafting structured legal documents. This system can also empower citizens by improving awareness of their legal rights and providing guided legal assistance.
Built With
- deltalakes
- particle
- rag
- sarvam
Log in or sign up for Devpost to join the conversation.