How shivkhurana/omnirag works
OmniRAG is a full-stack workspace for registering users, indexing PDFs, and asking questions grounded in indexed content. Users authenticate in the React app, upload documents or submit questions through its API client, and the FastAPI routes handle authorization and domain work. PDF ingestion creates chunks and embeddings for persistent vector retrieval; chat retrieves relevant chunks and generates cited answers. MongoDB stores users and document metadata. The README documents the product capabilities; edges involving unsampled chat implementation are limited to indexed references.
Main entry points: documents.py Document routes · api.ts API client · auth.py Auth routes · chat.py Chat route
Components 18
Workspace UI
- Session app
frontend/src/App.tsx - Auth screen
frontend/src/components/AuthScreen.tsx - Chat workspace
frontend/src/components/ChatWorkspace.tsx - API client
frontend/src/lib/api.ts
API workflows
- FastAPI app
backend/app/main.py - Auth routes
backend/app/api/auth.py - Document routes
backend/app/api/documents.py - Chat route
backend/app/api/chat.py - API schemas
backend/app/models/schemas.py
Identity and access
- User authorization
backend/app/api/dependencies.py - Token security
backend/app/core/security.py
Document intelligence
- RAG service
backend/app/services/rag.py - PDF chunking
backend/app/services/rag.py
Persistence and services
- Chroma store
backend/app/services/rag.py - OpenAI models
- MongoDB
- Runtime settings
backend/app/core/config.py
Other components
- Workspace user
Connections 29
- Workspace user → Session app: uses
frontend/src/App.tsx - Session app → Auth screen: renders
frontend/src/App.tsx - Session app → Chat workspace: renders
frontend/src/App.tsx - Auth screen → API client: authenticates via
frontend/src/components/AuthScreen.tsx - Chat workspace → API client: requests data
frontend/src/components/ChatWorkspace.tsx - API client → Auth routes: calls auth endpoints
README.md - API client → Document routes: calls document endpoints
README.md - API client → Chat route: calls chat endpoint
README.md - FastAPI app → Auth routes: registers
backend/app/main.py - FastAPI app → Document routes: registers
backend/app/main.py - FastAPI app → Chat route: registers
backend/app/main.py - Auth routes → Token security: issues tokens
backend/app/api/auth.py - Auth routes → MongoDB: reads and writes users
backend/app/api/auth.py - User authorization → Token security: validates tokens
backend/app/api/dependencies.py - User authorization → MongoDB: loads user
backend/app/api/dependencies.py - Document routes → User authorization: requires user
backend/app/api/documents.py - Chat route → User authorization: uses authorization
backend/app/api/chat.py - Document routes → RAG service: ingests PDF
backend/app/api/documents.py - Document routes → MongoDB: stores metadata
backend/app/api/documents.py - Chat route → RAG service: gets answers
backend/app/api/chat.py - RAG service → PDF chunking: extracts and chunks
backend/app/services/rag.py - RAG service → Chroma store: indexes and searches
backend/app/services/rag.py - RAG service → OpenAI models: embeds and generates
backend/app/services/rag.py - Token security → Runtime settings: loads secrets
backend/app/core/security.py - Chroma store → Runtime settings: loads storage path
backend/app/services/rag.py - FastAPI app → MongoDB: connects on startup
backend/app/main.py - Auth routes → API schemas: validates requests
backend/app/api/auth.py - Document routes → API schemas: returns metadata
backend/app/api/documents.py - Chat route → API schemas: uses chat models
backend/app/api/chat.py