How shalcoder/jansathi works
JanSathi is a voice-first civic-readiness service: citizens ask about benefits by phone or web, then receive eligibility guidance, document preparation, and follow-up artifacts. The documented workflow proceeds through intent, scheme retrieval, slot gathering, deterministic eligibility rules, verification/escalation, and notification or receipt delivery; the admin dashboard provides review and operational visibility. The README describes these capabilities and the high-level flow. Source excerpts confirm selected routing, rules, session, and retrieval behavior; unsampled feature implementations and some runtime wiring are represented only where documented.
Main entry points: supervisor.py Agent supervisor · workflow_engine.py Workflow engine · v1_routes.py V1 API · rag_service.py Scheme retrieval
Components 25
Citizen entry
Civic intelligence
- Intent classification
backend/app/services/intent_service.py - Scheme retrieval
backend/app/services/rag_service.py - Adaptive RAG
backend/app/services/smart_rag_service.py - Slot collection
backend/agents/slot_collection_agent.py - Eligibility rules
backend/app/services/rules_engine.py - Agent supervisor
backend/agents/supervisor.py - Workflow engine
backend/agentic_engine/workflow_engine.py
Decision and delivery
- Decision verification
backend/app/services/verifier_service.py - Human review
backend/app/services/hitl_service.py - Grievance drafting
backend/agents/life_event_agent.py - Benefit receipt
backend/app/services/receipt_service.py - SMS notification
backend/app/services/notify_service.py
Session and data
- Session manager
backend/agentic_engine/session_manager.py - Session storage
backend/agentic_engine/storage.py - Scheme catalog
backend/app/services/scheme_feed_service.py
Admin and oversight
- Admin dashboard
frontend/src/app/admin/dashboard/page.tsx - Audit trail
backend/app/services/audit_service.py
Other components
- Citizen
- Amazon Kendra
- Amazon Bedrock
- DynamoDB
- Reviewer
Connections 25
- Citizen → Phone IVR: calls
README.md - Citizen → Web phone: uses
README.md - Phone IVR → V1 API: submits query
README.md - Web phone → V1 API: submits query
README.md - V1 API → Agent supervisor: routes request
backend/app/api/v1_routes.py - V1 API → Workflow engine: starts workflow
README.md - Agent supervisor → Intent classification: classifies
backend/agents/supervisor.py - Agent supervisor → Scheme retrieval: retrieves schemes
backend/agents/supervisor.py - Agent supervisor → Slot collection: collects slots
backend/agents/supervisor.py - Agent supervisor → Eligibility rules: evaluates eligibility
backend/agents/supervisor.py - Agent supervisor → Decision verification: verifies result
backend/agents/supervisor.py - Scheme retrieval → Amazon Kendra: searches
README.md - Adaptive RAG → Amazon Kendra: searches
backend/app/services/smart_rag_service.py - Adaptive RAG → Amazon Bedrock: generates fallback
backend/app/services/smart_rag_service.py - Workflow engine → Session manager: manages session
backend/agentic_engine/workflow_engine.py - Session manager → Session storage: reads and writes
backend/agentic_engine/session_manager.py - Session storage → DynamoDB: persists sessions
- Decision verification → Human review: escalates cases
README.md - Reviewer → Human review: reviews cases
README.md - Workflow engine → Grievance drafting: drafts grievance
backend/agentic_engine/workflow_engine.py - Workflow engine → Benefit receipt: generates receipt
README.md - Workflow engine → SMS notification: dispatches summary
README.md - Scheme retrieval → Scheme catalog: uses scheme data
backend/app/services/rag_service.py - Admin dashboard → Human review: shows review queue
README.md - Admin dashboard → Audit trail: shows audit trail
README.md