Bridging Officials and Government Services through Intelligent Technology
โ Vector-powered search using:
- ๐ง Semantic embeddings with
Xenova/all-MiniLM-L6-v2+ multilingual transformers - ๐ Location-based filtering (state/district)
- ๐ค Profile-based personalization
- ๐ฏ Real-time eligibility checking
{
"query": "education scholarship scheme west bengal",
"results": [
{
"name": "Swami Vivekananda Merit-cum-Means Scholarship (SVMCM)",
"eligibility_score": 0.92,
"benefits": "Financial assistance up to โน60,000 per year for meritorious students pursuing higher education"
}
]
}
Powered by Google Gemini + Hugging Face Models with comprehensive knowledge:
- ๐ฅ Healthcare & Insurance (Ayushman Bharat, PMJJBY)
- ๐ Education & Scholarships (NSP, PM YASASVI)
- ๐ผ Employment & Skills (MGNREGA, PMKVY)
- ๐ฐ Financial Services (Jan Dhan, Mudra Loans)
- ๐ Digital Services (Aadhaar, PAN, Passport)
{
"query": "West Bengal education scholarship schemes",
"response": "Available schemes: Swami Vivekananda Merit-cum-Means Scholarship (up to โน60,000/year), Kanyashree Prakalpa (โน25,000 one-time grant), Aikyashree Minority Scholarship (โน12,000โโน30,000 depending on level)"
}Press 1 for scheme information
Press 2 for eligibility check
Press 3 to speak with AI assistant
Supports keypad phones with:
- ๐ Twilio Voice API integration
- ๐ Ngrok tunneling for local development
- ๐ฃ๏ธ Text-to-Speech with IndicTrans2 for Indian languages
- ๐ DTMF navigation for feature phones
- ๐ง Hugging Face models for voice processing
Smart form assistance using:
- ๐๏ธ Tesseract OCR for document scanning
- ๐ง AI-powered field extraction
- ๐ Step-by-step form filling guidance
- ๐ Audio instructions via TTS
{
"extracted_fields": ["name", "aadhaar", "income"],
"help_text": "Fill Aadhaar as 12-digit number without spaces",
"audio_url": "/audio/form_help_hindi.mp3"
}Role-based social features:
- ๐ฌ Community posts and discussions
- ๐ท๏ธ Special badges for govt officials & NGOs
- ๐ AI sentiment analysis of community feedback
- ๐ซ Hate speech detection and moderation
- ๐ Real-time notification system
| Layer | Technology | Purpose |
|---|---|---|
| ๐จ Frontend | React 19 + Vite + Tailwind CSS | Modern responsive UI |
| ๐ง Backend | Node.js + Express + MongoDB | RESTful API & data management |
| ๐ง AI Services | FastAPI + Python + Transformers | ML/AI processing pipeline |
| ๐๏ธ Database | MongoDB Atlas + Vector Search | Semantic scheme discovery |
| ๐ Voice | Twilio + Ngrok | IVR calling system |
| ๐ Translation | IndicTrans2 + Google Translate | Multi-language support |
| ๐ค ML Models | Hugging Face + Custom Models | NLP & Computer Vision |
| ๐ Auth | JWT + bcrypt | Secure authentication |
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ React Frontend โโโโโโ Node.js Backend โโโโโโ FastAPI AI Hub โ
โ (Port 3000) โ โ (Port 5000) โ โ (Port 8000) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโ MongoDB Atlas โโโโโโโโโโโโโโโโ
โ (Vector Search) โ
โโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Twilio IVR System โ
โ (Ngrok Tunneling) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
Node.js 18+, Python 3.9+, MongoDB Atlas account
Twilio account, Google API keys, Ngrokcd backend
npm install
cp .env.example .env
# Configure: MONGODB_URI, JWT_SECRET, CORS_ORIGIN
npm run dev # Runs on port 5000cd frontend
npm install
cp .env.example .env
# Configure: VITE_BACKEND_URL, VITE_GEMINI_API_KEY
npm run dev # Runs on port 3000cd fastAPI
python -m venv myenv
source myenv/bin/activate # Windows: myenv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Configure: GOOGLE_API_KEY, BACKEND_URL
python -m uvicorn app.main:app --reload # Runs on port 8000# Install ngrok globally
npm install -g ngrok
# Expose FastAPI to internet
ngrok http 8000
# Configure Twilio webhook URL:
# https://your-ngrok-url.ngrok.io/ivr/voice| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auth/register |
User registration |
| POST | /api/v1/auth/login |
User login |
| GET | /api/v1/auth/me |
Get current user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/schemes |
List all schemes |
| POST | /api/v1/schemes/search |
Vector search schemes |
| GET | /api/v1/schemes/eligible/me |
Get eligible schemes |
| Method | Endpoint | Description |
|---|---|---|
| POST | /chat |
AI assistant chat |
| POST | /analyze-form |
OCR + form help |
| POST | /detect-hatespeech |
Content moderation |
| POST | /translate |
Text translation |
| Method | Endpoint | Description |
|---|---|---|
| POST | /ivr/voice |
Twilio voice webhook |
| POST | /ivr/gather |
DTMF input processing |
| GET | /ivr/tts/{text} |
Text-to-speech audio |
// Semantic scheme matching with state-of-the-art embeddings
const embedder = await pipeline("feature-extraction", "Xenova/all-MiniLM-L6-v2");
const queryEmbedding = await embedder(userQuery);
const results = await collection.aggregate([
{
$vectorSearch: {
queryVector: queryEmbedding,
path: "embedding",
numCandidates: 200,
limit: 5
}
}
]);# IndicTrans2 for Indian languages
from IndicTransToolkit import IndicProcessor
ip = IndicProcessor(inference=True)
input_sentences = ["Government scheme information"]
batch = ip.preprocess_batch(input_sentences, src_lang="eng_Latn", tgt_lang="hin_Deva")
translated = model(batch)
output = ip.postprocess_batch(translated, lang="hin_Deva")# Hugging Face Transformers integration
from transformers import pipeline, AutoTokenizer, AutoModel
# Sentiment analysis for community posts
sentiment_analyzer = pipeline("sentiment-analysis",
model="cardiffnlp/twitter-roberta-base-sentiment-latest")
# Multilingual embeddings
embedding_model = AutoModel.from_pretrained("sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2")
# Google Gemini for conversational AI
model = genai.GenerativeModel('gemini-1.5-flash')
response = model.generate_content(f"""
You are an Indian Government Services Assistant.
Query: {user_query}
Schemes: {relevant_schemes}
Respond directly with helpful information.
""")# Advanced document processing pipeline
import pytesseract
from PIL import Image
from transformers import pipeline
# OCR with preprocessing
ocr_result = pytesseract.image_to_string(preprocessed_image, lang='eng+hin+ben')
# Document classification
doc_classifier = pipeline("image-classification",
model="microsoft/dit-base-finetuned-rvlcdip")
# Form field extraction with NER
ner_pipeline = pipeline("ner",
model="dbmdz/bert-large-cased-finetuned-conll03-english")
fields = ner_pipeline(ocr_result)# Custom hate speech detection model
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
# Load pre-trained models
tfidf = pickle.load(open('vectorizer.pkl', 'rb'))
hate_model = pickle.load(open('model.pkl', 'rb'))
# Multi-language hate speech detection
transformed_text = transform_text(user_input)
vector_input = tfidf.transform([transformed_text])
is_hate_speech = hate_model.predict(vector_input)[0]| Role | Permissions | UI Features |
|---|---|---|
| ๐ค Citizen | View schemes, apply, community posts | Standard interface |
| ๐๏ธ Govt Official | Manage schemes, approve applications | Gold highlighting, admin badge |
| ๐ค NGO | Create schemes, community engagement | Green highlighting, NGO badge |
| โก Admin | Full system access, user management | Red highlighting, admin badge |
- Responsive design for desktop/mobile
- Progressive Web App (PWA) ready
- Offline scheme browsing capability
๐ User calls Twilio number
โ
๐ต Welcome message in preferred language
โ
๐ข DTMF menu options
โ (Press 1)
๐ Scheme information service
โ (Press 2)
โ
Eligibility checking
โ (Press 3)
๐ค AI assistant conversation
- Touch-friendly interface
- Voice input support
- Camera document scanning
- Push notifications
// JWT-based security
const token = jwt.sign({ userId, role }, JWT_SECRET, { expiresIn: '7d' });
// Role-based access control
const hasPermission = user.permissions.includes('manage_schemes');# Hate speech detection
transformed_text = transform_text(user_input)
vector_input = tfidf.transform([transformed_text])
is_hate_speech = hate_model.predict(vector_input)[0]- GDPR-compliant data handling
- Encrypted sensitive information
- Audit logs for all operations
- User consent management
| Traditional Process | With GovInsight Pro | Improvement |
|---|---|---|
| Manual scheme search | AI-powered discovery | 10x faster |
| Language barriers | Multi-lingual support | 100% accessible |
| Complex forms | OCR + AI assistance | 80% error reduction |
| Limited access | IVR for feature phones | Universal reach |
| Scattered information | Unified platform | Single source of truth |
POST /api/v1/schemes/search
{
"query": "education scholarship odisha",
"user_profile": {
"state": "Odisha",
"category": "student",
"income": 150000
}
}
POST /chat
{
"message": "เคฎเฅเคเฅ เคเคพเคคเฅเคฐเคตเฅเคคเฅเคคเคฟ เคฏเฅเคเคจเคพ เคเคพเคนเคฟเค",
"language": "Hindi"
}POST /analyze-form
{
"image_data": "base64_encoded_image",
"language": "Bengali"
}# Backend tests
cd backend && npm test
# AI services tests
cd fastAPI && python test_services.py
# Frontend tests
cd frontend && npm run test# Production build
npm run build
# Docker deployment
docker-compose up -d
# Environment setup
cp .env.production .env- Scheme discovery success rate
- User engagement analytics
- IVR call completion rates
- AI response accuracy scores
- Community sentiment trends
// Structured logging
logger.info('Scheme search', {
userId,
query,
resultsCount,
responseTime: Date.now() - startTime
});๐ Monitoring & Logging
| Tool | Purpose | Example Metrics / Logs |
|---|---|---|
| Prometheus | Metrics collection | API latency, request count, DB query time |
| Grafana | Dashboards & alerts | API health, inference latency, IVR funnel |
| Loki | Centralized logging | Errors, OCR failures, Twilio webhook logs |
| Tempo | Distributed tracing | End-to-end request traces across services |
| Sentry | Error monitoring | Backend crashes, React errors |
- ๐ Direct government API integrations
- ๐ฑ Native mobile applications
- ๐๏ธ Advanced voice interactions
- ๐ค Chatbot for WhatsApp/Telegram
- ๐ Advanced analytics dashboard
- Support for all 22 official Indian languages
- Integration with state government portals
- Blockchain-based application tracking
- AI-powered policy recommendation engine
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- ESLint for JavaScript/React
- Black formatter for Python
- Conventional commits
- 80%+ test coverage
MIT ยฉ 2025 GovInsight Pro Team
Built for Digital India Initiative
- Google Gemini for conversational AI
- MongoDB Atlas for vector search capabilities
- Twilio for voice communication infrastructure
- Hugging Face for transformer models
- Government of India for open data initiatives
๐ Making Government Services Accessible to Every Indian Citizen