How ankit65k/ragcx works
RagCX is a PDF knowledge-base and RAG chat platform. Users authenticate, upload documents, and ask questions; the API persists sessions and relays chat/document events through Redis to the Python AI service, which processes documents into a vector store and retrieves context for generated answers. The frontend also exposes document management, suggested questions, dashboard, and settings capabilities. Edges reflect the README’s service architecture and the supplied source excerpts/index; unsampled subsystem internals and some runtime wiring are not asserted.
Main entry points: app.ts REST API · app Web experience · pipeline.py Chat event pipeline · engine.py Workflow engine
Components 27
Web frontend
- Web experience
frontend/src/app - Authentication UI
frontend/src/features/auth - Chat UI
frontend/src/features/chat - Document UI
frontend/src/features/documents - Dashboard and settings
frontend/src/features
API and domain
- REST API
backend/src/app.ts - Auth and sessions
backend/src/modules/auth/services/auth.service.ts - Document management
backend/src/modules/documents - Chat and questions API
backend/src/modules/chat/controllers/chat.controller.ts - Dashboard API
backend/src/modules/dashboard/controllers/dashboard.controller.ts
AI workflows
- AI service
ai-service/app/main.py - Chat event pipeline
ai-service/app/chat/pipeline.py - Workflow engine
ai-service/app/workflows/engine.py - RAG answer generation
ai-service/app/rag/pipeline.py - Suggested questions
ai-service/app/questions/pipeline.py - Conversation memory
ai-service/app/memory/manager.py - Document processing
ai-service/app/workflows/definitions/document_processing.py - Embeddings
ai-service/app/embeddings/service.py - Retrieval
ai-service/app/retrievers/services.py
Infrastructure
- Storage provider
backend/src/infrastructure/storage/storage.factory.ts - Local file storage
backend/src/infrastructure/storage/providers/local-storage.provider.ts - PostgreSQL data
backend/src/database/client/index.ts - Redis Pub/Sub
backend/src/infrastructure/redis - Chroma vector store
ai-service/app/vector_store/chroma.py - Ollama model
ai-service/app/models/ollama.py
Other components
- User
- PDF files
Connections 34
- User → Web experience: uses
- Web experience → Authentication UI: offers sign-in
frontend/src/features/auth/hooks/useAuth.ts - Authentication UI → REST API: calls REST
- Web experience → Chat UI: offers chat
- Web experience → Document UI: offers uploads
- Web experience → Dashboard and settings: offers tools
- Chat UI → REST API: calls REST
- Document UI → REST API: calls REST
- REST API → Auth and sessions: routes requests
- REST API → Document management: routes requests
- REST API → Chat and questions API: routes requests
- REST API → Dashboard API: routes requests
backend/src/modules/dashboard/controllers/dashboard.controller.ts - Auth and sessions → PostgreSQL data: persists accounts
- Document management → Storage provider: stores files
- Storage provider → Local file storage: creates provider
backend/src/infrastructure/storage/storage.factory.ts - Document management → Redis Pub/Sub: publishes document events
- Chat and questions API → Redis Pub/Sub: publishes chat events
backend/src/modules/chat/controllers/chat.controller.ts - Chat and questions API → PostgreSQL data: persists chat data
backend/src/modules/chat/controllers/chat.controller.ts - Dashboard API → PostgreSQL data: reads metrics
backend/src/modules/dashboard/controllers/dashboard.controller.ts - Redis Pub/Sub → AI service: delivers events
- AI service → Chat event pipeline: dispatches chat
- Chat event pipeline → Workflow engine: executes workflow
ai-service/app/chat/pipeline.py - Workflow engine → RAG answer generation: runs answer stage
- Workflow engine → Document processing: runs processing stage
- Workflow engine → Suggested questions: runs question stage
- Chat event pipeline → Conversation memory: manages conversation
- RAG answer generation → Retrieval: retrieves context
ai-service/app/rag/pipeline.py - Retrieval → Chroma vector store: searches vectors
- RAG answer generation → Ollama model: generates answer
ai-service/app/rag/pipeline.py - Suggested questions → Ollama model: generates questions
ai-service/app/questions/pipeline.py - Document processing → Embeddings: creates embeddings
- Embeddings → Chroma vector store: stores vectors
- PDF files → Document management: uploads PDF
- Chat event pipeline → Redis Pub/Sub: publishes response
ai-service/app/chat/pipeline.py