JanSaathi AI โ Autonomous Multilingual Grievance Resolution Agent
Link to open source: https://github.com/YaduvanshiHimanshunfsu/JanSaathi-AI
Developed by Himanshu Yadav | GDG Lucknow APL Hackathon
เคธเฅเคจเคตเคพเค SunwAI is a premium, resilient, autonomous multi-agent grievance orchestration and resolution ecosystem specifically optimized for Uttar Pradesh's metropolitan municipalities. Built to solve delayed routing, officer fatigue, and language accessibility, SunwAI auto-classifies vernacular complaints (English, Hindi, Hinglish), routes them to the least-loaded officer with predictive SLAs, and autonomously follows up while keeping citizens updated through real-time native SMS messages.
For highly detailed documentation covering the full Problem Statement, Approach, and Cybersecurity methods, please see the docs/ folder in this repository.
This project was built iteratively to tackle the massive bureaucratic bottlenecks present in India's public complaint portals. We successfully evolved the system from a fast MVP (Version 1) to a highly secure, scalable, and intelligent ecosystem (Version 2).
The original version of SunwAI was focused entirely on proving the Multi-Agent Concept.
- Goal: Demonstrate that AI agents can talk to each other and handle basic public routing.
- Tech Stack: FastAPI + basic HTML/JS + Gemini 1.5 Flash.
- Workflow: A user could type a complaint in Hinglish, and a simple linear chain of 4 AI Agents (Intake -> Classify -> Route -> Comm) would process it and output a mocked ticket.
- Limitations: No security. No database. The APIs were completely open, vulnerable to LLM injection, spammers, and malicious DDOS actors. It was highly susceptible to duplicate ticketing (e.g. 5 neighbors reporting the same pothole).
Today, the entire system architecture was rewritten and heavily upgraded for production-grade cybersecurity, web stability, and advanced agentic analysis.
- Gemini 2.5 Flash Upgrade: Entire backend pipeline migrated from the deprecated
gemini-1.5-flashmodel directly togemini-2.5-flash, significantly boosting reasoning speed, Hinglish parsing accuracy, and eliminating silent API 404 drops. - Citizen Credibility Index (Section 8): Implemented a robust 0-100 credibility scoring algorithm. The AI analyzes if OTP is verified, word count density, geospatial tagging, distress scoring, and duplication flags to assign a priority status (Low, Medium, High, Verified) to prevent malicious or manufactured urgency attacks.
- OTP & JWT Secure Tunneling (Section 4 & 5):
- Introduced simulated mobile OTP generation and verification barriers on the frontend before allowing grievance submissions.
- Replaced flat JSON authentication with JWT tokenized sessions.
- All API keys safely stripped from the frontend and secured purely in
main_secure.py.
- Prompt Injection & Spam Defense: Introduced
PromptSecurityAgentas "Agent 0" to block adversarial LLM injections, and upgradedIntakeAgentV2with aggressive duplication detection (MD5 hashing) and heuristic spam blockers. - Dynamic Incident Clustering: The new
IncidentClusterAgentidentifies localized micro-outbreaks (e.g., three people reporting a water leak on the same street) and links them to a single parent ticket. - Frontend Address Geocoding: Enhanced the public form to capture and inject exact string addresses invisibly into the AI's contextual context layer.
Citizen Grievance Submission (English / Hindi / Hinglish) + OTP Verification
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 0. Prompt Security Agent โ Blocks malicious injections & threats
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. Intake Agent V2 โ Cleans Hindi dialects, strips spam & dupes
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 2. Classification Agent V2โ LLM extracts categories, tags geo-loc
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 3. Sentiment Agent โ Evaluates distress levels & tone
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 4. Routing Agent โ Assigns least-loaded in-charge officer
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 5. Incident Cluster Agent โ Groups similar nearby complaints together
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 6. Communication Agent โ Compiles warm native Hindi SMS alerts
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Ensure your current directory is the root directory of the project: E:\GDG LUCKNOW\Jansathi-AI.
Open a terminal and execute:
cd backend
# Make sure to activate your virtual environment if not active:
# ..\venv\Scripts\Activate.ps1
# Install requirements (including newly added PyJWT)
pip install -r requirements_v2.txt
# Boot the new secure server
python -m uvicorn main_secure:app --reload --port 8000
The backend server will successfully start listening on http://localhost:8000.
Open a second terminal tab and execute:
cd frontend
python -m http.server 5500
The Web App will run instantly on http://localhost:5500/.
To access the administrative Officer Control Dashboard, a secure glassmorphic gate has been implemented:
- Government Portal Page: Click Officer Panel in the navigation bar.
- Credentials Check:
- Test Login: Under the new JWT system, the hardcoded admin is
admin/admin123.
- Test Login: Under the new JWT system, the hardcoded admin is
- Team Name: ATHU
- Developer: Solo; Himanshu Yadav
- Hackathon: GDG Lucknow APL Hackathon ๐
- Corpus Repository: JanSaathi-AI
This build was uploaded as a hackathon project

