Skip to content
SAPTARSHI-coderPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

🏛️ CivicAI

An AI-Powered Civic Intelligence, Document Verification & Welfare Entitlement Engine

React FastAPI Gemini Ollama License

Empowering 1.4 billion citizens to demystify complex government paperwork, verify citizen documents, check multi-scheme welfare eligibility, and generate actionable Common Service Centre (CSC) dossiers in their native language.

Built & Maintained by Saptarshi Sadhu


🌟 What Makes CivicAI a Full Civic Platform

CivicAI has evolved from a simple document explainer into a comprehensive, multi-module Civic Tech Intelligence Suite:

1. 📄 Deep Document Scanner & Classifier

  • Automatic Classification: Instantly detects whether an uploaded PDF/image is an Aadhaar Card, PAN Card, Ration Card, Income Certificate, Caste Certificate, Land Record (Patta/RoR), or Scheme Circular.
  • OCR Fallback Pipeline: Uses PyMuPDF with automatic pytesseract computer vision OCR fallback for low-quality scanned photocopies.
  • Security & Freshness Verification: Flags critical notices such as UIDAI 10-year document re-validation warnings, biometric locking advice, and PAN-Aadhaar inoperability risks.

2. 🎯 Multi-Criteria Eligibility Engine & Benefit Estimator

  • Personalized Household Evaluation: Input demographic attributes (Age, Occupation, Family Income, Rural/Urban Setting, Social Category, Land Holdings, and Current Paperwork).
  • Match Scoring: Algorithmically evaluates eligibility across central and state welfare programs with exact percentage match scores and breakdown of satisfied vs. missing criteria.
  • Financial Benefit Calculation: Estimates total potential annual financial assistance (in ₹ INR) across Direct Benefit Transfers (DBT), health coverage, subsidies, and grants.

3. 📚 National Welfare Knowledge Base

  • Searchable and categorized directory of major Indian public welfare schemes (PM-KISAN, Ayushman Bharat PM-JAY, PMAY-Gramin, PMAY-Urban, National Scholarship Portal, PM SVANidhi, MGNREGA, Sukanya Samriddhi, Atal Pension Yojana, PM Mudra, PM Vishwakarma).
  • Full application roadmaps, required documentation checklists, official application portal links, and national toll-free helplines.

4. 🖨️ Citizen Entitlement Dossier Generator

  • One-click generation of an official Citizen Action Summary & CSC Submission Dossier.
  • Formatted with print-ready styling (window.print()) for Common Service Centre (CSC) operators, Village Panchayat Pramukhs, and citizens to take directly to administrative offices.

5. 🧠 Dual AI Inference Architecture

  • ☁️ Cloud Speed (Google Gemini API): Low-latency cloud intelligence with strict system instruction guardrails.
  • 🔒 Local Privacy (Ollama + Gemma 4): On-device private inference for sensitive citizen identity documents without external data transmission.

6. 🗣️ Multilingual & Voice Accessibility

  • Native language explanations and text-to-speech synthesis across English, हिन्दी (Hindi), বাংলা (Bengali), தமிழ் (Tamil), తెలుగు (Telugu), ଓଡ଼ିଆ (Odia), and more.

🏗️ Architecture

                    ┌────────────────────────────┐
                    │      Citizen User / CSC    │
                    └─────────────┬──────────────┘
                                  │
                                  ▼
                   ┌──────────────────────────────┐
                   │    React + Vite Frontend     │
                   │ (Framer Motion, IBM Plex)    │
                   └──────────────┬───────────────┘
                                  │  /api/v1/proxy
                                  ▼
                   ┌──────────────────────────────┐
                   │       FastAPI Backend        │
                   └──────┬───────┬───────┬───────┘
                          │       │       │
       ┌──────────────────┘       │       └──────────────────┐
       ▼                          ▼                          ▼
┌──────────────┐         ┌─────────────────┐       ┌──────────────────┐
│  Doc Parser  │         │  Schemes RAG &  │       │  Dual AI Engine  │
│  & OCR Unit  │         │  Rules Database │       │  (Gemini/Gemma)  │
└──────────────┘         └─────────────────┘       └──────────────────┘

🚀 Getting Started Locally

1. Prerequisites

  • Node.js (v18+)
  • Python (v3.10+)
  • Tesseract OCR (brew install tesseract on macOS or sudo apt install tesseract-ocr on Linux)

2. Backend Setup

cd backend

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Open .env and set your GEMINI_API_KEY

# Run server
uvicorn app.main:app --reload --port 8000

Backend runs at http://localhost:8000 (Swagger docs at http://localhost:8000/docs).

3. Frontend Setup

cd frontend

npm install
npm run dev

Frontend runs at http://localhost:5173 (proxies /api to port 8000).


🔌 API Endpoints Reference

Method Endpoint Description
POST /api/v1/analyze Parse PDF/image, classify doc type, generate plain-language explanation & checklist
POST /api/v1/chat Contextual conversational follow-up on uploaded document
GET /api/v1/schemes Search & filter welfare schemes directory
GET /api/v1/schemes/{id} Detailed scheme criteria, required docs, and steps
POST /api/v1/schemes/evaluate Multi-criteria citizen profile evaluation & benefit calculation
POST /api/v1/dossier/generate Formatted Citizen Entitlement Dossier for printing/CSC submission
GET /api/v1/samples Bundled demo documents (PMAY, NSP, PM-KISAN, PM-JAY)
GET /api/v1/health System and AI provider health probe

📄 License & Attribution

Distributed under the MIT License. Developed and maintained by Saptarshi Sadhu.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages