How gopu-005/multimodal-retrieval-augmented-generation-main works
VisionRAG is a multimodal document question-answering application. Users sign in, upload PDFs or images for page rendering and OCR, then ask questions; the backend retrieves relevant text blocks, sends context and page imagery to a multimodal LLM, and returns answers with citations that the UI can use to highlight document locations. The README also describes token analytics, shared conversation snapshots, and Firebase-backed storage fallback. Several backend routes and frontend features are only partially sampled, so those links rely on README documentation where noted.
Main entry points: main.py REST API · App.jsx Workspace UI · document.py Document processing · ChatPane.jsx Chat pane
Components 20
Web application
- Workspace UI
frontend/src/App.jsx - Sign-in UI
frontend/src/components/Auth.jsx - Chat pane
frontend/src/components/ChatPane.jsx - Document viewer
frontend/src/components/DocumentViewer.jsx - Backend address
frontend/src/config.js
Document processing
- REST API
backend/app/main.py - Document processing
backend/app/services/document.py - Cloud OCR
backend/app/services/ocr.py - OCR schemas
backend/app/schemas/ocr.py - Runtime settings
backend/app/config.py
Question answering
- BM25 retrieval
backend/app/services/vector_db.py - Multimodal LLM
backend/app/services/llm.py - Token analytics
backend/app/main.py - Conversation sharing
backend/app/main.py
Firebase services
- Firebase backend config
backend/app/services/firebase_config.py - Firebase Authentication
- Firestore
- Cloud Storage
Other components
- Document user
- Gemini via OpenRouter
Connections 31
- Document user → Sign-in UI: signs in
README.md - Sign-in UI → Firebase Authentication: authenticates
frontend/src/components/Auth.jsx - Workspace UI → Sign-in UI: renders
frontend/src/App.jsx - Workspace UI → Chat pane: renders
frontend/src/App.jsx - Workspace UI → Document viewer: renders
frontend/src/App.jsx - Chat pane → Backend address: gets API address
frontend/src/components/ChatPane.jsx - Chat pane → REST API: submits questions
frontend/src/components/ChatPane.jsx - Document user → Workspace UI: uploads documents
README.md - Workspace UI → REST API: uploads documents
README.md - REST API → Document processing: processes uploads
backend/app/main.py - Document processing → Cloud OCR: extracts text
backend/app/services/document.py - Document processing → BM25 retrieval: creates index
backend/app/services/document.py - Document processing → Cloud Storage: uploads pages
backend/app/services/document.py - Document processing → OCR schemas: builds results
backend/app/services/document.py - Cloud OCR → Runtime settings: reads credentials
backend/app/services/ocr.py - Cloud OCR → Gemini via OpenRouter: requests OCR
backend/app/services/ocr.py - Cloud OCR → OCR schemas: returns blocks
backend/app/services/ocr.py - REST API → BM25 retrieval: retrieves blocks
backend/app/main.py - REST API → Multimodal LLM: requests answers
backend/app/main.py - Multimodal LLM → Gemini via OpenRouter: sends multimodal query
backend/app/services/llm.py - Multimodal LLM → Runtime settings: reads model config
backend/app/services/llm.py - REST API → Firebase Authentication: verifies tokens
README.md - REST API → Firestore: reads and writes
backend/app/main.py - REST API → Cloud Storage: loads page assets
backend/app/main.py - REST API → Token analytics: serves analytics
README.md - REST API → Conversation sharing: supports snapshots
README.md - Workspace UI → Token analytics: shows token metrics
README.md - Chat pane → Document viewer: opens cited pages
frontend/src/components/ChatPane.jsx - Document viewer → REST API: loads document pages
README.md - Firebase backend config → Firestore: configures access
- Firebase backend config → Cloud Storage: configures access