Here is a complete, polished draft for your hackathon submission (perfect for Devpost or GitHub). It weaves together the core mission of your app, the advanced "Translation Sandwich" architecture, and the intense technical debugging we just conquered.
Inspiration In rural India, accessing government services or applying for Gram Panchayat schemes often requires written literacy and navigating complex bureaucratic forms. This creates a massive barrier for citizens, forcing them to rely on middlemen. We wanted to bridge this gap by creating JanMitra—a voice-first, native-language AI assistant. Our goal was to empower every citizen to lodge grievances, make requests, or apply for loans simply by speaking into their phone in their mother tongue, while providing village administrators with clean, standardized, English-language dashboards.
What it does JanMitra acts as an intelligent, multilingual digital intermediary between villagers and the Gram Panchayat.
Voice-First Input: A villager records a single voice note in their native language (e.g., Hindi, Marathi, Telugu) outlining a problem or a loan request.
Intelligent Routing: The system categorizes the intent (Grievance vs. Loan Application), calculates the sentiment, and assesses the severity (Low to Critical).
Dynamic Follow-ups: If a citizen applies for a loan but forgets key details (like the amount or their land-holding size), JanMitra generates a follow-up question and asks the citizen in their native language.
Secure Storage: All completed applications and grievances are saved securely into a standardized English database for the Village Head to review.
How we built it We built a highly secure, privacy-first architecture using React/Next.js for the frontend and Databricks for our AI backend.
Authentication: We used Clerk to handle edge authentication, assigning strict roles (villager vs village_head) before any data hits our servers.
Storage: We utilized Databricks Delta Lake to build our bronze_cases and bronze_loan_requests tables, ensuring ACID compliance.
The "Translation Sandwich" AI Pipeline: To avoid the high costs and privacy concerns of closed-source APIs (like OpenAI), we built a 100% locally-run pipeline:
Whisper (Small): Transcribes the native spoken audio into text.
IndicTrans2 (AI4Bharat): Translates the native regional text into English.
Param-1-2.9B-Instruct (BharatGen AI): Our core reasoning engine. It reads the English text, extracts the complex JSON entities, and formulates logical follow-ups.
IndicTrans2 (Reverse): Translates the follow-up questions back into the villager's dialect.
Challenges we ran into We faced severe "dependency hell" when trying to run open-source models natively on our Databricks cluster.
We initially struggled with KeyError: 'type' and KeyError: 'factor' crashes. We realized that the newest Hugging Face transformers updates introduced strict new auto-injected RoPE (Rotary Position Embedding) scaling objects that clashed with Param-1's custom Python modeling scripts.
The Fix: Instead of endlessly downgrading libraries, we reverse-engineered the model loading process. We successfully wrote a runtime monkey-patch using AutoConfig to intercept the configuration in-memory, explicitly setting rope_scaling = None to bypass the buggy custom checks before injecting it into the model.
We also had to navigate strict Databricks Unity Catalog security features, bypassing locked /dbfs/ mounts by dynamically routing our temporary audio processing through the cluster's secure local node storage.
Accomplishments that we're proud of Data Privacy: We successfully deployed a robust, state-of-the-art AI pipeline that runs entirely on local compute. No citizen data is sent to third-party APIs.
Beating LLM Hallucinations: By separating translation (IndicTrans2) from reasoning (Param-1), we prevented the 2.9B parameter model from hallucinating or breaking its JSON output. Letting the LLM focus purely on logic in English while IndicTrans2 handled the heavy lifting of Indian dialects yielded flawless results.
Stateless Architecture: We built a highly scalable backend API that handles complex state (like successive audio context for incomplete loans) without relying on brittle session trackers.
What we learned We learned that Large Language Models aren't just "magic boxes"—they are delicate software engines. We gained deep, hands-on experience in managing tokenizers, intercepting Hugging Face configurations, and resolving deep library conflicts. We also learned that for regional Indian languages, decoupled, specialized architectures (Translation + Small LLM + Reverse Translation) are vastly superior to relying on a single massive generalist model.
What's next for JanMitra Cross-referencing Datasets: Integrating external datasets (like BNS 2023 texts or UPI transaction logs) to automatically flag fraudulent loan applications or cross-check legal grievance codes.
Text-to-Speech (TTS): Implementing an Indic-TTS model so JanMitra can physically speak the translated follow-up questions out loud to the villagers, removing the need for them to read the screen at all.
Real-time Endpoints: Moving our batch-processing Databricks notebooks into a fully managed Databricks Model Serving Endpoint for instantaneous frontend response times.
Scaling: Expanding the IndicTrans2 layer to support all 22 official languages of India seamlessly.
Log in or sign up for Devpost to join the conversation.