NyayaAI
Everyone Deserves Justice.
The problem NyayaAI solves
The Problem it Solves
Accessing legal justice in India is often a daunting, expensive, and time-consuming process. Common people face three major hurdles: Language barriers, Complex Legal Jargon, and Procedural Uncertainty.
NyayaAI bridges this gap by providing an AI-driven legal assistant that simplifies the entire pre-litigation phase:
Language Barrier & Accessibility: Most legal documents and processes are in English, which is a barrier for millions. Our project allows users to describe their problems in their local language (Bengali, Hindi, Hinglish, etc.). The AI understands the context and provides immediate guidance in that same language.
Simplifying Legal Jargon: Legal terms (Sections, Clauses, Acts) are hard to grasp. NyayaAI takes a raw human story and automatically identifies relevant laws and classifications, explaining them in simple terms.
Reducing Cost & Time: Instead of paying high consultation fees just to understand if they have a case, users can use NyayaAI to generate a structured, professional Legal Complaint PDF in English, ready to be submitted to authorities or shared with a lawyer.
Evidence Management: The platform makes it easier to organize evidence (OCR-based document scanning) and creates a chronological timeline of events, making the case much stronger and safer from errors.
How it makes existing tasks easier/safer:
Multilingual Support: It makes the law inclusive. A user can talk to the bot in "Hinglish" or "Bengali," making them feel more comfortable and heard.
Automated Documentation: Traditionally, drafting a complaint requires a lawyer. NyayaAI automates this, ensuring the final PDF is in formal English, following standard legal formatting, regardless of the input language.
Risk & Strength Analysis: It analyzes the case's strength, helping users understand their chances before spending money on litigation.
Safe Evidence Handling: By digitizing and chronologically ordering evidence, it ensures that no critical detail is missed, making the task of building a case much safer and more organized.
Devfolio Submission-er jonno Pro-Tip:
Jokhon apni "How we built it" ba "Challenges we faced" likhben, tokhon ei point gulo mention korte paren:
Tech Stack: React.js, Vite, Claude/Gemini API (for LLM), and OCR technology.
Challenges: Local language nuances detect kora ebong complex legal data-ke simple language-e convert kora.
Challenges we ran into
💡 Challenges I Ran Into
Building NyayaAI was an intense journey of bridging the gap between complex legal jargon and accessible technology. Here are the key hurdles we faced:
- Contextual Language Detection & Mixed Scripts
One of our biggest hurdles was accurately detecting the user's intent when they used "Hinglish" or "Benglish" (mixing local languages with English).
The Problem: Standard NLP libraries often failed to categorize the legal context correctly when the input was a mix of Bengali and English scripts.
The Solution: We implemented a custom logic in our claude.js utility that prioritizes semantic meaning over strict language rules. We also refined our prompts to ensure the AI understands the "emotion" and "legal weight" behind local language descriptions before translating them for internal processing.
- Maintaining Dual-Language State in the UI
Ensuring that the interface responds in the user's local language while keeping the final legal document strictly in English was a state management challenge.
The Problem: Syncing the detected language across all six steps (from classification to risk analysis) without redundant API calls.
The Solution: We utilized a centralized state management approach. Once the language is detected in Step 1, it persists through the workflow, dynamically adjusting the UI components while isolating the PDF generation logic to strictly use English-translated versions of the user's input.
- Real-time OCR Accuracy
Processing legal documents and evidence photos via OCR often resulted in "noisy" text.
The Problem: Low-quality images or handwritten notes made it difficult for the AI to build a chronological timeline.
The Solution: We integrated a multi-pass approach where the OCR output is first "cleaned" by a lightweight LLM pass to fix spelling errors and formatting before it’s used for legal classification or timeline generation.
- Handling Complex Legal Schemas
Translating complex Indian laws (BNS/BPC) into a user-friendly "Risk Score" was difficult.
The Problem: Legal data is dense. Displaying it in a simple dashboard without losing accuracy was tricky.
The Solution: We designed a tiered UI (Step 5) that uses visual tags and progress bars to represent "Winning Probability" and "Risk Analysis," making data-heavy legal info digestible for a common person.
Technologies used