Inspiration

Every year, ₹65,000+ crore of government benefits go unclaimed in India — not because citizens don't deserve them, but because the system is impossibly complex to navigate. We saw families missing out on free health insurance, farmers unaware of income support, and students losing scholarships to paperwork. CivicAI was born to fix this.

We asked: What if every Indian had a brilliant, knowledgeable friend who could instantly tell them every benefit they qualify for — and then guide them through getting it?

What it does

CivicAI 2.0 is not a chatbot. It is a Multi-Agent AI Decision Infrastructure with 6 specialized AI agents:

  • 🧠 Decision Agent — Analyzes your situation using chain-of-thought reasoning, creates a prioritized action plan with confidence scores and risk assessment
  • 🧾 Eligibility Agent — Hybrid rule-engine + LLM matching that finds every government scheme you qualify for, with exact reasoning ("you qualify because your land is 1.5ha < 2ha limit")
  • 🗺️ Navigator Agent — Converts any scheme into a dynamic step-by-step workflow with pro tips, common mistakes to avoid, document checklists, and progress tracking
  • 🔮 Simulation Agent — Uniquely predicts Best Case / Most Likely / Worst Case outcomes with probability scores before you commit to an application
  • 📂 Document Agent — Upload any government letter or notice; AI extracts deadlines, required actions, and risks in seconds
  • 💬 Chat Agent — Multilingual, context-aware AI chat with voice input support in 11 Indian languages

Every AI response includes:

  • Confidence score (0–1)
  • Reasoning chain (step-by-step thinking)
  • Structured JSON output
  • Explainable decisions

How we built it

Frontend: React 18 + Vite, Tailwind CSS (glassmorphism design), Framer Motion animations, Zustand state management, Recharts for data visualization, React Dropzone for document upload.

Backend: Node.js + Express API with 20+ endpoints, PostgreSQL (Neon) database with 8 tables including JSONB session memory for chat context.

AI Layer: Groq API (LLaMA-3 70B — primary), OpenRouter (fallback), NodeCache for 1-hour response caching. Each agent has custom prompt templates enforcing chain-of-thought reasoning and structured JSON output.

Database: 8 relational tables — Users, Sessions (chat memory), Schemes (10 real government schemes seeded), UserProgress, Documents, Simulations, AICache, Alerts.

Security: JWT authentication, bcrypt password hashing, rate limiting (200 req/15min), Helmet.js headers, CORS protection.

Challenges we ran into

  1. Structured JSON reliability — Getting LLMs to consistently return valid JSON with all required fields took careful prompt engineering. We solved this with strict JSON-mode prompting + field validation + fallback rule-based responses.
  2. Hybrid eligibility matching — Combining hard rule filters (age, income, land size) with AI contextual reasoning without hallucinations required a pre-filter pipeline before AI analysis.
  3. Simulation accuracy — Predicting government application outcomes without historical data needed careful probabilistic framing in prompts to avoid overconfident outputs.
  4. Multilingual AI — Detecting Indian languages (Hindi, Tamil, Telugu, Bengali) and routing responses correctly while keeping scheme names in English.

Accomplishments that we're proud of

  • Built a true multi-agent architecture — not just one LLM call, but 6 specialized agents with different personas, prompts, and output schemas
  • Simulation Engine — we believe this is the first outcome predictor in the civic AI space
  • Hybrid eligibility system — rule engine + AI reasoning delivers both speed and intelligence
  • 100% free stack that can scale to serve millions: Groq (free tier), Neon (free tier), Render (free tier)
  • Production-grade code: 13,000+ lines, error handling, fallbacks, caching, security middleware

What we learned

  • Chain-of-thought prompting dramatically improves AI reliability for structured outputs
  • Hybrid AI systems (rules + LLM) outperform pure LLM for eligibility matching
  • Citizens need explainability more than just answers — showing WHY builds trust
  • The simulation concept resonates deeply: people want to know risks before acting

What's next for CivicAI 2.0

  • State-level schemes database — expand from 10 to 500+ schemes across all Indian states
  • OCR integration — process handwritten documents and physical letters via camera
  • WhatsApp bot — bring CivicAI to feature phones via WhatsApp (750M users in India)
  • Grievance auto-filing — automatically draft and submit RTI applications and complaints
  • Verified outcomes tracking — crowdsourced success/failure data to improve simulation accuracy
  • Offline mode — PWA with cached eligibility rules for zero-connectivity areas

Built With

Share this project:

Updates