How veerasairakeshpasupuleti/rag-knowledge-hub works
RAG Knowledge Hub combines a Java API for users, collections, documents, and conversations with a Python retrieval-augmented generation service. The main content workflow is document upload and indexing, followed by collection-scoped question answering that returns an answer and mapped sources. The graph preserves authentication and collection/chat management as separate product branches. Several implementation files are not sampled, so links involving those implementations are omitted; the README offers no additional capability details.
Main entry points: services.py AI service wiring · indexing_service.py Document indexing · query_service.py Question service · AuthService.java Authentication
Components 23
Java API
- Chat endpoints
backend/rag-ui/src/main/java/com/raghub/ragapi/controllers/ChatController.java - Chat operations
backend/rag-ui/src/main/java/com/raghub/ragapi/service/ChatService.java - Collection endpoints
backend/rag-ui/src/main/java/com/raghub/ragapi/controllers/CollectionController.java - Collection operations
backend/rag-ui/src/main/java/com/raghub/ragapi/service/CollectionService.java
Document management
- Document endpoints
backend/rag-ui/src/main/java/com/raghub/ragapi/controllers/DocumentController.java - Document operations
backend/rag-ui/src/main/java/com/raghub/ragapi/service/DocumentService.java - File storage
backend/rag-ui/src/main/java/com/raghub/ragapi/service/StorageService.java - Document indexing
ai-service/app/services/indexing_service.py - Format loaders
ai-service/app/loaders/loader_factory.py
AI retrieval and generation
- Text chunking
ai-service/app/chunking/chunking_service.py - Embedding generation
ai-service/app/embeddings/embedding_service.py - Vector search
ai-service/app/vectorstore/chroma_service.py - Question service
ai-service/app/services/query_service.py - RAG workflow
ai-service/app/graph/rag_graph.py - Retrieval and answer nodes
ai-service/app/graph/rag_nodes.py - AI service wiring
ai-service/app/dependencies/services.py - Prompt construction
ai-service/app/prompt/prompt_builder.py - Language model
ai-service/app/llm/chatgroq_service.py - Source mapping
ai-service/app/mapper/source_mapper.py
Authentication
- Authentication
backend/rag-ui/src/main/java/com/raghub/ragapi/service/impl/AuthService.java - User records
backend/rag-ui/src/main/java/com/raghub/ragapi/repository/UserRepository.java - JWT creation
backend/rag-ui/src/main/java/com/raghub/ragapi/service/impl/JwtService.java
Other components
- User
Connections 16
- User → Chat endpoints: sends requests
backend/rag-ui/src/main/java/com/raghub/ragapi/controllers/ChatController.java - Chat endpoints → Chat operations: delegates chat
backend/rag-ui/src/main/java/com/raghub/ragapi/controllers/ChatController.java - User → Document endpoints: uploads documents
backend/rag-ui/src/main/java/com/raghub/ragapi/controllers/DocumentController.java - Document endpoints → Document operations: delegates document work
backend/rag-ui/src/main/java/com/raghub/ragapi/controllers/DocumentController.java - Document indexing → Format loaders: selects loaders
ai-service/app/services/indexing_service.py - Document indexing → AI service wiring: uses AI services
ai-service/app/services/indexing_service.py - AI service wiring → Text chunking: constructs service
ai-service/app/dependencies/services.py - AI service wiring → Embedding generation: constructs service
ai-service/app/dependencies/services.py - AI service wiring → Vector search: constructs service
ai-service/app/dependencies/services.py - AI service wiring → Prompt construction: constructs builder
ai-service/app/dependencies/services.py - AI service wiring → Language model: constructs service
ai-service/app/dependencies/services.py - Question service → RAG workflow: invokes workflow
ai-service/app/services/query_service.py - Question service → Source mapping: maps sources
ai-service/app/services/query_service.py - Retrieval and answer nodes → AI service wiring: uses services
ai-service/app/graph/rag_nodes.py - Authentication → User records: reads and saves users
backend/rag-ui/src/main/java/com/raghub/ragapi/service/impl/AuthService.java - Authentication → JWT creation: generates token
backend/rag-ui/src/main/java/com/raghub/ragapi/service/impl/AuthService.java