How technoritesh152005/rag works
DocuFlux is a workspace-scoped documentation ingestion and grounded-Q&A product. Users add web pages, PDFs, or YouTube videos; background processing extracts and chunks content, deduplicates it, and indexes it for retrieval. In a workspace, chat combines vector and keyword search, then streams cited answers. The graph also preserves the documented workspace, FAQ, analytics, and evaluation capabilities. Some implementation details—especially YouTube/PDF processing, socket routing, and cache internals—are documented but not excerpted, so those links cite the README rather than implying source inspection.
Main entry points: server.js Fastify API · rag.service.js RAG orchestration · ingestion.job.js Index storage · App.jsx React app
Components 29
Workspace client
- React app
Frontend/src/App.jsx - Workspace UI
Frontend/src/pages/WorkspacePage.jsx - Source panel
Frontend/src/features/sources/SourcePanel.jsx - Chat panel
Frontend/src/features/chat/ChatPanel.jsx
API and workspace
- Fastify API
Backend/src/server.js - Token authentication
Backend/src/modules/auth/auth_middleware.js - Workspace operations
Backend/src/modules/workspace/workspace_service.js - Source management
Backend/src/modules/sources/source.service.js - PDF upload
Backend/src/modules/sources/pdf-upload.routes.js - PDF object storage
Backend/src/lib/supabase.storage.js - Realtime gateway
Backend/src/modules/chat/chat.gateway.js - Workspace FAQs
Backend/src/modules/chat/faq.service.js
Ingestion and indexing
- Ingestion queue
Backend/src/modules/jobs/queue.js - Ingestion worker
Backend/src/worker/ingestion.worker.js - Content extraction
Backend/src/modules - Chunking and dedup
Backend/src/modules/crawler/chunker.service.js - Local embeddings
Backend/src/modules/Embeeding/embeeding.service.config.js - Index storage
Backend/src/modules/jobs/ingestion.job.js
Retrieval and answers
- Pinecone vectors
Backend/src/modules/vector-store/pinecone.service.js - PostgreSQL chunks
Backend/src/modules/vector-store/fullTextSearch.service.js - RAG orchestration
Backend/src/modules/chat/rag.service.js - Hybrid retrieval
Backend/src/modules/vector-store/hybrid.service.js - Redis answer caches
Backend/src/modules/cache - Groq generation
Backend/src/modules/chat/groq.service.js
Evaluation and insights
- Usage analytics
Backend/src/modules/analytics/usage.service.js - Evaluation runs
Backend/src/modules/eval/eval.service.js
Other components
- User
- Supabase Auth
- Web, PDF, video sources
Connections 39
- User → React app: uses
README.md - React app → Workspace UI: routes to
Frontend/src/App.jsx - Workspace UI → Source panel: renders
Frontend/src/pages/WorkspacePage.jsx - Workspace UI → Chat panel: renders
Frontend/src/pages/WorkspacePage.jsx - React app → Supabase Auth: authenticates with
README.md - React app → Fastify API: HTTP requests
README.md - Fastify API → Token authentication: validates access
Backend/src/server.js - Token authentication → Supabase Auth: validates token
README.md - Fastify API → Workspace operations: routes workspace requests
Backend/src/server.js - Source panel → Fastify API: submits sources
README.md - Fastify API → Source management: routes source requests
Backend/src/server.js - Fastify API → PDF upload: routes PDF uploads
Backend/src/server.js - PDF upload → PDF object storage: creates upload URL
Backend/src/modules/sources/pdf-upload.routes.js - PDF upload → Ingestion queue: enqueues indexing
Backend/src/modules/sources/pdf-upload.routes.js - Web, PDF, video sources → Ingestion queue: submits URLs and videos
README.md - PDF object storage → Content extraction: provides PDF
README.md - Ingestion queue → Ingestion worker: dispatches jobs
Backend/src/worker/ingestion.worker.js - Ingestion worker → Content extraction: crawls source
Backend/src/worker/ingestion.worker.js - Content extraction → Chunking and dedup: sections content
Backend/src/modules/crawler/crawler.service.js - Ingestion worker → Index storage: sends chunks
Backend/src/worker/ingestion.worker.js - Index storage → Local embeddings: embeds chunks
Backend/src/modules/jobs/ingestion.job.js - Index storage → Pinecone vectors: upserts vectors
Backend/src/modules/jobs/ingestion.job.js - Index storage → PostgreSQL chunks: stores searchable chunks
Backend/src/modules/jobs/ingestion.job.js - Chat panel → Fastify API: sends questions
README.md - Fastify API → RAG orchestration: dispatches chat
- RAG orchestration → Local embeddings: embeds question
Backend/src/modules/chat/rag.service.js - RAG orchestration → Redis answer caches: checks and stores answers
Backend/src/modules/chat/rag.service.js - RAG orchestration → Hybrid retrieval: requests retrieval
Backend/src/modules/chat/rag.service.js - Hybrid retrieval → Pinecone vectors: searches vectors
Backend/src/modules/vector-store/hybrid.service.js - Hybrid retrieval → PostgreSQL chunks: searches keywords
Backend/src/modules/vector-store/hybrid.service.js - RAG orchestration → Groq generation: streams generation
Backend/src/modules/chat/rag.service.js - RAG orchestration → Realtime gateway: streams cited answers
README.md - Realtime gateway → React app: streams chat and status
README.md - Ingestion worker → Realtime gateway: publishes source progress
README.md - Fastify API → Workspace FAQs: serves FAQ requests
Backend/src/server.js - Workspace UI → Evaluation runs: runs evaluations
Frontend/src/pages/WorkspacePage.jsx - Fastify API → Evaluation runs: routes evaluation requests
- RAG orchestration → Usage analytics: records usage
Backend/src/modules/chat/rag.service.js - Index storage → Usage analytics: records ingestion usage
Backend/src/modules/jobs/ingestion.job.js