How prav3106/omrag works
This is an offline multimodal RAG application: users upload documents, images, or audio, then ask questions grounded in the unified index. Uploads pass through MIME-based extraction, chunking, embedding, and persistence; queries pass through hybrid retrieval and local answer generation with source citations. The React workspace also exposes document management, pipeline inspection, dashboard metrics, and dependency status. The README documents the complete product stages; some parser and router internals were not excerpted, so those links rely on its architecture/API descriptions.
Main entry points: api.js API client · service.py Ingest orchestration · App.jsx App shell · pipeline.py Retrieval pipeline
Components 32
React workspace
- App shell
frontend/src/App.jsx - Chat workspace
frontend/src/pages/ChatWorkspace.jsx - Knowledge base
frontend/src/pages/KnowledgeBase.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Processor lab
frontend/src/pages/ProcessorLab.jsx - System status
frontend/src/pages/SystemStatus.jsx - UI components
frontend/src/components/Primitives.jsx - API client
frontend/src/lib/api.js
API layer
- FastAPI app
backend/app/main.py - Ingest endpoint
backend/app/routers/ingest.py - Query endpoint
backend/app/routers/query.py - Index endpoints
backend/app/routers/index.py - Status endpoint
backend/app/routers/status.py - Shared schemas
backend/app/models.py
Ingestion pipeline
- Ingest orchestration
backend/app/service.py - MIME dispatch
backend/app/ingest/router.py - Format loaders
backend/app/ingest - Chunking
backend/app/ingest/chunker.py - Text embeddings
backend/app/embeddings/text_encoder.py - Image embeddings
backend/app/embeddings/image_encoder.py - Image descriptions
backend/app/embeddings/vision_describe.py
Retrieval and answers
- Retrieval pipeline
backend/app/retrieval/pipeline.py - BM25 fusion
backend/app/retrieval/bm25.py - MMR diversity
backend/app/retrieval/mmr.py - Cross-encoder rerank
backend/app/retrieval/reranker.py - Grounded prompts
backend/app/generation/prompt_builder.py - Local answer generation
backend/app/generation/ollama_client.py
Index and state
- Qdrant vectors
backend/app/store/qdrant_store.py - SQLite registry
backend/app/store/sqlite_registry.py - Content deduplication
backend/app/store/dedup.py
Other components
- User
- Ollama
Connections 48
- User → App shell: uses
README.md - App shell → Chat workspace: routes to
frontend/src/App.jsx - App shell → Knowledge base: routes to
frontend/src/App.jsx - App shell → Dashboard: routes to
frontend/src/App.jsx - App shell → Processor lab: routes to
frontend/src/App.jsx - App shell → System status: routes to
frontend/src/App.jsx - App shell → API client: loads stats
frontend/src/App.jsx - Chat workspace → API client: queries
frontend/src/pages/ChatWorkspace.jsx - Knowledge base → API client: manages uploads
frontend/src/pages/KnowledgeBase.jsx - Dashboard → API client: requests metrics
frontend/src/pages/Dashboard.jsx - Processor lab → API client: inspects pipeline
frontend/src/pages/ProcessorLab.jsx - System status → API client: checks health
frontend/src/pages/SystemStatus.jsx - API client → Ingest endpoint: posts uploads
frontend/src/lib/api.js - API client → Query endpoint: posts queries
frontend/src/lib/api.js - API client → Index endpoints: requests index
frontend/src/lib/api.js - API client → Status endpoint: requests status
frontend/src/lib/api.js - App shell → UI components: renders controls
- FastAPI app → Ingest endpoint: registers routes
backend/app/main.py - FastAPI app → Query endpoint: registers routes
backend/app/main.py - FastAPI app → Index endpoints: registers routes
backend/app/main.py - FastAPI app → Status endpoint: registers routes
backend/app/main.py - Ingest endpoint → Ingest orchestration: calls ingestion
backend/app/routers/ingest.py - Query endpoint → Retrieval pipeline: calls retrieval
backend/app/routers/query.py - Query endpoint → Local answer generation: requests answer
backend/app/routers/query.py - Query endpoint → SQLite registry: logs query
backend/app/routers/query.py - Ingest orchestration → MIME dispatch: routes files
backend/app/service.py - MIME dispatch → Format loaders: dispatches formats
backend/app/ingest/router.py - Ingest orchestration → Chunking: chunks content
backend/app/service.py - Ingest orchestration → Text embeddings: embeds text
backend/app/service.py - Ingest orchestration → Image embeddings: embeds images
backend/app/service.py - Ingest orchestration → Image descriptions: describes images
backend/app/service.py - Ingest orchestration → Content deduplication: identifies content
backend/app/service.py - Ingest orchestration → Qdrant vectors: writes vectors
backend/app/service.py - Ingest orchestration → SQLite registry: commits registry
backend/app/service.py - Retrieval pipeline → Text embeddings: encodes query
backend/app/retrieval/pipeline.py - Retrieval pipeline → Image embeddings: encodes visual query
backend/app/retrieval/pipeline.py - Retrieval pipeline → Qdrant vectors: searches vectors
backend/app/retrieval/pipeline.py - Retrieval pipeline → SQLite registry: hydrates chunks
backend/app/retrieval/pipeline.py - Retrieval pipeline → BM25 fusion: fuses sparse scores
backend/app/retrieval/pipeline.py - Retrieval pipeline → MMR diversity: diversifies shortlist
backend/app/retrieval/pipeline.py - Retrieval pipeline → Cross-encoder rerank: reranks candidates
backend/app/retrieval/pipeline.py - Local answer generation → Grounded prompts: builds prompt
backend/app/generation/ollama_client.py - Local answer generation → Ollama: generates locally
README.md - Local answer generation → Query endpoint: returns cited answer
backend/app/routers/query.py - Index endpoints → Qdrant vectors: manages vectors
- Index endpoints → SQLite registry: manages documents
- Status endpoint → Qdrant vectors: checks health
- Status endpoint → SQLite registry: checks health