---
name: "Enterprise AI Hub Nexus"
client: Oliver Internal
status: production
tech: [Next.js 14, FastAPI, Python 3.11, PostgreSQL, Redis, Qdrant, Azure AD, Docker, Celery, Firecrawl]
local_path: /Users/ai_leed/Documents/Projects/Oliver/enterprise-ai-hub-nexus
deploy: docker compose up --build
url: 
server: TBD
tags: [oliver, ai, rag, nextjs, fastapi, azure-ad, m365, qdrant, firecrawl, production]
created: 2026-04-14
last_commit: 2026-04-01
commits: 216
---

## Overview
Secure AI platform for OLIVER Agency — knowledge management, RAG chat, and Microsoft 365 productivity. Azure AD PKCE authentication. Production status.

Key features:
- **RAG Chat** — vector search over uploaded knowledge base (Qdrant)
- **M365 Integration** — SharePoint sync, To-Do tasks, email (delegated scopes)
- **Recursive Site Crawl** — via Firecrawl /v1/crawl
- **AI Content Structuring** — before RAG indexing
- **Notebook Mode** — structured note-taking with AI

## Tech Stack
- **Frontend:** Next.js 14
- **Backend:** FastAPI + Python 3.11 + Celery workers
- **Database:** PostgreSQL 16 (Alembic migrations, 30+ revisions)
- **Vector DB:** Qdrant (with orphaned vector cleanup)
- **Cache/Queue:** Redis 7
- **Auth:** Azure AD PKCE (delegated scopes + offline_access)
- **Crawling:** Firecrawl /v1/crawl (recursive site crawl)
- **Infrastructure:** Docker + docker-compose

## Architecture
```
Next.js 14 frontend
    ↓ Azure AD PKCE auth
FastAPI backend
    ├── Celery beat (SharePoint sync, scheduled tasks)
    ├── Qdrant (vector search / RAG)
    ├── PostgreSQL (data + migrations)
    └── Redis (queue + cache)
```

## Docker Services
- `nexus-postgres` (PostgreSQL 16)
- `nexus-redis` (Redis 7)
- `nexus-qdrant` (Qdrant vector DB)
- `nexus-backend` (FastAPI)
- frontend (Next.js 14)

## Deployment
- **Run:** `docker compose up --build`
- **Local path:** `/Users/ai_leed/Documents/Projects/Oliver/enterprise-ai-hub-nexus`
- **Status:** Production

## Key Handover Documents
The project has extensive context handover docs in root:
`CONTEXT_HANDOVER_PHASE4.md`, `PHASE5.md`, `PHASE6_*.md`, etc.

## Timeline / Git History
| Date | Change |
|------|--------|
| 2026-04-01 | Fix To-Do tasks filter (MS API rejects complex OR + orderby) |
| 2026-04-01 | Add M365 delegated scopes + offline_access to PKCE login |
| 2026-03-31 | Purge orphaned Qdrant vectors button |
| 2026-03-31 | Batch AI merge (10 pages), doc search, updated user guide |
| 2026-03-31 | Proactive Graph token refresh + needs_reconsent flag |
| 2026-03-31 | SharePoint sync reliability — celery beat, token refresh, scopes |
| 2026-03-31 | AI content structuring before RAG indexing |
| 2026-03-31 | Recursive site crawl via Firecrawl /v1/crawl |

## Sessions
### 2026-04-14 – Project catalogued
**Done:** Added to Obsidian second brain with full details from git history.

---
## Change Log
| Date | Requested | Changed | Files |
|------|-----------|---------|-------|
| 2026-04-01 | Fix MS To-Do filter | Simplify API filter | tasks endpoint |
| 2026-03-31 | Add site crawl | Firecrawl recursive crawl integration | backend |

## Related
- [[Oliver-ai-bot_2.0/Oliver AI Bot 2.0]] (earlier version)
- [[sandbox-notebookllamalm-nextjs/Sandbox NotebookLM]] (same server cluster)
- [[DevOps_Click_UP_sync/DevOps ClickUp Sync]]
