Infrastructure Setup:
- Initialized Git repository
- Created project directory structure (backend, frontend, infrastructure)
- Configured Docker Compose with 4 services:
* PostgreSQL 16 (database)
* Redis 7 (cache & task queue)
* Qdrant (vector database)
* Backend (placeholder)
Configuration:
- Created comprehensive .env.example with all required environment variables
- Added .gitignore for Python and Node.js
- Created backend Dockerfile (placeholder for Phase 2)
- Added healthchecks for all services
Documentation:
- Created README.md with quick start guide and project overview
- Documented implementation plan (6 phases)
- Included concept and technical specifications
Verification:
- docker-compose build: ✅ Successful
- All services started and passed health checks:
* PostgreSQL: Accepting connections on port 5432
* Redis: Responding to ping on port 6379
* Qdrant: API healthy on port 6333
Next Phase: Backend Core (FastAPI, Entra ID Auth, RBAC, Alembic migrations)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4.3 KiB
📄 Project Specification: Enterprise AI Hub ("Nexus")
-
Executive Summary Development of a unified, role-based corporate AI platform serving as a "Single Source of Truth" and productivity engine. The system integrates Retrieval-Augmented Generation (RAG) from SharePoint, AI-powered utility tools, and external local AI services (NotebookLlama) into a single, high-performance SPA interface.
-
Technical Architecture (The Stack) Frontend (Client) Framework: Next.js 14+ (React) (App Router) for server-side rendering and SEO-readiness. Language: TypeScript. UI Library: Shadcn/UI + Tailwind CSS (for the "Clean, Apple-like, Fast" aesthetic). State Management: Zustand (client state) + TanStack Query (server state/caching). Streaming: Use generic Vercel AI SDK or native EventSource for real-time text streaming (typing effect). Backend (Server) Framework: FastAPI (Python 3.11+) – asynchronous, high performance. Orchestration: LangChain / LangGraph – for building stateful agents and complex workflows. Task Queue: Celery + Redis – essential for handling long-running tasks (video transcription, heavy document parsing) without blocking the UI. Authentication: Microsoft Entra ID (Azure AD) via OAuth2/OIDC. No local passwords. Database Layer Relational: PostgreSQL (Users, Roles, Chat History, Analytics, App Configuration). Vector Store: Qdrant (Production-grade, supports filtering by metadata like country_id, dept_id). Cache: Redis (User sessions, API rate limiting).
-
User Roles & Access Control (RBAC) The system enforces strict permission boundaries:
Super Admin: Global Config: Manage LLM providers (OpenAI/Azure/Anthropic), API Keys, System Prompts. User Management: Assign roles (Admin, ContentManager, User), view activity logs. Analytics: Dashboard showing token usage, cost per department, top queried topics. Content Manager: Knowledge Base: Configure SharePoint site URLs and document libraries for ingestion. Taxonomy: Map SharePoint folders to system tags (e.g., Folder "UK_Policy" -> Tag Region: UK). Quality Control: Review "Thumbs down" feedback from users and adjust RAG context. Standard User: Access to the 3 functional modes (RAG, Assistant, Notebook). Personal settings (Theme, Language). 4. Core Functional Modes Mode A: Corporate RAG Agent (The "Oracle") Data Source: Microsoft SharePoint via MS Graph API. Ingestion Pipeline: Scheduled Sync (Celery Task) -> Extract Text -> Chunking -> Embedding -> Qdrant. Retrieval Logic: Strictness: "Answer ONLY based on context. If unknown, state 'I don't know'." Citations: Every assertion must include a clickable link to the source file (deep link to SharePoint web viewer). Permissions: (Phase 2) Implement "Security Trimming" – filter search results based on user's Entra ID group membership. Mode B: AI Executive Assistant (Productivity) Input: Text, Uploaded Files (Audio/Video/PDF). Features: Meeting Analyst: Transcribe audio (via Whisper API) -> Generate "Executive Summary" -> Extract "Action Items" (JSON format). Task Extractor: Parse informal text requests into structured tasks (Title, Assignee, Deadline). Translator: Context-aware translation preserving Markdown formatting. Mode C: Notebook Mode (Ad-Hoc Analysis) Integration: Frontend wrapper for an existing on-premise NotebookLlama instance. Workflow: User creates a temporary "Session". Uploads disjointed files (a PDF, a CSV, a Video). Chat context is isolated strictly to these uploaded files (no global knowledge). Mechanism: REST API calls to the NotebookLlama server (/upload, /chat). 5. Integrations & Scalability External Systems NotebookLlama: Connect via internal REST API. SharePoint: Deep integration via MS Graph API (Files.Read.All). Future Internal Apps: Architecture: The Backend must expose a standard API Gateway. UI Implementation: "App Drawer" or "Action Buttons" in the chat interface that trigger webhooks to other internal tools (e.g., "Create Jira Ticket"). Feedback Loop Every AI response must have 👍 / 👎 buttons. Negative feedback triggers a log entry for the Content Manager to review. 6. UI/UX Requirements Responsiveness: Mobile-first design (hamburger menus on mobile, sidebars on desktop). Visuals: Dark/Light mode support (system default). Performance: Optimistic UI updates (interface reacts before server responds). Skeleton loaders for data fetching. Micro-interactions: Smooth transitions, typing indicators, copy-to-clipboard code blocks.