How svmayurkaarthic2005/internship_nic works
SIS is a bilingual Tamil/English/Tanglish assistant for survey officers. The main path is officer login, then a chat request routed through the chat API and chatbot orchestrator: intent handling retrieves structured application data or uses agent/RAG grounding, and the response streams to the browser. Separate capabilities cover application and survey APIs, uploaded-document evidence, and document embedding ingestion. The chatbot implementation and several domain services were not excerpted; edges involving them rely on README descriptions or SOURCE INDEX references, not inspection of their full source.
Main entry points: chatbot.py Chat orchestrator · database.py Database sessions · chat.py Chat endpoints · rag.py Intent and RAG
Components 25
Officer experience
- Web chat client
frontend/js/chat.js - Browser authentication
frontend/js/auth.js
API and identity
- Chat endpoints
backend/routers/chat.py - Auth endpoints
backend/routers/auth.py - Application endpoints
backend/routers/applications.py - Survey endpoints
backend/routers/survey.py - JWT and jurisdiction
backend/services/auth_service.py - Officer authentication
backend/dependencies.py - Attachment routes
backend/routers/chat.py
Chat intelligence
- Chat orchestrator
backend/services/chatbot.py - Intent and RAG
backend/services/rag.py - Token matching
backend/utils/fuzzy.py - Tool-calling agent
backend/services/agent.py - Authorized domain tools
backend/services/agent_tools.py - Structured query handlers
backend/services/postgres.py - Follow-up context
backend/services/followup_context.py
Knowledge and evidence
- Document extraction
backend/services/doc_extract.py - Attachment evidence store
backend/services/attachment_store.py - Document ingestion
backend/ingest.py - Vector retrieval
backend/services/pgvector_store.py - Embedding generation
backend/services/embeddings.py
Persistence
- Application data models
backend/models.py - Database sessions
backend/database.py
Other components
- Survey officer
- Ollama LLM
Connections 28
- Survey officer → Browser authentication: signs in
README.md - Browser authentication → Auth endpoints: submits login
README.md - Auth endpoints → JWT and jurisdiction: creates token
backend/routers/auth.py - Auth endpoints → Database sessions: queries officer
backend/routers/auth.py - JWT and jurisdiction → Application data models: resolves jurisdiction
backend/services/auth_service.py - Web chat client → Chat endpoints: streams chat
README.md - Chat endpoints → Chat orchestrator: routes request
README.md - Chat endpoints → Document extraction: extracts uploads
backend/routers/chat.py - Chat endpoints → Attachment evidence store: stores evidence
backend/routers/chat.py - Chat orchestrator → Intent and RAG: processes intent
README.md - Intent and RAG → Token matching: matches tokens
backend/services/rag.py - Chat orchestrator → Structured query handlers: fetches domain data
README.md - Chat orchestrator → Tool-calling agent: falls back to agent
README.md - Tool-calling agent → Authorized domain tools: calls tools
- Chat orchestrator → Follow-up context: uses follow-up context
- Intent and RAG → Vector retrieval: retrieves context
backend/services/rag.py - Intent and RAG → Ollama LLM: generates response
README.md - Document ingestion → Vector retrieval: ingests documents
backend/ingest.py - Vector retrieval → Embedding generation: requests vectors
backend/services/pgvector_store.py - Attachment evidence store → Document extraction: uses extraction
backend/services/attachment_store.py - Attachment evidence store → Embedding generation: embeds evidence
backend/services/attachment_store.py - Officer authentication → JWT and jurisdiction: validates token
backend/dependencies.py - Officer authentication → Database sessions: loads officer
backend/dependencies.py - Application endpoints → Officer authentication: requires officer
backend/routers/applications.py - Survey endpoints → Officer authentication: requires officer
backend/routers/survey.py - Application endpoints → Database sessions: uses session
backend/routers/applications.py - Survey endpoints → Database sessions: uses session
backend/routers/survey.py - Database sessions → Application data models: persists records
backend/database.py