How sandy-hax/multilingual-chatbot-with-rag- works
This is a multilingual citizen-services assistant with a web interface and a hands-free voice CLI. Citizens submit text, speech, or documents; the web API or CLI routes queries through the LLM, which can retrieve local scheme material, search the web, or guide grievance filing. Answers can be spoken aloud, while completed grievances are stored for PACS follow-up. The graph preserves the separately documented PACS dashboard and document-ingestion capabilities. Several subsystem links rely on README statements or SOURCE INDEX references because their full implementations were not shown.
Main entry points: llm_service.py LLM Agent · app.py Web API · chatbot.py Voice CLI · rag_service.py Document Ingestion
Components 20
User Interfaces
- Web Chat UI
static/js/app.js - PACS Dashboard
static/js/pacs.js - Web API
app.py - Voice CLI
chatbot.py
Assistant Runtime
- Speech and Language
chatbot.py - LLM Agent
llm_service.py - Web Search
llm_service.py - Edge-TTS Output
app.py
Knowledge Retrieval
- Document Ingestion
rag_service.py - OCR Extraction
ocr_service.py - Hybrid Retrieval
rag_service.py - Local RAG Index
rag_service.py
Grievance Operations
- Grievance Filing
grievance_service.py - PACS Case Management
app.py - Grievance Database
db.py
Other components
- Citizen
- OpenCode Zen
- Serper
- DuckDuckGo
- CPGRAMS Portal
Connections 23
- Citizen → Web Chat UI: uses
README.md - Citizen → Voice CLI: speaks to
README.md - Web Chat UI → Web API: sends requests
README.md - Web API → LLM Agent: invokes
app.py - Web API → Document Ingestion: uploads documents
README.md - Web API → PACS Case Management: serves PACS routes
app.py - Voice CLI → Speech and Language: processes audio
README.md - Voice CLI → LLM Agent: requests answers
chatbot.py - Speech and Language → Edge-TTS Output: speaks replies
README.md - Web API → Edge-TTS Output: generates audio
app.py - LLM Agent → OpenCode Zen: calls model
README.md - LLM Agent → Hybrid Retrieval: searches local knowledge
llm_service.py - LLM Agent → Web Search: dispatches searches
README.md - Web Search → Serper: searches web
README.md - Web Search → DuckDuckGo: fallback search
README.md - Document Ingestion → OCR Extraction: extracts text
rag_service.py - Document Ingestion → Local RAG Index: indexes chunks
README.md - Hybrid Retrieval → Local RAG Index: retrieves chunks
README.md - PACS Dashboard → PACS Case Management: manages tickets
static/js/pacs.js - LLM Agent → Grievance Filing: routes complaints
README.md - Grievance Filing → Grievance Database: creates tickets
grievance_service.py - PACS Case Management → Grievance Database: updates cases
app.py - Grievance Filing → CPGRAMS Portal: guides filing
README.md