How karthick-005/multi-doc-qa-chatbot works
This Flask application ingests documents and URLs, builds per-file vector indexes, and answers questions against a selected index. The browser provides upload, file-management, chat, and context-viewing interfaces; the backend also includes OCR and model-integration capabilities. The backend excerpt is partial, so the graph only connects stages where calls or data handling are visible, or where the README documents the capability. Some UI-to-route wiring is apparent from JavaScript requests, but not every route is shown in the excerpts.
Main entry points: app.py Flask application · upload.js Upload interface · chat.js Chat interface · index.js File browser
Components 17
Web interface
- Upload interface
static/upload.js - Chat interface
static/chat.js - File browser
static/index.js
Ingestion and indexing
- Document extraction
app.py - OCR processing
app.py - URL extraction
app.py - Text chunking
app.py - Vector embeddings
app.py - Vector index
app.py
Question answering
- Context retrieval
app.py - Answer generation
app.py
Other components
- User
- Flask application
app.py - Index files
app.py - Mistral API
- Gemini API
- Hugging Face models
Connections 20
- User → Upload interface: uploads files
static/upload.js - User → Chat interface: asks questions
static/chat.js - Upload interface → Flask application: submits files
static/upload.js - Upload interface → Flask application: submits URLs
static/upload.js - File browser → Flask application: requests file list
static/index.js - Chat interface → Flask application: requests context
static/chat.js - Flask application → Document extraction: extracts documents
app.py - Document extraction → OCR processing: falls back to OCR
app.py - Flask application → URL extraction: processes URLs
app.py - Document extraction → Text chunking: chunks text
app.py - Flask application → Text chunking: chunks URL content
app.py - Text chunking → Vector embeddings: creates index
app.py - Vector embeddings → Vector index: builds vectors
app.py - Flask application → Index files: stores index
app.py - Flask application → Vector index: loads index
app.py - Flask application → Context retrieval: retrieves contexts
app.py - Context retrieval → Answer generation: provides context
app.py - Answer generation → Mistral API: generates answer
app.py - Flask application → Gemini API: configures model
app.py - Flask application → Hugging Face models: creates embeddings
app.py