How rakno-27/enterprise-ai-knowledge-assistant works
Enterprise AI Assistant is a web application for chat with optional retrieval-augmented generation and document management. Users submit chat messages or upload documents through the frontend; the frontend API calls the backend, whose chat service coordinates RAG when enabled. The RAG service handles document ingestion and retrieval, including OCR, chunking, metadata, embeddings, hybrid search, and reranking. The tree and excerpts establish several service dependencies, but endpoint internals and most auxiliary service implementations were not sampled, so those relationships are marked unverified or omitted.
Main entry points: rag_service.py RAG and ingestion · App.tsx Application shell · api.ts Frontend API client · chat_service.py Chat orchestration
Components 21
Web interface
- Application shell
enterprise-ai-assistant/frontend/src/App.tsx - Chat interface
enterprise-ai-assistant/frontend/src/components/ChatArea.tsx - Document manager
enterprise-ai-assistant/frontend/src/components/DocumentModal.tsx - Session sidebar
enterprise-ai-assistant/frontend/src/components/Sidebar.tsx - Frontend API client
enterprise-ai-assistant/frontend/src/lib/api.ts
Backend API
- API application
enterprise-ai-assistant/backend/app/main.py - API endpoints
enterprise-ai-assistant/backend/app/api/v1/endpoints.py - Chat orchestration
enterprise-ai-assistant/backend/app/services/chat_service.py - Chat contracts
enterprise-ai-assistant/backend/app/schemas/chat.py
Knowledge pipeline
- RAG and ingestion
enterprise-ai-assistant/backend/app/services/rag_service.py - Document OCR
enterprise-ai-assistant/backend/app/services/ocr_service.py - Text chunking
enterprise-ai-assistant/backend/app/services/chunking_service.py - Metadata extraction
enterprise-ai-assistant/backend/app/services/metadata_service.py - Search reranking
enterprise-ai-assistant/backend/app/services/rerank_service.py - Document storage
enterprise-ai-assistant/backend/app/services/storage_service.py
Identity and state
- Runtime settings
enterprise-ai-assistant/backend/app/core/config.py - Relational database
enterprise-ai-assistant/backend/app/core/database.py - Authentication
enterprise-ai-assistant/backend/app/core/auth.py - Security utilities
enterprise-ai-assistant/backend/app/core/security.py - Session handling
enterprise-ai-assistant/backend/app/core/session.py
Other components
- User
Connections 21
- User → Application shell: uses
enterprise-ai-assistant/frontend/src/App.tsx - Application shell → Chat interface: renders
enterprise-ai-assistant/frontend/src/App.tsx - Application shell → Document manager: renders
enterprise-ai-assistant/frontend/src/App.tsx - Application shell → Session sidebar: renders
enterprise-ai-assistant/frontend/src/App.tsx - Application shell → Frontend API client: requests data
enterprise-ai-assistant/frontend/src/App.tsx - Chat interface → Frontend API client: loads chat data
enterprise-ai-assistant/frontend/src/components/ChatArea.tsx - Document manager → Frontend API client: manages documents
enterprise-ai-assistant/frontend/src/components/DocumentModal.tsx - Session sidebar → Frontend API client: loads documents
enterprise-ai-assistant/frontend/src/components/Sidebar.tsx - Frontend API client → API endpoints: HTTP requests
enterprise-ai-assistant/frontend/src/lib/api.ts - API application → API endpoints: mounts routes
enterprise-ai-assistant/backend/app/main.py - API application → Relational database: initializes state
enterprise-ai-assistant/backend/app/main.py - API endpoints → Chat orchestration: dispatches chat
enterprise-ai-assistant/backend/app/api/v1/endpoints.py - Chat orchestration → RAG and ingestion: requests retrieval
enterprise-ai-assistant/backend/app/services/chat_service.py - RAG and ingestion → Text chunking: chunks text
enterprise-ai-assistant/backend/app/services/rag_service.py - RAG and ingestion → Metadata extraction: extracts metadata
enterprise-ai-assistant/backend/app/services/rag_service.py - RAG and ingestion → Search reranking: reranks matches
enterprise-ai-assistant/backend/app/services/rag_service.py - RAG and ingestion → Document storage: uses storage
enterprise-ai-assistant/backend/app/services/rag_service.py - RAG and ingestion → Document OCR: extracts text
enterprise-ai-assistant/backend/app/services/rag_service.py - Relational database → Runtime settings: reads settings
enterprise-ai-assistant/backend/app/core/database.py - Document storage → Runtime settings: reads settings
enterprise-ai-assistant/backend/app/services/storage_service.py - Chat orchestration → Chat contracts: uses contracts
enterprise-ai-assistant/backend/app/services/chat_service.py