# ssshogunn/continuum architecture

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

- Interactive diagram: https://gitdiagram.com/ssshogunn/continuum
- Repository: https://github.com/ssshogunn/continuum

## Overview

Continuum provides persistent, workspace-scoped memory to AI clients through an MCP server, with a dashboard for account and memory management. The main workflow is client authentication and memory-tool use, followed by semantic recall; saves can also feed background knowledge-graph extraction. Optional Claude Code hooks inject context and capture session facts. The graph reflects README-documented capabilities and visible/indexed references; several memory modules and frontend pages were not sampled, so their internal call paths are not inferred.

Main entry points: [`core-mcp/app/server.py`](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/server.py) (MCP tools and routes), [`core-mcp/app/memory/memory.py`](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/memory.py) (Memory operations), [`backend/main.py`](https://github.com/ssshogunn/continuum/blob/main/backend/main.py) (Backend API), [`core-mcp/app/memory/search.py`](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/search.py) (Semantic search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Clients and hooks"]
  node_ai_client["AI client"]
  node_claude_hook["Claude Code hook"]
end

subgraph group_web["Dashboard"]
  node_web_app["Dashboard app<br/>[App.tsx]"]
  node_memory_ui["Memory views<br/>[Memory.tsx]"]
  node_graph_ui["Knowledge graph view<br/>[MemoryGraph.tsx]"]
  node_api_client["Web API client<br/>[api-client.ts]"]
end

subgraph group_identity["Identity and API"]
  node_backend_api["Backend API<br/>[main.py]"]
  node_oauth["OAuth and device auth<br/>[oauth.py]"]
  node_device_flow["Device authorization<br/>[device.py]"]
  node_backend_db[("Backend account store<br/>[db.py]")]
  node_core_client["Core service client<br/>[core_client.py]"]
end

subgraph group_memory["MCP memory service"]
  node_mcp["MCP tools and routes<br/>[server.py]"]
  node_auth["MCP token auth<br/>[auth.py]"]
  node_memory_ops["Memory operations<br/>[memory.py]"]
  node_search["Semantic search<br/>[search.py]"]
  node_prompt["Context assembly<br/>[prompt.py]"]
  node_embeddings["Embedding generation<br/>[embeddings.py]"]
  node_knowledge_graph["Knowledge graph<br/>[kg.py]"]
  node_capture["Session capture<br/>[capture.py]"]
  node_worker["Background worker<br/>[worker.py]"]
  node_core_db[("Core data store<br/>[db.py]")]
  node_redis[("Redis queue and cache<br/>[redis.py]")]
end

node_user(("User"))

node_user -->|"manages account"| node_web_app
node_user -->|"uses memory"| node_ai_client
node_ai_client -->|"calls MCP"| node_mcp
node_mcp -->|"verifies tokens"| node_auth
node_mcp -->|"invokes tools"| node_memory_ops
node_mcp -->|"routes search"| node_search
node_memory_ops -->|"supports recall"| node_search
node_search -->|"embeds queries"| node_embeddings
node_search -->|"reads memories"| node_core_db
node_mcp -->|"builds hook context"| node_prompt
node_prompt -->|"assembles memories"| node_memory_ops
node_memory_ops -->|"schedules extraction"| node_knowledge_graph
node_knowledge_graph -->|"embeds facts"| node_embeddings
node_knowledge_graph -->|"stores graph"| node_core_db
node_memory_ops -.->|"persists entries"| node_core_db
node_worker -->|"runs capture jobs"| node_capture
node_worker -->|"runs graph jobs"| node_knowledge_graph
node_worker -->|"uses job queue"| node_redis
node_claude_hook -->|"requests context"| node_mcp
node_claude_hook -->|"submits sessions"| node_capture
node_web_app -->|"routes memory"| node_memory_ui
node_web_app -->|"routes graph"| node_graph_ui
node_memory_ui -.->|"uses API"| node_api_client
node_graph_ui -.->|"uses API"| node_api_client
node_api_client -.->|"calls backend"| node_backend_api
node_backend_api -->|"registers routes"| node_oauth
node_backend_api -->|"registers routes"| node_device_flow
node_oauth -->|"stores OAuth state"| node_backend_db
node_device_flow -->|"stores device grants"| node_backend_db
node_backend_api -->|"starts client"| node_core_client
node_core_client -.->|"calls core service"| node_mcp

click node_claude_hook "https://github.com/ssshogunn/continuum/blob/main/hooks/continuum_context_inject.js"
click node_web_app "https://github.com/ssshogunn/continuum/blob/main/frontend/src/App.tsx"
click node_memory_ui "https://github.com/ssshogunn/continuum/blob/main/frontend/src/pages/dashboard/Memory.tsx"
click node_graph_ui "https://github.com/ssshogunn/continuum/blob/main/frontend/src/pages/dashboard/MemoryGraph.tsx"
click node_api_client "https://github.com/ssshogunn/continuum/blob/main/frontend/src/lib/api-client.ts"
click node_backend_api "https://github.com/ssshogunn/continuum/blob/main/backend/main.py"
click node_oauth "https://github.com/ssshogunn/continuum/blob/main/backend/app/routes/oauth.py"
click node_device_flow "https://github.com/ssshogunn/continuum/blob/main/backend/app/routes/device.py"
click node_backend_db "https://github.com/ssshogunn/continuum/blob/main/backend/app/db.py"
click node_core_client "https://github.com/ssshogunn/continuum/blob/main/backend/app/core_client.py"
click node_mcp "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/server.py"
click node_auth "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/auth.py"
click node_memory_ops "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/memory.py"
click node_search "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/search.py"
click node_prompt "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/prompt.py"
click node_embeddings "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/embeddings.py"
click node_knowledge_graph "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/kg.py"
click node_capture "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/capture.py"
click node_worker "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/worker.py"
click node_core_db "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/infra/db.py"
click node_redis "https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/infra/redis.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_ai_client,node_claude_hook,node_user toneBlue
class node_web_app,node_memory_ui,node_graph_ui,node_api_client toneAmber
class node_backend_api,node_oauth,node_device_flow,node_backend_db,node_core_client toneMint
class node_mcp,node_auth,node_memory_ops,node_search,node_prompt,node_embeddings,node_knowledge_graph,node_capture,node_worker,node_core_db,node_redis toneRose
```

## Components

### Clients and hooks

- **AI client**
- [Claude Code hook](https://github.com/ssshogunn/continuum/blob/main/hooks/continuum_context_inject.js): `hooks/continuum_context_inject.js`

### Dashboard

- [Dashboard app](https://github.com/ssshogunn/continuum/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Memory views](https://github.com/ssshogunn/continuum/blob/main/frontend/src/pages/dashboard/Memory.tsx): `frontend/src/pages/dashboard/Memory.tsx`
- [Knowledge graph view](https://github.com/ssshogunn/continuum/blob/main/frontend/src/pages/dashboard/MemoryGraph.tsx): `frontend/src/pages/dashboard/MemoryGraph.tsx`
- [Web API client](https://github.com/ssshogunn/continuum/blob/main/frontend/src/lib/api-client.ts): `frontend/src/lib/api-client.ts`

### Identity and API

- [Backend API](https://github.com/ssshogunn/continuum/blob/main/backend/main.py): `backend/main.py`
- [OAuth and device auth](https://github.com/ssshogunn/continuum/blob/main/backend/app/routes/oauth.py): `backend/app/routes/oauth.py`
- [Device authorization](https://github.com/ssshogunn/continuum/blob/main/backend/app/routes/device.py): `backend/app/routes/device.py`
- [Backend account store](https://github.com/ssshogunn/continuum/blob/main/backend/app/db.py): `backend/app/db.py`
- [Core service client](https://github.com/ssshogunn/continuum/blob/main/backend/app/core_client.py): `backend/app/core_client.py`

### MCP memory service

- [MCP tools and routes](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/server.py): `core-mcp/app/server.py`
- [MCP token auth](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/auth.py): `core-mcp/app/auth.py`
- [Memory operations](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/memory.py): `core-mcp/app/memory/memory.py`
- [Semantic search](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/search.py): `core-mcp/app/memory/search.py`
- [Context assembly](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/prompt.py): `core-mcp/app/memory/prompt.py`
- [Embedding generation](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/embeddings.py): `core-mcp/app/memory/embeddings.py`
- [Knowledge graph](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/kg.py): `core-mcp/app/memory/kg.py`
- [Session capture](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/memory/capture.py): `core-mcp/app/memory/capture.py`
- [Background worker](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/worker.py): `core-mcp/app/worker.py`
- [Core data store](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/infra/db.py): `core-mcp/app/infra/db.py`
- [Redis queue and cache](https://github.com/ssshogunn/continuum/blob/main/core-mcp/app/infra/redis.py): `core-mcp/app/infra/redis.py`

### Other components

- **User**

## Connections

- User → Dashboard app: manages account
- User → AI client: uses memory
- AI client → MCP tools and routes: calls MCP
- MCP tools and routes → MCP token auth: verifies tokens (evidence: `core-mcp/app/server.py`)
- MCP tools and routes → Memory operations: invokes tools (evidence: `core-mcp/app/server.py`)
- MCP tools and routes → Semantic search: routes search (evidence: `core-mcp/app/server.py`)
- Memory operations → Semantic search: supports recall
- Semantic search → Embedding generation: embeds queries (evidence: `core-mcp/app/memory/search.py`)
- Semantic search → Core data store: reads memories (evidence: `core-mcp/app/memory/search.py`)
- MCP tools and routes → Context assembly: builds hook context (evidence: `core-mcp/app/server.py`)
- Context assembly → Memory operations: assembles memories (evidence: `core-mcp/app/server.py`)
- Memory operations → Knowledge graph: schedules extraction
- Knowledge graph → Embedding generation: embeds facts (evidence: `core-mcp/app/memory/kg.py`)
- Knowledge graph → Core data store: stores graph (evidence: `core-mcp/app/memory/kg.py`)
- Memory operations → Core data store: persists entries
- Background worker → Session capture: runs capture jobs (evidence: `core-mcp/app/worker.py`)
- Background worker → Knowledge graph: runs graph jobs (evidence: `core-mcp/app/worker.py`)
- Background worker → Redis queue and cache: uses job queue (evidence: `core-mcp/app/worker.py`)
- Claude Code hook → MCP tools and routes: requests context
- Claude Code hook → Session capture: submits sessions
- Dashboard app → Memory views: routes memory (evidence: `frontend/src/App.tsx`)
- Dashboard app → Knowledge graph view: routes graph (evidence: `frontend/src/App.tsx`)
- Memory views → Web API client: uses API
- Knowledge graph view → Web API client: uses API
- Web API client → Backend API: calls backend
- Backend API → OAuth and device auth: registers routes (evidence: `backend/main.py`)
- Backend API → Device authorization: registers routes (evidence: `backend/main.py`)
- OAuth and device auth → Backend account store: stores OAuth state (evidence: `backend/app/routes/oauth.py`)
- Device authorization → Backend account store: stores device grants (evidence: `backend/app/routes/device.py`)
- Backend API → Core service client: starts client (evidence: `backend/main.py`)
- Core service client → MCP tools and routes: calls core service
