# odysseus-dev/odysseus architecture

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

- Interactive diagram: https://gitdiagram.com/odysseus-dev/odysseus
- Repository: https://github.com/odysseus-dev/odysseus
- Video tour (about a minute): https://gitdiagram.com/odysseus-dev/odysseus/video

## Overview

Odysseus is a self-hosted AI workspace. The primary user journey is to interact through the workspace UI, send a chat or agent request, and receive model-generated results with tools, files, or memory available. Separate product stages include research, document work, email, notes/tasks/calendar, model comparison, and image work. The README documents these capabilities; the excerpts and source index support the shared model, session, storage, and request infrastructure. Several feature route implementations were not sampled, so their internal call paths are not inferred.

Main entry points: [`core/database.py`](https://github.com/odysseus-dev/odysseus/blob/dev/core/database.py) (Application database), [`routes/chat_routes.py`](https://github.com/odysseus-dev/odysseus/blob/dev/routes/chat_routes.py) (Chat and agents), [`core/session_manager.py`](https://github.com/odysseus-dev/odysseus/blob/dev/core/session_manager.py) (Session management), [`static/app.js`](https://github.com/odysseus-dev/odysseus/blob/dev/static/app.js) (Workspace UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Workspace interface"]
  node_frontend["Workspace UI<br/>[app.js]"]
  node_notes_ui["Notes interface"]
end

subgraph group_ai["AI runtime"]
  node_model["Model endpoints<br/>[llm_core.py]"]
  node_endpoint["Endpoint resolution"]
end

subgraph group_features["Workspace capabilities"]
  node_chat["Chat and agents<br/>[chat_routes.py]"]
  node_research["Deep research"]
  node_documents["Documents<br/>[document_routes.py]"]
  node_email["Email<br/>[email_routes.py]"]
  node_notes["Notes and reminders<br/>[note_routes.py]"]
  node_tasks["Scheduled tasks<br/>[task_routes.py]"]
  node_calendar["Calendar<br/>[calendar_routes.py]"]
  node_compare["Model comparison<br/>[compare_routes.py]"]
  node_cookbook["Model cookbook<br/>[cookbook_routes.py]"]
  node_gallery["Gallery and image tools<br/>[gallery_routes.py]"]
end

subgraph group_services["Shared services"]
  node_search["Web search"]
  node_memory["Memory and skills"]
  node_mcp["MCP integrations<br/>[mcp_manager.py]"]
  node_uploads["Upload handling<br/>[upload_handler.py]"]
  node_settings["Settings<br/>[settings.py]"]
  node_events["Automation events<br/>[event_bus.py]"]
end

subgraph group_persistence["State and security"]
  node_sessions["Session management<br/>[session_manager.py]"]
  node_database[("Application database<br/>[database.py]")]
  node_models["Data models<br/>[models.py]"]
  node_auth["Request authentication<br/>[auth_helpers.py]"]
  node_middleware["Request middleware<br/>[middleware.py]"]
end

node_user(("Workspace user"))

node_user -->|"uses"| node_frontend
node_frontend -.->|"submits requests"| node_chat
node_frontend -.->|"opens notes"| node_notes_ui
node_notes_ui -.->|"uses API"| node_notes
node_chat -.->|"requests generation"| node_model
node_model -->|"resolves endpoint"| node_endpoint
node_endpoint -->|"reads endpoints"| node_database
node_chat -.->|"manages conversations"| node_sessions
node_sessions -->|"reads and writes"| node_database
node_sessions -->|"uses records"| node_models
node_research -->|"uses search"| node_search
node_documents -->|"handles uploads"| node_uploads
node_documents -->|"uses document state"| node_database
node_email -->|"uses email state"| node_database
node_notes -->|"uses note state"| node_database
node_tasks -->|"uses task state"| node_database
node_compare -->|"uses sessions"| node_sessions
node_compare -->|"uses stored state"| node_database
node_memory -.->|"supports agents"| node_chat
node_mcp -.->|"extends agent tools"| node_chat
node_cookbook -.->|"supports model workflows"| node_model
node_gallery -.->|"provides image tools"| node_user
node_middleware -->|"supports request identity"| node_auth
node_events -->|"triggers scheduled tasks"| node_tasks
node_settings -.->|"configures application"| node_database

click node_frontend "https://github.com/odysseus-dev/odysseus/blob/dev/static/app.js"
click node_notes_ui "https://github.com/odysseus-dev/odysseus/tree/dev/frontend/src/features/notes"
click node_chat "https://github.com/odysseus-dev/odysseus/blob/dev/routes/chat_routes.py"
click node_research "https://github.com/odysseus-dev/odysseus/blob/dev/services/research/research_handler.py"
click node_documents "https://github.com/odysseus-dev/odysseus/blob/dev/routes/document/document_routes.py"
click node_email "https://github.com/odysseus-dev/odysseus/blob/dev/routes/email/email_routes.py"
click node_notes "https://github.com/odysseus-dev/odysseus/blob/dev/routes/note/note_routes.py"
click node_tasks "https://github.com/odysseus-dev/odysseus/blob/dev/routes/task/task_routes.py"
click node_calendar "https://github.com/odysseus-dev/odysseus/blob/dev/routes/calendar_routes.py"
click node_compare "https://github.com/odysseus-dev/odysseus/blob/dev/routes/compare/compare_routes.py"
click node_cookbook "https://github.com/odysseus-dev/odysseus/blob/dev/routes/cookbook_routes.py"
click node_gallery "https://github.com/odysseus-dev/odysseus/blob/dev/routes/gallery/gallery_routes.py"
click node_search "https://github.com/odysseus-dev/odysseus/tree/dev/services/search"
click node_memory "https://github.com/odysseus-dev/odysseus/tree/dev/services/memory"
click node_mcp "https://github.com/odysseus-dev/odysseus/blob/dev/src/mcp_manager.py"
click node_model "https://github.com/odysseus-dev/odysseus/blob/dev/src/llm_core.py"
click node_endpoint "https://github.com/odysseus-dev/odysseus/blob/dev/src/endpoint_resolver.py"
click node_sessions "https://github.com/odysseus-dev/odysseus/blob/dev/core/session_manager.py"
click node_database "https://github.com/odysseus-dev/odysseus/blob/dev/core/database.py"
click node_models "https://github.com/odysseus-dev/odysseus/blob/dev/core/models.py"
click node_auth "https://github.com/odysseus-dev/odysseus/blob/dev/src/auth_helpers.py"
click node_middleware "https://github.com/odysseus-dev/odysseus/blob/dev/core/middleware.py"
click node_uploads "https://github.com/odysseus-dev/odysseus/blob/dev/src/upload_handler.py"
click node_settings "https://github.com/odysseus-dev/odysseus/blob/dev/src/settings.py"
click node_events "https://github.com/odysseus-dev/odysseus/blob/dev/src/event_bus.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_frontend,node_notes_ui,node_user toneBlue
class node_model,node_endpoint toneAmber
class node_chat,node_research,node_documents,node_email,node_notes,node_tasks,node_calendar,node_compare,node_cookbook,node_gallery toneMint
class node_search,node_memory,node_mcp,node_uploads,node_settings,node_events toneRose
class node_sessions,node_database,node_models,node_auth,node_middleware toneIndigo
```

## Components

### Workspace interface

- [Workspace UI](https://github.com/odysseus-dev/odysseus/blob/dev/static/app.js): `static/app.js`
- [Notes interface](https://github.com/odysseus-dev/odysseus/tree/dev/frontend/src/features/notes): `frontend/src/features/notes`

### AI runtime

- [Model endpoints](https://github.com/odysseus-dev/odysseus/blob/dev/src/llm_core.py): `src/llm_core.py`
- [Endpoint resolution](https://github.com/odysseus-dev/odysseus/blob/dev/src/endpoint_resolver.py): `src/endpoint_resolver.py`

### Workspace capabilities

- [Chat and agents](https://github.com/odysseus-dev/odysseus/blob/dev/routes/chat_routes.py): `routes/chat_routes.py`
- [Deep research](https://github.com/odysseus-dev/odysseus/blob/dev/services/research/research_handler.py): `services/research/research_handler.py`
- [Documents](https://github.com/odysseus-dev/odysseus/blob/dev/routes/document/document_routes.py): `routes/document/document_routes.py`
- [Email](https://github.com/odysseus-dev/odysseus/blob/dev/routes/email/email_routes.py): `routes/email/email_routes.py`
- [Notes and reminders](https://github.com/odysseus-dev/odysseus/blob/dev/routes/note/note_routes.py): `routes/note/note_routes.py`
- [Scheduled tasks](https://github.com/odysseus-dev/odysseus/blob/dev/routes/task/task_routes.py): `routes/task/task_routes.py`
- [Calendar](https://github.com/odysseus-dev/odysseus/blob/dev/routes/calendar_routes.py): `routes/calendar_routes.py`
- [Model comparison](https://github.com/odysseus-dev/odysseus/blob/dev/routes/compare/compare_routes.py): `routes/compare/compare_routes.py`
- [Model cookbook](https://github.com/odysseus-dev/odysseus/blob/dev/routes/cookbook_routes.py): `routes/cookbook_routes.py`
- [Gallery and image tools](https://github.com/odysseus-dev/odysseus/blob/dev/routes/gallery/gallery_routes.py): `routes/gallery/gallery_routes.py`

### Shared services

- [Web search](https://github.com/odysseus-dev/odysseus/tree/dev/services/search): `services/search`
- [Memory and skills](https://github.com/odysseus-dev/odysseus/tree/dev/services/memory): `services/memory`
- [MCP integrations](https://github.com/odysseus-dev/odysseus/blob/dev/src/mcp_manager.py): `src/mcp_manager.py`
- [Upload handling](https://github.com/odysseus-dev/odysseus/blob/dev/src/upload_handler.py): `src/upload_handler.py`
- [Settings](https://github.com/odysseus-dev/odysseus/blob/dev/src/settings.py): `src/settings.py`
- [Automation events](https://github.com/odysseus-dev/odysseus/blob/dev/src/event_bus.py): `src/event_bus.py`

### State and security

- [Session management](https://github.com/odysseus-dev/odysseus/blob/dev/core/session_manager.py): `core/session_manager.py`
- [Application database](https://github.com/odysseus-dev/odysseus/blob/dev/core/database.py): `core/database.py`
- [Data models](https://github.com/odysseus-dev/odysseus/blob/dev/core/models.py): `core/models.py`
- [Request authentication](https://github.com/odysseus-dev/odysseus/blob/dev/src/auth_helpers.py): `src/auth_helpers.py`
- [Request middleware](https://github.com/odysseus-dev/odysseus/blob/dev/core/middleware.py): `core/middleware.py`

### Other components

- **Workspace user**

## Connections

- Workspace user → Workspace UI: uses (evidence: `README.md`)
- Workspace UI → Chat and agents: submits requests
- Workspace UI → Notes interface: opens notes
- Notes interface → Notes and reminders: uses API
- Chat and agents → Model endpoints: requests generation
- Model endpoints → Endpoint resolution: resolves endpoint (evidence: `src/llm_core.py`)
- Endpoint resolution → Application database: reads endpoints (evidence: `src/endpoint_resolver.py`)
- Chat and agents → Session management: manages conversations
- Session management → Application database: reads and writes (evidence: `core/session_manager.py`)
- Session management → Data models: uses records (evidence: `core/session_manager.py`)
- Deep research → Web search: uses search (evidence: `services/research/research_handler.py`)
- Documents → Upload handling: handles uploads (evidence: `routes/document/document_routes.py`)
- Documents → Application database: uses document state (evidence: `routes/document/document_routes.py`)
- Email → Application database: uses email state (evidence: `routes/email/email_routes.py`)
- Notes and reminders → Application database: uses note state (evidence: `routes/note/note_routes.py`)
- Scheduled tasks → Application database: uses task state (evidence: `routes/task/task_routes.py`)
- Model comparison → Session management: uses sessions (evidence: `routes/compare/compare_routes.py`)
- Model comparison → Application database: uses stored state (evidence: `routes/compare/compare_routes.py`)
- Memory and skills → Chat and agents: supports agents (evidence: `README.md`)
- MCP integrations → Chat and agents: extends agent tools (evidence: `README.md`)
- Model cookbook → Model endpoints: supports model workflows (evidence: `README.md`)
- Gallery and image tools → Workspace user: provides image tools (evidence: `README.md`)
- Request middleware → Request authentication: supports request identity (evidence: `core/middleware.py`)
- Automation events → Scheduled tasks: triggers scheduled tasks (evidence: `src/event_bus.py`)
- Settings → Application database: configures application
