# malikmutaher/nexus-ai architecture

> Architecture diagram of the GitHub repository malikmutaher/nexus-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/malikmutaher/nexus-ai
- Repository: https://github.com/malikmutaher/nexus-ai

## Overview

NEXUS AI OS is a web-based personal assistant. A user enters a chat or uses a dedicated workspace; the frontend sends requests to FastAPI, whose chat path can route commands to assistant tools, while feature-specific API paths support memory, files, tasks, notes, and live information. The tree also shows vision and media capabilities. Source excerpts confirm the application shell, task requests, tool routing, memory persistence, and YouTube search; links for other unsampled feature handlers are intentionally limited.

Main entry points: [`backend/main.py`](https://github.com/malikmutaher/nexus-ai/blob/main/backend/main.py) (FastAPI app), [`src/App.tsx`](https://github.com/malikmutaher/nexus-ai/blob/main/src/App.tsx) (App shell), [`backend/services/ai_service.py`](https://github.com/malikmutaher/nexus-ai/blob/main/backend/services/ai_service.py) (AI service), [`backend/tools/tool_manager.py`](https://github.com/malikmutaher/nexus-ai/blob/main/backend/tools/tool_manager.py) (Command routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Assistant interface"]
  node_app["App shell<br/>[App.tsx]"]
  node_chatpage["Chat workspace<br/>[ChatPage.tsx]"]
  node_featurepages["Feature pages"]
  node_clientapi["API client<br/>[api.ts]"]
end

subgraph group_api["API and chat"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_chatrouter["Chat endpoint<br/>[chat.py]"]
  node_aiservice["AI service<br/>[ai_service.py]"]
  node_llm["LLM client<br/>[llm.py]"]
  node_toolrouter["Command routing<br/>[tool_manager.py]"]
end

subgraph group_productivity["Personal workspace"]
  node_memorytools["Memory operations<br/>[memory_manager.py]"]
  node_productivitytools["Tasks and notes<br/>[productivity.py]"]
  node_memoryapi["Memory endpoint<br/>[memory.py]"]
  node_tasksapi["Tasks endpoint<br/>[tasks.py]"]
  node_notesapi["Notes endpoint<br/>[notes.py]"]
  node_filesapi["Files endpoint<br/>[files.py]"]
  node_database[("SQLite database<br/>[database.py]")]
end

subgraph group_integrations["Live capabilities"]
  node_visionsvc["Vision endpoint<br/>[vision.py]"]
  node_mediasvc["Media endpoint<br/>[media.py]"]
  node_youtubesvc["YouTube search<br/>[youtube_service.py]"]
  node_infoservices["Live information"]
  node_systemapi["System controls<br/>[system.py]"]
end

node_user(("User"))
node_youtube["YouTube API"]

node_user -->|"uses"| node_app
node_app -->|"selects chat"| node_chatpage
node_app -->|"selects workspace"| node_featurepages
node_chatpage -->|"requests"| node_clientapi
node_featurepages -->|"requests"| node_clientapi
node_clientapi -->|"calls API"| node_fastapi
node_fastapi -->|"dispatches"| node_chatrouter
node_fastapi -->|"dispatches"| node_memoryapi
node_fastapi -->|"dispatches"| node_tasksapi
node_fastapi -->|"dispatches"| node_notesapi
node_fastapi -->|"dispatches"| node_filesapi
node_fastapi -->|"dispatches"| node_visionsvc
node_fastapi -->|"dispatches"| node_mediasvc
node_fastapi -->|"dispatches"| node_infoservices
node_fastapi -->|"dispatches"| node_systemapi
node_chatrouter -->|"delegates"| node_aiservice
node_aiservice -->|"uses"| node_llm
node_aiservice -->|"routes commands"| node_toolrouter
node_toolrouter -->|"dispatches"| node_memorytools
node_toolrouter -->|"dispatches"| node_productivitytools
node_memoryapi -->|"uses"| node_memorytools
node_tasksapi -->|"uses"| node_productivitytools
node_memorytools -->|"reads and writes"| node_database
node_productivitytools -->|"reads and writes"| node_database
node_youtubesvc -->|"searches"| node_youtube
node_mediasvc -->|"uses"| node_youtubesvc

click node_app "https://github.com/malikmutaher/nexus-ai/blob/main/src/App.tsx"
click node_chatpage "https://github.com/malikmutaher/nexus-ai/blob/main/src/pages/ChatPage.tsx"
click node_featurepages "https://github.com/malikmutaher/nexus-ai/tree/main/src/pages"
click node_clientapi "https://github.com/malikmutaher/nexus-ai/blob/main/src/services/api.ts"
click node_fastapi "https://github.com/malikmutaher/nexus-ai/blob/main/backend/main.py"
click node_chatrouter "https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/chat.py"
click node_aiservice "https://github.com/malikmutaher/nexus-ai/blob/main/backend/services/ai_service.py"
click node_llm "https://github.com/malikmutaher/nexus-ai/blob/main/backend/ai/llm.py"
click node_toolrouter "https://github.com/malikmutaher/nexus-ai/blob/main/backend/tools/tool_manager.py"
click node_memorytools "https://github.com/malikmutaher/nexus-ai/blob/main/backend/tools/memory_manager.py"
click node_productivitytools "https://github.com/malikmutaher/nexus-ai/blob/main/backend/tools/productivity.py"
click node_memoryapi "https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/memory.py"
click node_tasksapi "https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/tasks.py"
click node_notesapi "https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/notes.py"
click node_filesapi "https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/files.py"
click node_database "https://github.com/malikmutaher/nexus-ai/blob/main/backend/database.py"
click node_visionsvc "https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/vision.py"
click node_mediasvc "https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/media.py"
click node_youtubesvc "https://github.com/malikmutaher/nexus-ai/blob/main/backend/services/youtube_service.py"
click node_infoservices "https://github.com/malikmutaher/nexus-ai/tree/main/backend/services"
click node_systemapi "https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/system.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_chatpage,node_featurepages,node_clientapi,node_user toneBlue
class node_fastapi,node_chatrouter,node_aiservice,node_llm,node_toolrouter toneAmber
class node_memorytools,node_productivitytools,node_memoryapi,node_tasksapi,node_notesapi,node_filesapi,node_database,node_youtube toneMint
class node_visionsvc,node_mediasvc,node_youtubesvc,node_infoservices,node_systemapi toneRose
```

## Components

### Assistant interface

- [App shell](https://github.com/malikmutaher/nexus-ai/blob/main/src/App.tsx): `src/App.tsx`
- [Chat workspace](https://github.com/malikmutaher/nexus-ai/blob/main/src/pages/ChatPage.tsx): `src/pages/ChatPage.tsx`
- [Feature pages](https://github.com/malikmutaher/nexus-ai/tree/main/src/pages): `src/pages`
- [API client](https://github.com/malikmutaher/nexus-ai/blob/main/src/services/api.ts): `src/services/api.ts`

### API and chat

- [FastAPI app](https://github.com/malikmutaher/nexus-ai/blob/main/backend/main.py): `backend/main.py`
- [Chat endpoint](https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/chat.py): `backend/routers/chat.py`
- [AI service](https://github.com/malikmutaher/nexus-ai/blob/main/backend/services/ai_service.py): `backend/services/ai_service.py`
- [LLM client](https://github.com/malikmutaher/nexus-ai/blob/main/backend/ai/llm.py): `backend/ai/llm.py`
- [Command routing](https://github.com/malikmutaher/nexus-ai/blob/main/backend/tools/tool_manager.py): `backend/tools/tool_manager.py`

### Personal workspace

- [Memory operations](https://github.com/malikmutaher/nexus-ai/blob/main/backend/tools/memory_manager.py): `backend/tools/memory_manager.py`
- [Tasks and notes](https://github.com/malikmutaher/nexus-ai/blob/main/backend/tools/productivity.py): `backend/tools/productivity.py`
- [Memory endpoint](https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/memory.py): `backend/routers/memory.py`
- [Tasks endpoint](https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/tasks.py): `backend/routers/tasks.py`
- [Notes endpoint](https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/notes.py): `backend/routers/notes.py`
- [Files endpoint](https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/files.py): `backend/routers/files.py`
- [SQLite database](https://github.com/malikmutaher/nexus-ai/blob/main/backend/database.py): `backend/database.py`

### Live capabilities

- [Vision endpoint](https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/vision.py): `backend/routers/vision.py`
- [Media endpoint](https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/media.py): `backend/routers/media.py`
- [YouTube search](https://github.com/malikmutaher/nexus-ai/blob/main/backend/services/youtube_service.py): `backend/services/youtube_service.py`
- [Live information](https://github.com/malikmutaher/nexus-ai/tree/main/backend/services): `backend/services`
- [System controls](https://github.com/malikmutaher/nexus-ai/blob/main/backend/routers/system.py): `backend/routers/system.py`

### Other components

- **User**
- **YouTube API**

## Connections

- User → App shell: uses
- App shell → Chat workspace: selects chat
- App shell → Feature pages: selects workspace
- Chat workspace → API client: requests
- Feature pages → API client: requests
- API client → FastAPI app: calls API
- FastAPI app → Chat endpoint: dispatches
- FastAPI app → Memory endpoint: dispatches
- FastAPI app → Tasks endpoint: dispatches
- FastAPI app → Notes endpoint: dispatches
- FastAPI app → Files endpoint: dispatches
- FastAPI app → Vision endpoint: dispatches
- FastAPI app → Media endpoint: dispatches
- FastAPI app → Live information: dispatches
- FastAPI app → System controls: dispatches
- Chat endpoint → AI service: delegates
- AI service → LLM client: uses
- AI service → Command routing: routes commands
- Command routing → Memory operations: dispatches
- Command routing → Tasks and notes: dispatches
- Memory endpoint → Memory operations: uses
- Tasks endpoint → Tasks and notes: uses
- Memory operations → SQLite database: reads and writes
- Tasks and notes → SQLite database: reads and writes
- YouTube search → YouTube API: searches
- Media endpoint → YouTube search: uses
