How devanshu23bcs030/rag-eval-project works
This is a PDF chat and retrieval-augmented generation platform with an evaluation harness. Users authenticate, upload a PDF with a retrieval strategy, then chat against its indexed contents and review cited source chunks; they can also manage documents and credits. Upload processing runs asynchronously, while question answering retrieves context, generates an answer, and records chat and evaluation telemetry. The graph preserves the documented fixed, semantic, and hybrid retrieval options. Several frontend/backend and external-service links are based on README architecture statements because the relevant implementation wiring was not excerpted.
Main entry points: documentController.js Document controller · App.jsx App navigation · server.js Express API · pdfWorker.js PDF worker
Components 28
User interface
- App navigation
frontend/src/App.jsx - Sign-in screen
frontend/src/components/AuthScreen.jsx - Upload screen
frontend/src/components/UploadScreen.jsx - Document list
frontend/src/components/DocumentListScreen.jsx - Chat screen
frontend/src/components/ChatScreen.jsx - Credit screen
frontend/src/components/PaymentScreen.jsx
API and identity
- Express API
backend/src/server.js - Auth controller
backend/src/controllers/authController.js - JWT authentication
backend/src/middleware/authMiddleware.js - Document controller
backend/src/controllers/documentController.js - Delete route
backend/src/routes/documentRoutes.js - PDF upload middleware
backend/src/middleware/upload.js
PDF and retrieval
- PDF worker
backend/src/workers/pdfWorker.js - PDF parsing
backend/src/services/pdfService.js - Chunking strategies
backend/src/services/chunkingService.js - Vector and hybrid search
backend/src/services/vectorStore.js - BM25 ranking
backend/src/services/bm25Service.js - Answer generation
backend/src/services/llmService.js
Data and telemetry
- MongoDB
- Document, user, chat models
backend/src/models - SQLite telemetry
backend/src/services/dbService.js
Retrieval evaluation
- Strategy benchmark
backend/benchmarks/runEvals.js
Other components
- User
- Clerk identity
- Cloudinary files
- Redis job queue
- ChromaDB index
- Gemini model
Connections 35
- User → App navigation: uses
README.md - App navigation → Sign-in screen: renders
frontend/src/App.jsx - App navigation → Upload screen: renders
frontend/src/App.jsx - App navigation → Document list: renders
frontend/src/App.jsx - App navigation → Chat screen: renders
frontend/src/App.jsx - App navigation → Credit screen: renders
frontend/src/App.jsx - Sign-in screen → Clerk identity: authenticates
README.md - App navigation → Express API: calls auth API
frontend/src/App.jsx - Express API → Auth controller: routes auth
backend/src/server.js - Express API → JWT authentication: guards endpoints
backend/src/server.js - Express API → Document controller: routes document API
backend/src/server.js - Express API → Delete route: mounts delete route
backend/src/server.js - Delete route → JWT authentication: guards delete
backend/src/routes/documentRoutes.js - Delete route → Document controller: dispatches delete
backend/src/routes/documentRoutes.js - Express API → PDF upload middleware: accepts PDF
backend/src/server.js - Document controller → Document, user, chat models: reads and writes
backend/src/controllers/documentController.js - Auth controller → Document, user, chat models: reads and writes users
backend/src/controllers/authController.js - Document controller → Cloudinary files: uploads PDF
README.md - Document controller → Redis job queue: enqueues processing
backend/src/controllers/documentController.js - Express API → PDF worker: starts worker
backend/src/server.js - PDF worker → Redis job queue: consumes jobs
README.md - PDF worker → PDF parsing: parses PDF
backend/src/workers/pdfWorker.js - PDF worker → Chunking strategies: creates chunks
backend/src/workers/pdfWorker.js - PDF worker → Vector and hybrid search: indexes chunks
backend/src/workers/pdfWorker.js - PDF worker → Document, user, chat models: updates status
backend/src/workers/pdfWorker.js - Document controller → Vector and hybrid search: retrieves chunks
backend/src/controllers/documentController.js - Vector and hybrid search → BM25 ranking: uses ranking
backend/src/services/vectorStore.js - Vector and hybrid search → ChromaDB index: searches index
README.md - Document controller → Answer generation: passes retrieved context
backend/src/controllers/documentController.js - Answer generation → Gemini model: generates answer
backend/src/services/llmService.js - Document controller → SQLite telemetry: logs interaction
backend/src/controllers/documentController.js - Document controller → Document, user, chat models: stores chat history
backend/src/controllers/documentController.js - Document controller → ChromaDB index: deletes collection
backend/src/controllers/documentController.js - Strategy benchmark → Vector and hybrid search: compares strategies
README.md - Strategy benchmark → SQLite telemetry: records scores
README.md