How devloperdevesh/enterpriserag-ai works
EnterpriseRAG-AI combines a React control-center frontend with a FastAPI backend for tenant-aware RAG, document ingestion, query streaming, and operational visibility. The principal workflow is authenticated document upload and indexing, followed by query embedding, vector retrieval, streamed LLM response, and per-user history. The graph preserves the README’s security, observability, and reliability branches. Sampled files establish the shown calls; unsampled integrations and dashboard-to-API wiring are omitted or marked unverified.
Main entry points: main.py FastAPI application · rag.py RAG query and streaming · document.py Document ingestion · auth.py Authentication routes
Components 28
Application and security
- FastAPI application
app/main.py - Authentication routes
app/api/routes/auth.py - Authentication service
app/services/auth_service.py - JWT and password security
app/core/security.py - Request identity
app/core/dependencies.py - Tenant administration
app/api/routes/tenants.py
Retrieval and answers
- Document ingestion
app/api/routes/document.py - Chunking and embeddings
app/rag/chunker.py - Embedding generation
app/rag/embeddings.py - Vector retrieval
app/rag/vector_store.py - RAG query and streaming
app/api/routes/rag.py - LLM generation
app/rag/llm.py - Reranking pipeline
app/rag/rag_service.py
Persistence and history
- Query history
app/rag/query_history.py - Redis client
app/core/redis_client.py - Database sessions
app/db/session.py - User tenant documents
app/models/user.py
Operations and reliability
- Tracing and telemetry
app/observability/rag_tracing.py - Rate limiting
app/reliability/rate_limit.py - Background workers
app/workers/celery_worker.py
Control center
- Web application
frontend/src/routes/AppRoutes.tsx - RAG chat interface
frontend/src/rag/QueryRAG.tsx - Chat API service
frontend/src/services/chatService.ts - HTTP API client
frontend/src/api/client.ts - Query history panel
frontend/src/rag/QueryHistoryPanel.tsx - History API service
frontend/src/services/historyService.ts - Operational dashboard
frontend/src/app/pages/Analytics.tsx
Other components
- Enterprise user
Connections 33
- Enterprise user → Web application: uses
README.md - Web application → FastAPI application: requests
- Web application → Authentication routes: authenticates
- FastAPI application → Authentication routes: registers
app/main.py - FastAPI application → Document ingestion: registers
app/main.py - FastAPI application → RAG query and streaming: registers
app/main.py - FastAPI application → Tenant administration: registers
app/main.py - Authentication routes → Authentication service: authenticates
app/api/routes/auth.py - Authentication service → JWT and password security: verifies credentials
app/services/auth_service.py - Authentication routes → JWT and password security: hashes passwords
app/api/routes/auth.py - FastAPI application → Request identity: protects routes
app/main.py - Request identity → JWT and password security: decodes token
app/core/dependencies.py - Document ingestion → Chunking and embeddings: chunks documents
app/api/routes/document.py - Document ingestion → Embedding generation: generates embeddings
app/api/routes/document.py - Document ingestion → Vector retrieval: indexes vectors
app/api/routes/document.py - RAG query and streaming → Embedding generation: embeds query
app/api/routes/rag.py - RAG query and streaming → Vector retrieval: searches vectors
app/api/routes/rag.py - RAG query and streaming → LLM generation: generates stream
app/api/routes/rag.py - RAG query and streaming → Query history: records query
app/api/routes/rag.py - RAG query and streaming → Query history: reads history
app/api/routes/rag.py - Query history → Redis client: uses Redis
app/rag/query_history.py - Authentication service → User tenant documents: queries users
app/services/auth_service.py - Document ingestion → Database sessions: uses session
app/api/routes/document.py - Document ingestion → User tenant documents: stores documents
app/api/routes/document.py - FastAPI application → Tracing and telemetry: configures tracing
app/main.py - FastAPI application → Rate limiting: initializes limiter
app/main.py - RAG chat interface → Chat API service: submits queries
frontend/src/rag/QueryRAG.tsx - Chat API service → HTTP API client: sends requests
frontend/src/services/chatService.ts - Query history panel → History API service: loads history
frontend/src/rag/QueryHistoryPanel.tsx - History API service → HTTP API client: sends requests
frontend/src/services/historyService.ts - Operational dashboard → FastAPI application: fetches telemetry
- RAG query and streaming → Reranking pipeline: uses pipeline
- FastAPI application → Background workers: dispatches jobs