How ledat98/nexusrag works
NexusRAG is a document knowledge-base product: users organize workspaces, upload and process documents, then search or chat over the indexed material with citations, graph context, and extracted visual content. The graph follows the documented processing and hybrid-retrieval stages and includes the web UI, API, persistence, model providers, and MCP entry point. Several frontend and API relationships are supported only by README capability descriptions or are not excerpted; those connections are omitted rather than inferred.
Main entry points: nexus_rag_service.py RAG orchestration · rag.py RAG endpoints · router.py HTTP API · chat_agent.py Agentic chat
Components 27
Web application
- Workspace UI
frontend/src/App.tsx - Workspace pages
frontend/src/pages/WorkspacePage.tsx - Chat and citations
frontend/src/components/rag/ChatPanel.tsx - Search results
frontend/src/components/rag/SearchResults.tsx - Document viewer
frontend/src/components/rag/DocumentViewer.tsx
API and domain
- HTTP API
backend/app/api/router.py - Document operations
backend/app/api/documents.py - RAG endpoints
backend/app/api/rag.py - Agentic chat
backend/app/api/chat_agent.py - Chat prompting
backend/app/api/chat_prompt.py - Workspace management
backend/app/api/workspaces.py
Document ingestion
- RAG orchestration
backend/app/services/nexus_rag_service.py - Document parsers
backend/app/services/document_parser/docling_parser.py - Parsed document model
backend/app/services/models/parsed_document.py - Semantic chunking
backend/app/services/chunker.py - Basic RAG service
backend/app/services/rag_service.py
Hybrid retrieval
- Hybrid retriever
backend/app/services/deep_retriever.py - Vector embeddings
backend/app/services/embedder.py - Vector index
backend/app/services/vector_store.py - Knowledge graph
backend/app/services/knowledge_graph_service.py - Cross-encoder reranker
backend/app/services/reranker.py - LLM providers
backend/app/services/llm/__init__.py
Persistence
- Relational database
backend/app/core/database.py - Workspace and document records
backend/app/models/document.py - Chat history records
backend/app/models/chat_message.py
Other components
- Knowledge worker
- MCP integration
mcp-server/src/index.ts
Connections 39
- Knowledge worker → Workspace UI: uses
- Workspace UI → Workspace pages: routes to
frontend/src/App.tsx - Knowledge worker → MCP integration: requests tools
- Workspace pages → HTTP API: calls API
- Chat and citations → HTTP API: streams chat
- Search results → HTTP API: requests search
- Document viewer → HTTP API: loads sources
- HTTP API → Document operations: routes to
backend/app/api/router.py - HTTP API → RAG endpoints: routes to
backend/app/api/router.py - Document operations → RAG orchestration: processes documents
backend/app/api/documents.py - RAG endpoints → RAG orchestration: reindexes documents
backend/app/api/rag.py - RAG endpoints → Basic RAG service: queries service
backend/app/api/rag.py - RAG endpoints → Agentic chat: dispatches chat
backend/app/api/rag.py - Agentic chat → Chat prompting: builds prompts
backend/app/api/chat_agent.py - Agentic chat → Basic RAG service: queries service
backend/app/api/chat_agent.py - Agentic chat → RAG orchestration: uses deep RAG
backend/app/api/chat_agent.py - RAG orchestration → Document parsers: parses documents
backend/app/services/nexus_rag_service.py - Document parsers → Parsed document model: produces parsed data
backend/app/services/document_parser/docling_parser.py - Document parsers → Semantic chunking: chunks content
backend/app/services/document_parser/docling_parser.py - RAG orchestration → Parsed document model: persists extracted media
backend/app/services/nexus_rag_service.py - RAG orchestration → Vector embeddings: embeds chunks
backend/app/services/nexus_rag_service.py - RAG orchestration → Vector index: indexes chunks
backend/app/services/nexus_rag_service.py - RAG orchestration → Knowledge graph: builds graph
backend/app/services/nexus_rag_service.py - Basic RAG service → Semantic chunking: chunks text
backend/app/services/rag_service.py - Basic RAG service → Vector embeddings: embeds chunks
backend/app/services/rag_service.py - Basic RAG service → Vector index: indexes chunks
backend/app/services/rag_service.py - Hybrid retriever → Vector embeddings: embeds query
backend/app/services/deep_retriever.py - Hybrid retriever → Vector index: retrieves candidates
backend/app/services/deep_retriever.py - Hybrid retriever → Knowledge graph: retrieves entities
backend/app/services/deep_retriever.py - Hybrid retriever → Cross-encoder reranker: reranks candidates
backend/app/services/deep_retriever.py - RAG orchestration → Hybrid retriever: retrieves context
backend/app/services/nexus_rag_service.py - Agentic chat → LLM providers: generates responses
backend/app/api/chat_agent.py - Knowledge graph → LLM providers: extracts graph knowledge
backend/app/services/knowledge_graph_service.py - Relational database → Workspace and document records: defines ORM base
backend/app/models/document.py - Relational database → Chat history records: defines ORM base
backend/app/models/chat_message.py - Document operations → Workspace and document records: reads and writes
backend/app/api/documents.py - RAG endpoints → Workspace and document records: reads and writes
backend/app/api/rag.py - RAG endpoints → Chat history records: loads history
backend/app/api/rag.py - RAG orchestration → Workspace and document records: updates document state
backend/app/services/nexus_rag_service.py