How srivarun-04/neural-core works
NuraVault is a React and FastAPI knowledge-and-chat workspace. Users chat with a tool-calling agent that can answer directly, calculate, or retrieve document context; responses can include citations and stream to the chat UI. Separate workflows manage uploaded documents and multi-session history, while the knowledge dashboard and sidebar expose those capabilities. The README documents broader UI features; relationships below are limited to README statements and the shown source excerpts or SOURCE INDEX references, so some unsampled internals are represented at subsystem level.
Main entry points: document_manager.py Document lifecycle · App.tsx Workspace shell · main.py FastAPI application · api.ts HTTP and SSE client
Components 26
Workspace UI
- Workspace shell
frontend/src/App.tsx - Chat workspace
frontend/src/components/Chat/ChatArea.tsx - Session manager
frontend/src/components/Sidebar/Sidebar.tsx - Knowledge dashboard
frontend/src/components/KnowledgeBase/KnowledgeBase.tsx - Chat state
frontend/src/hooks/useChat.ts - HTTP and SSE client
frontend/src/services/api.ts - Local preferences
frontend/src/utils/storage.ts
API Layer
- FastAPI application
main.py - Chat endpoints
backend/api/chat.py - Session endpoints
backend/api/chats.py - Document endpoints
backend/api/documents.py - Upload endpoint
backend/api/upload.py - Health endpoint
backend/api/health.py
Agent and Retrieval
- Neural agent
backend/agents/neural_agent.py - Safe calculator
backend/tools/calculator_tool.py - Knowledge search tool
backend/tools/rag_tool.py
Knowledge Ingestion
- Document lifecycle
backend/services/document_manager.py - File loaders
backend/rag/loaders.py - Chunk preparation
backend/rag/splitter.py - Text embeddings
backend/rag/embeddings.py - FAISS index
backend/database/vector_store.py
Conversation Memory
- Session persistence
backend/services/conversation_service.py - Sliding history
backend/services/memory_service.py - SQLite history
backend/database/sqlite_db.py
Other components
- Workspace user
- OpenRouter model
Connections 37
- Workspace user → Workspace shell: uses
- Workspace shell → Chat workspace: shows
frontend/src/App.tsx - Workspace shell → Session manager: shows
frontend/src/App.tsx - Workspace shell → Knowledge dashboard: shows
frontend/src/App.tsx - Workspace shell → Chat state: uses
frontend/src/App.tsx - Chat state → HTTP and SSE client: calls
frontend/src/hooks/useChat.ts - Workspace shell → Local preferences: persists settings
frontend/src/App.tsx - HTTP and SSE client → Chat endpoints: HTTP / SSE
- HTTP and SSE client → Session endpoints: manages sessions
- HTTP and SSE client → Document endpoints: reads documents
- HTTP and SSE client → Upload endpoint: uploads files
- Workspace shell → Health endpoint: polls health
frontend/src/App.tsx - FastAPI application → Chat endpoints: mounts router
main.py - FastAPI application → Session endpoints: mounts router
main.py - FastAPI application → Document endpoints: mounts router
main.py - FastAPI application → Upload endpoint: mounts router
main.py - FastAPI application → Health endpoint: mounts router
main.py - Chat endpoints → Neural agent: invokes
backend/api/chat.py - Chat endpoints → Sliding history: loads history
backend/api/chat.py - Chat endpoints → Session persistence: stores turns
backend/api/chat.py - Session endpoints → Session persistence: manages sessions
backend/api/chats.py - Document endpoints → Document lifecycle: manages documents
backend/api/documents.py - Upload endpoint → Document lifecycle: indexes uploads
backend/api/upload.py - Health endpoint → Document lifecycle: reports status
backend/api/health.py - Health endpoint → Neural agent: reports status
backend/api/health.py - Neural agent → OpenRouter model: requests completions
- Neural agent → Safe calculator: dispatches calculations
backend/agents/neural_agent.py - Neural agent → Knowledge search tool: dispatches searches
backend/agents/neural_agent.py - Knowledge search tool → Document lifecycle: retrieves context
backend/tools/rag_tool.py - Document lifecycle → File loaders: loads files
backend/services/document_manager.py - Document lifecycle → Chunk preparation: chunks content
backend/services/document_manager.py - Document lifecycle → Text embeddings: creates vectors
backend/services/document_manager.py - Document lifecycle → FAISS index: updates index
backend/services/document_manager.py - Knowledge search tool → FAISS index: searches index
backend/tools/rag_tool.py - Sliding history → Session persistence: reads recent turns
backend/services/memory_service.py - Session persistence → SQLite history: queries and writes
backend/services/conversation_service.py - FastAPI application → Document lifecycle: syncs at startup
main.py