NYAYSETU
SIMPLIFYING LAWS FOR INDIANS
The problem NYAYSETU solves
The Problem It Solves
Many people in India struggle to understand legal rights and court procedures. Legal help is costly, processes are slow, and citizens don’t have access to expert advice or case histories. Judges also waste time organizing paperwork and searching for old cases.
What People Can Use It For
Understand Your Rights: Anyone can enter their problem (like dowry, property, or job harassment) and get an instant, AI-powered legal explanation in simple language.
Find Similar Cases: Citizens see real or AI-generated cases like theirs, including outcomes and the main reasons for winning or losing.
Get Legal Steps: The platform suggests clear, practical next steps for your situation—what documents you’ll need, which offices to visit, and how to start.
Ask for Help Safely: No need to visit a lawyer for every question—first advice comes within seconds, anonymously and for free.
For Judges: Judges can quickly organize case summaries, check document lists, and find relevant court precedents in one place.
How It Makes Life Easier & Safer
Saves Time: No endless Google searches, visits to lawyers, or confusing paperwork.
Reduces Mistakes: AI ensures you know your basic legal rights and required steps, reducing costly errors.
Safer for Vulnerable People: Victims of domestic abuse or fraud can get fast, private guidance.
Faster for Courts: Judges are less likely to miss documents or make avoidable delays.
Fairer Access: Makes legal help available to everyone, not just experts or the rich.
Challenges we ran into
Challenges I Ran Into
- Handling Undefined or Missing Data
Many functions were failing because input variables like problem or lawCategory were sometimes undefined.
Trying to call methods like .toLowerCase() on undefined caused runtime errors.
How I solved it: Added robust safety checks and default empty strings ("") before using variables. Added .toString() conversions to avoid non-string errors.
- Parsing AI Responses from Gemini API
Gemini API returns free-text responses; sometimes it included extra text or formatting around JSON arrays.
Extracting AI-generated case JSON reliably was hard due to unstructured responses.
How I solved it: Used regex to extract JSON arrays from API text, added try/catch error handling to prevent crashes, and fallback default cases.
- "Could Not Generate" AI Explanation
Sometimes the AI API returned no useful explanation due to API key, quota limits, or prompt design.
How I solved it: Improved error handling to show detailed API error messages in logs and UI. Also rewrote prompts to be more explicit and detailed to generate better AI output.
- Deployment Issues With Google Apps Script
Received errors like “Script function not found: doGet” when deploying web app.
How I solved it: Added mandatory doGet() and doPost() functions with safe error handling. Ensured these functions were saved and deployed with the latest code.
- AI and Database Integration Logic
Balancing between returning database matches and AI-generated fallback cases was tricky.
How I solved it: Clearly defined fallback logic where if the database returns no matches, AI generates realistic hypothetical cases dynamically.
Tracks Applied (1)
Education & Skilling
Technologies used