How shubham123-k/drdo-offline-ai-defence-knowledge-assistant works
DRDO AI is an offline-first assistant for asking questions grounded in clearance-authorized technical documents. Users register or sign in, then upload documents or images and ask global or attachment-scoped questions; the backend ingests and indexes content, retrieves permitted chunks, and returns grounded answers. Separate capabilities include offline voice transcription and administrator approval, user/document management, secure account recovery, and audit logs. The graph follows documented and indexed relationships; unsampled integrations are shown only where the README describes them.
Main entry points: document_ingestion_service.py Document ingestion · main.py FastAPI application · image_ingestion_service.py Image ingestion · db.py Relational database
Components 31
Frontend
- Web application
frontend/src/App.jsx - Page routing
frontend/src/routes/AppRoutes.jsx - Chat experience
frontend/src/components/chat - Chat state
frontend/src/context/ChatContext.jsx - Theme settings
frontend/src/context/ThemeContext.jsx - Account registration
frontend/src/pages/SignUp.jsx - User editing
frontend/src/pages/EditUser.jsx - HTTP API clients
frontend/src/api - Admin dashboard
frontend/src/components/admin
Identity and API
- FastAPI application
backend/app/main.py - Authentication routes
backend/routes/auth.py - JWT handling
backend/auth/jwt_handler.py - Auth and clearance
backend/auth/dependencies.py
Document and AI
- Document routes
backend/routes/document.py - Document ingestion
backend/services/document_ingestion_service.py - Image ingestion
backend/services/image_ingestion_service.py - Text extraction
backend/services/text_extractor.py - OCR
backend/services/ocr_service.py - Visual analysis
backend/services/vision_service.py - Text chunking
backend/services/text_splitter.py - Embeddings
backend/services/embedding_service.py - Chroma vector store
backend/services/chroma_service.py - AI question routes
backend/routes/ai.py - Grounded retrieval and answers
backend/services/rag_service.py - Local language model
backend/services/llm_service.py - Voice transcription
backend/routes/voice.py
Administration and state
- Administrator operations
backend/routes/admin.py - Audit logging
backend/services/audit_service.py - Relational database
backend/database/db.py - User and domain records
backend/models/user.py
Other components
- User
Connections 43
- User → Web application: uses
README.md - Web application → Page routing: renders
frontend/src/App.jsx - Page routing → Account registration: routes to
frontend/src/routes/AppRoutes.jsx - Page routing → User editing: routes to
frontend/src/routes/AppRoutes.jsx - Page routing → Chat experience: routes to
frontend/src/routes/AppRoutes.jsx - Chat experience → Chat state: uses
- Chat state → HTTP API clients: calls
frontend/src/context/ChatContext.jsx - Web application → Theme settings: provides
frontend/src/main.jsx - Web application → FastAPI application: calls
README.md - FastAPI application → Authentication routes: registers
backend/app/main.py - FastAPI application → Document routes: registers
backend/app/main.py - FastAPI application → AI question routes: registers
backend/app/main.py - FastAPI application → Administrator operations: registers
backend/app/main.py - FastAPI application → Voice transcription: registers
backend/app/main.py - Authentication routes → JWT handling: creates tokens
backend/routes/auth.py - Auth and clearance → JWT handling: verifies tokens
backend/auth/dependencies.py - Auth and clearance → Relational database: queries users
backend/auth/dependencies.py - Authentication routes → Relational database: persists accounts
backend/routes/auth.py - Document routes → Document ingestion: ingests uploads
backend/routes/document.py - Document routes → Relational database: stores document records
backend/routes/document.py - Document ingestion → Text extraction: extracts text
backend/services/document_ingestion_service.py - Document ingestion → Image ingestion: delegates images
backend/services/document_ingestion_service.py - Document ingestion → OCR: extracts OCR
backend/services/document_ingestion_service.py - Document ingestion → Visual analysis: analyzes visuals
backend/services/document_ingestion_service.py - Document ingestion → Text chunking: splits content
backend/services/document_ingestion_service.py - Image ingestion → OCR: extracts OCR
backend/services/image_ingestion_service.py - Image ingestion → Visual analysis: analyzes visuals
backend/services/image_ingestion_service.py - Image ingestion → Text chunking: splits content
backend/services/image_ingestion_service.py - Document ingestion → Embeddings: embeds chunks
backend/services/document_ingestion_service.py - Image ingestion → Embeddings: embeds chunks
backend/services/image_ingestion_service.py - Document ingestion → Chroma vector store: indexes chunks
backend/services/document_ingestion_service.py - Image ingestion → Chroma vector store: indexes chunks
backend/services/image_ingestion_service.py - AI question routes → Grounded retrieval and answers: answers questions
README.md - Grounded retrieval and answers → Embeddings: embeds query
- Grounded retrieval and answers → Chroma vector store: retrieves chunks
- Grounded retrieval and answers → Local language model: generates answer
backend/services/rag_service.py - Voice transcription → User: returns transcription
README.md - Administrator operations → Relational database: manages records
backend/routes/admin.py - Administrator operations → Audit logging: records actions
backend/routes/admin.py - Administrator operations → Chroma vector store: deletes document chunks
backend/routes/admin.py - Relational database → User and domain records: stores
README.md - User → Admin dashboard: administers
README.md - Admin dashboard → HTTP API clients: uses API