How kushal-ctrl-del/raglab works
RAGLab is a document-grounded chat and experimentation workspace. Users upload supported files, which the backend extracts, chunks, embeds, and indexes; queries retrieve cited chunks and can produce grounded answers with latency/configuration traces. Separate research retrieval, experiment history, runtime settings, and dashboard capabilities complement chat. The README describes the frontend features and API client, but frontend request wiring was not sampled, so those links are marked unverified; backend relationships follow sampled calls or the source index.
Main entry points: main.py FastAPI Application · page.tsx Interactive Workspace · pipeline.py Document Pipeline · api.ts REST API Client
Components 24
Research Workspace
- Interactive Workspace
frontend/app/page.tsx - Document Upload
frontend/components/upload/UploadModal.tsx - Chat and Citations
frontend/components/chat/ChatArea.tsx - Research Traces
frontend/components/research/ResearchPanel.tsx - Metrics Dashboard
frontend/components/dashboard/DashboardView.tsx - RAG Settings
frontend/components/settings/SettingsDrawer.tsx - REST API Client
frontend/lib/api.ts
Backend API
- FastAPI Application
backend/app/main.py - Document Management
backend/app/api/documents.py - Grounded Chat
backend/app/api/chat.py - Direct Retrieval
backend/app/api/retrieve.py - Experiment History
backend/app/api/experiments.py - Dashboard Metrics
backend/app/api/dashboard.py - Runtime Configuration
backend/app/api/config_routes.py
RAG Services
- Document Pipeline
backend/app/services/pipeline.py - Text Extraction
backend/app/services/ingestion.py - Chunking and Pages
backend/app/services/chunking.py - Local Embeddings
backend/app/services/embeddings.py - Semantic Retrieval
backend/app/services/retrieval.py - Answer Generation
backend/app/services/generation.py - Grounding Prompts
backend/app/utils/prompt.py
Persistence
- Vector Index
backend/app/services/vector_store.py - Metadata and Traces
backend/app/services/storage.py
Other components
- AI Engineer
Connections 35
- AI Engineer → Interactive Workspace: uses
README.md - Interactive Workspace → Document Upload: offers upload
README.md - Interactive Workspace → Chat and Citations: offers chat
README.md - Interactive Workspace → Research Traces: offers experiments
README.md - Interactive Workspace → Metrics Dashboard: shows metrics
README.md - Interactive Workspace → RAG Settings: edits settings
README.md - Document Upload → REST API Client: submits files
- Chat and Citations → REST API Client: sends queries
- Research Traces → REST API Client: requests traces
- Metrics Dashboard → REST API Client: requests metrics
- RAG Settings → REST API Client: updates settings
- REST API Client → FastAPI Application: calls REST
- FastAPI Application → Document Management: registers routes
backend/app/main.py - FastAPI Application → Grounded Chat: registers routes
backend/app/main.py - FastAPI Application → Direct Retrieval: registers routes
backend/app/main.py - FastAPI Application → Experiment History: registers routes
backend/app/main.py - FastAPI Application → Dashboard Metrics: registers routes
backend/app/main.py - FastAPI Application → Runtime Configuration: registers routes
backend/app/main.py - Document Management → Document Pipeline: processes documents
backend/app/api/documents.py - Document Management → Metadata and Traces: manages metadata
backend/app/api/documents.py - Document Management → Vector Index: deletes index
backend/app/api/documents.py - Document Pipeline → Metadata and Traces: loads status
backend/app/services/pipeline.py - Document Pipeline → Text Extraction: extracts text
backend/app/services/pipeline.py - Document Pipeline → Chunking and Pages: creates chunks
backend/app/services/pipeline.py - Document Pipeline → Local Embeddings: embeds chunks
backend/app/services/pipeline.py - Document Pipeline → Vector Index: indexes chunks
backend/app/services/pipeline.py - Grounded Chat → Semantic Retrieval: retrieves evidence
backend/app/api/chat.py - Grounded Chat → Answer Generation: generates answer
backend/app/api/chat.py - Grounded Chat → Metadata and Traces: logs traces
backend/app/api/chat.py - Direct Retrieval → Semantic Retrieval: retrieves chunks
backend/app/api/retrieve.py - Semantic Retrieval → Local Embeddings: embeds query
backend/app/services/retrieval.py - Semantic Retrieval → Vector Index: searches index
backend/app/services/retrieval.py - Answer Generation → Grounding Prompts: uses guardrails
backend/app/services/generation.py - Experiment History → Metadata and Traces: reads traces
backend/app/api/experiments.py - Dashboard Metrics → Metadata and Traces: reads statistics
backend/app/api/dashboard.py