How kalviumcommunity/s67-0926-dataforge-airag-welfareconnect- works
WelfareConnect is a web assistant for searching official welfare-scheme documents and answering questions with page-level citations. Its main user journey is query understanding, hybrid retrieval, grounded answer generation, and citation review; a separate administrative journey manages collections, document versions, and indexing. The backend also provides role-based authentication, audit, feedback, and health capabilities. Several backend services and frontend components were not excerpted, so their internal call relationships are omitted or marked unverified rather than inferred.
Main entry points: page.tsx WelfareConnect portal · main.py FastAPI application · search_service.py Hybrid retrieval and answers · document_service.py Document and collection management
Components 34
Web experience
- WelfareConnect portal
frontend/src/app/page.tsx - Sign-in dialog
frontend/src/components/AuthModal.tsx - Helpdesk tools
frontend/src/components/HelpdeskToolbar.tsx - Admin console
frontend/src/components/AdminConsole.tsx - Scheme catalog
frontend/src/components/SchemeCatalog.tsx - Citation preview
frontend/src/components/CitationPreviewModal.tsx - Legal disclaimer
frontend/src/components/DisclaimerBanner.tsx
API and access
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/routers/auth.py - Search routes
backend/app/routers/search.py - Document routes
backend/app/routers/documents.py - Collection routes
backend/app/routers/collections.py - Indexing routes
backend/app/routers/indexing.py - Authentication and RBAC
backend/app/services/auth_service.py - Token and permission checks
backend/app/core/dependencies.py
Document ingestion
- Document and collection management
backend/app/services/document_service.py - Document file storage
backend/app/services/storage_service.py - Background job processing
backend/app/workers/background_jobs.py - PDF, OCR, and page chunking
backend/app/workers/document_processor.py - Text chunking
backend/app/workers/chunker.py - Document indexing
backend/app/services/indexing_service.py
Grounded search
- Query and document embeddings
backend/app/services/embedding_service.py - Query understanding
backend/app/services/query_understanding.py - Hybrid retrieval and answers
backend/app/services/search_service.py - Keyword retrieval
backend/app/services/keyword_search.py - Vector index access
backend/app/services/pinecone_service.py - Grounded answer generation
backend/app/services/generation_service.py - Citation validation
backend/app/services/citation_validator.py
Administration and records
- Relational records
backend/app/models/db_models.py - Audit routes
backend/app/routers/audit.py - Audit trail
backend/app/services/audit_service.py
Other components
- Citizen
- Helpdesk operator
- Government administrator
Connections 34
- Citizen → WelfareConnect portal: uses
README.md - Helpdesk operator → WelfareConnect portal: uses
README.md - Government administrator → WelfareConnect portal: uses
README.md - WelfareConnect portal → Sign-in dialog: renders
frontend/src/app/page.tsx - WelfareConnect portal → Helpdesk tools: renders
frontend/src/app/page.tsx - WelfareConnect portal → Admin console: renders
frontend/src/app/page.tsx - WelfareConnect portal → Scheme catalog: renders
frontend/src/app/page.tsx - WelfareConnect portal → Citation preview: renders
frontend/src/app/page.tsx - WelfareConnect portal → Legal disclaimer: renders
frontend/src/app/page.tsx - FastAPI application → Authentication routes: registers
backend/app/main.py - FastAPI application → Search routes: registers
backend/app/main.py - FastAPI application → Document routes: registers
backend/app/main.py - FastAPI application → Collection routes: registers
backend/app/main.py - FastAPI application → Indexing routes: registers
backend/app/main.py - FastAPI application → Audit routes: registers
backend/app/main.py - Authentication routes → Authentication and RBAC: delegates
backend/app/routers/auth.py - Token and permission checks → Authentication and RBAC: loads user
backend/app/core/dependencies.py - Search routes → Query understanding: understands query
backend/app/routers/search.py - Search routes → Hybrid retrieval and answers: executes query
backend/app/routers/search.py - Hybrid retrieval and answers → Query and document embeddings: creates embedding
backend/app/services/search_service.py - Hybrid retrieval and answers → Keyword retrieval: retrieves terms
backend/app/services/search_service.py - Hybrid retrieval and answers → Vector index access: queries vectors
backend/app/services/search_service.py - Hybrid retrieval and answers → Grounded answer generation: generates answer
backend/app/services/search_service.py - Hybrid retrieval and answers → Citation validation: checks citations
backend/app/services/search_service.py - Document routes → Document and collection management: delegates
backend/app/routers/documents.py - Collection routes → Document and collection management: delegates
backend/app/routers/collections.py - Indexing routes → Document indexing: delegates
backend/app/routers/indexing.py - Document and collection management → Document file storage: stores files
backend/app/services/document_service.py - Document and collection management → Background job processing: queues processing
backend/app/services/document_service.py - Background job processing → PDF, OCR, and page chunking: dispatches
backend/app/workers/background_jobs.py - PDF, OCR, and page chunking → Text chunking: chunks pages
backend/app/workers/document_processor.py - Background job processing → Document indexing: runs indexing
backend/app/workers/background_jobs.py - Audit routes → Audit trail: reads audit trail
- Authentication and RBAC → Audit trail: records events
backend/app/services/auth_service.py