How dhruvasai/jansahayak- works
JanSahayak is a multilingual welfare-scheme application assistant delivered through Telegram and WhatsApp. A citizen converses by text or voice, provides eligibility details and Aadhaar imagery, then the system queues form generation and returns an application reference, screenshot, and (where available) SMS confirmation. The graph preserves the documented OCR, speech, conversation memory, scheme, and application-record capabilities. Some runtime modules are indexed but unsampled, so their internal links are omitted or marked unverified rather than inferred.
Main entry points: main.py FastAPI backend · aws_services.py AWS service helpers · rpa_queue.py RPA job queue · telegram_webhook.py Telegram handler
Components 30
Channels and API
- FastAPI backend
main.py - Telegram handler
routers/telegram_webhook.py - WhatsApp handler
routers/whatsapp_webhook.py - WhatsApp webhook
routers/webhook.py - Polling bot
polling_bot.py - Alternate polling bot
src/polling_bot.py
Conversation and Documents
- Chat and eligibility
routers/chat.py - Aadhaar OCR and checks
routers/documents.py - Conversation memory
routers/memory.py - Speech recognition
services/stt_engine.py
Application Processing
- Scheme catalog
routers/schemes.py - Application records API
routers/applications.py - Application record schema
models/application.py - User schema
models/user.py - Message schema
models/message.py - RPA job queue
routers/rpa_queue.py - Scheme form agent
rpa_agent.py - Reference and screenshot
Cloud Integrations
- AWS service helpers
aws_services.py - Alternate AWS helpers
src/aws_services.py - Amazon S3
- Amazon DynamoDB
- Amazon SNS
- Amazon Bedrock
- Amazon Transcribe
- Amazon Textract
- Groq services
Other components
- Rural citizen
- Telegram
- Twilio WhatsApp
Connections 37
- Rural citizen → Telegram: sends messages
README.md - Rural citizen → Twilio WhatsApp: sends messages
README.md - Telegram → Telegram handler: delivers updates
README.md - Twilio WhatsApp → WhatsApp handler: posts messages
routers/whatsapp_webhook.py - FastAPI backend → Telegram handler: mounts route
main.py - FastAPI backend → WhatsApp handler: mounts route
main.py - FastAPI backend → RPA job queue: mounts route
main.py - FastAPI backend → Aadhaar OCR and checks: mounts route
main.py - FastAPI backend → Application records API: mounts route
main.py - FastAPI backend → Scheme catalog: mounts route
main.py - FastAPI backend → WhatsApp webhook: mounts route
main.py - Telegram handler → Chat and eligibility: processes text
routers/telegram_webhook.py - Telegram handler → Conversation memory: loads and saves history
routers/telegram_webhook.py - Telegram handler → Aadhaar OCR and checks: requests OCR
routers/telegram_webhook.py - Telegram handler → RPA job queue: enqueues application
routers/telegram_webhook.py - WhatsApp handler → Aadhaar OCR and checks: requests OCR
routers/whatsapp_webhook.py - WhatsApp handler → Scheme form agent: submits form
routers/whatsapp_webhook.py - WhatsApp webhook → Chat and eligibility: requests response
routers/webhook.py - WhatsApp webhook → Scheme form agent: runs submission
routers/webhook.py - Chat and eligibility → AWS service helpers: requests LLM
routers/chat.py - Chat and eligibility → Groq services: fallback inference
routers/chat.py - Aadhaar OCR and checks → AWS service helpers: uses OCR helpers
routers/documents.py - Aadhaar OCR and checks → Amazon Textract: extracts document text
README.md - Speech recognition → Amazon Transcribe: fallback transcription
README.md - Speech recognition → Groq services: transcribes audio
README.md - RPA job queue → Scheme form agent: runs scheme form
routers/rpa_queue.py - RPA job queue → AWS service helpers: stores and notifies
routers/rpa_queue.py - RPA job queue → Reference and screenshot: sends confirmation
routers/rpa_queue.py - Scheme form agent → Reference and screenshot: returns ID and image
rpa_agent.py - AWS service helpers → Amazon S3: stores screenshots
- AWS service helpers → Amazon DynamoDB: stores application
- AWS service helpers → Amazon SNS: sends SMS
- AWS service helpers → Amazon Bedrock: runs inference
aws_services.py - Polling bot → Chat and eligibility: uses conversation routes
polling_bot.py - Polling bot → RPA job queue: uses job queue
polling_bot.py - Alternate polling bot → Chat and eligibility: uses conversation routes
src/polling_bot.py - Alternate polling bot → RPA job queue: uses job queue
src/polling_bot.py