Millions of renters across India face housing crises every day. Illegal eviction notices, landlords refusing to return security deposits, sudden rent hikes, and no written agreements are realities that affect people with no resources to fight back. The systems that exist to protect them are buried in complex legal language, require expensive lawyers to interpret, and are simply not accessible to the people who need them most. A daily wage worker in Delhi or a migrant family in Mumbai has no way to know whether an eviction notice is legally valid, which government scheme they qualify for, or where to go for free legal help, all within the five minutes they have before making a decision that could cost them their home. ClearPath India is an AI-powered housing stability guide built specifically for the Indian renter. It takes a user's housing situation as input through a simple conversational flow, interprets it against the relevant Indian housing law for their city, and delivers a plain-language explanation of what their situation means along with a personalised numbered action plan in both English and Hindi. No legal jargon. No 40-page PDFs. No login required to get started. ClearPath India is a full-stack web application built mobile-first, since the majority of our target users access the internet on smartphones. The frontend is built with React.js via Vite, Tailwind CSS, and React Router v6. We used i18next for full English and Hindi localisation across every screen, with Noto Sans font supporting Devanagari script. The conversational intake UI was designed to feel like a chat rather than a form, with one question at a time, chip selections, and typing animations, to reduce the cognitive load on users who are already stressed. The backend is built with Node.js and Express.js, with MongoDB Atlas as the database and Firebase Authentication handling Google, Phone OTP, and Email login. JWTs are issued server-side and stored in httpOnly cookies for security. The AI layer uses Google Gemini 1.5 Flash via the Gemini API. We implemented a RAG (Retrieval Augmented Generation) approach. Rather than asking the AI to recall Indian housing law from training data, we built a structured legal knowledge base in MongoDB covering the Delhi Rent Control Act 1958, Maharashtra Rent Control Act 1999, Karnataka Rent Control Act 2001, and the Model Tenancy Act 2021. Before each AI call, the backend fetches the relevant law provisions for the user's city and problem type and injects them directly into the prompt. This grounds the AI's response in actual verified legal text rather than hallucinated rules. We also built a complete rule-based fallback system that covers all problem types and cities. If the Gemini API call fails, times out, or returns malformed output, the fallback silently takes over and the user never sees an error. The most significant challenge was multilingual AI output. Getting Gemini to consistently produce grammatically correct, simple Hindi in Devanagari script without slipping into English transliterations or overly formal legal language required careful prompt engineering. We added explicit validation that checks every Hindi output field for Devanagari Unicode characters before accepting the response. The second challenge was building the RAG knowledge base. Indian housing law is fragmented across central acts, state-specific Rent Control Acts, and the newer Model Tenancy Act 2021 which not all states have adopted. Mapping the right law to the right city and problem combination required careful research across multiple official sources including indiacode.nic.in, mohua.gov.in, and nalsa.gov.in. The third challenge was responsible design. Every output the AI produces carries real-world consequences for vulnerable people. We spent significant time designing the language guardrails, ensuring the system never says "you qualify" or "this is illegal" but always uses "you may" and "this may not be valid", and always ends with a human referral. We are most proud of the graceful degradation architecture. The app works end-to-end without AI. The rule-based fallback produces a complete, accurate action plan for every supported city and problem type. The AI is an enhancement, not a dependency. This means users are never left with a broken experience, and it also demonstrates a responsible AI story where the system acknowledges its own limits. We are also proud of the bilingual output quality. Having both English and Hindi generated in a single AI call, with validation ensuring the Hindi is actually Devanagari and not transliterated English, was a non-trivial engineering decision that directly serves our target users. The human referral architecture is something we consider a core feature, not an afterthought. The deliberate decision to always surface a DLSA helpline, NGO contact, or Rent Authority link at the end of every user journey regardless of what the AI says reflects what we believe responsible AI design looks like in practice. We learned that prompt engineering for a specific domain with real legal stakes is fundamentally different from general-purpose AI use. The constraints we placed on the AI, covering language level, hedging requirements, JSON output format, and bilingual structure, each required multiple iterations to get right. We also learned that RAG is far more appropriate than fine-tuning for this use case. Injecting verified legal text into the prompt gives us control over what the AI knows, and updating the knowledge base automatically improves responses without retraining anything. We also learned that the most important design decisions in a tool like this are not technical. They are about what the AI is not allowed to do, and how to make sure a human expert is always one tap away. The immediate next steps for ClearPath India are regional language expansion beyond Hindi, starting with Marathi, Telugu, and Kannada, which directly serve the cities we already cover. We also want to expand the legal knowledge base to cover all 28 states and union territories, and add a document upload feature that lets users photograph an eviction notice or rent agreement and have the AI interpret it directly. Longer term, we want to partner with NALSA and state DSLSAs to provide verified referral data and potentially integrate a direct appointment booking flow with legal aid centres.

Built With

Share this project:

Updates