# szotasz/marveen architecture

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

- Interactive diagram: https://gitdiagram.com/szotasz/marveen
- Repository: https://github.com/szotasz/marveen

## Overview

Marveen is a self-hostable Claude Code agent harness: an owner steers a team through a dashboard or chat, agents execute and delegate work, and the system supports persistent memory, scheduled work, and operational monitoring. The graph combines the documented product capabilities with the source index and sampled call sites. Several feature implementations were not excerpted, so their internal wiring is intentionally left unspecified; dashed edges mark documented capabilities whose exact runtime dispatch is not shown.

Main entry points: [`src/web/agent-process.ts`](https://github.com/szotasz/marveen/blob/develop/src/web/agent-process.ts) (Agent runtime), [`src/web/message-router.ts`](https://github.com/szotasz/marveen/blob/develop/src/web/message-router.ts) (Message router), [`src/web.ts`](https://github.com/szotasz/marveen/blob/develop/src/web.ts) (Web server), [`src/web/agent-config.ts`](https://github.com/szotasz/marveen/blob/develop/src/web/agent-config.ts) (Agent config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Dashboard and control"]
  node_dashboard["Mission Control<br/>[app.js]"]
  node_webserver["Web server<br/>[web.ts]"]
  node_http["HTTP helpers<br/>[http-helpers.ts]"]
  node_agent_routes["Agent routes<br/>[agents.ts]"]
  node_agent_config["Agent config<br/>[agent-config.ts]"]
  node_settings[("Settings store<br/>[settings-store.ts]")]
  node_config["Runtime config<br/>[config.ts]"]
end

subgraph group_agents["Agent execution"]
  node_agent_runtime["Agent runtime<br/>[agent-process.ts]"]
  node_worker["Background workers<br/>[agent-worker.ts]"]
  node_claude["Claude Code"]
end

subgraph group_channels["Messaging and federation"]
  node_channels["Channel providers"]
  node_router["Message router<br/>[message-router.ts]"]
  node_federation["Agent federation"]
  node_chat_services["Chat services"]
end

subgraph group_work["Work orchestration"]
  node_schedules["Scheduled tasks"]
  node_kanban["Kanban<br/>[kanban.ts]"]
  node_heartbeat["Heartbeat<br/>[heartbeat.ts]"]
  node_skills["Skills"]
end

subgraph group_state["Memory and state"]
  node_memory["Memory search<br/>[memory.ts]"]
  node_database[("SQLite database<br/>[db.ts]")]
  node_logging["Logging<br/>[logger.ts]"]
  node_costops["Cost controls<br/>[config.ts]"]
  node_pane[("Session state<br/>[pane-state.ts]")]
end

node_owner(("Owner"))

node_owner -->|"steers agents"| node_dashboard
node_owner -->|"messages through"| node_chat_services
node_dashboard -.->|"uses"| node_webserver
node_webserver -.->|"handles requests with"| node_http
node_webserver -.->|"routes to"| node_agent_routes
node_agent_routes -.->|"configures"| node_agent_config
node_agent_config -->|"reads settings from"| node_config
node_agent_runtime -->|"reads config"| node_agent_config
node_agent_runtime -->|"runs"| node_claude
node_worker -->|"uses"| node_agent_runtime
node_worker -->|"runs"| node_claude
node_router -->|"sends prompts"| node_agent_runtime
node_router -->|"marks delivered"| node_database
node_router -->|"sends federated messages"| node_federation
node_channels -->|"connects channels"| node_chat_services
node_agent_runtime -.->|"communicates through"| node_channels
node_agent_runtime -.->|"delegates across agents"| node_federation
node_schedules -.->|"runs scheduled work"| node_agent_runtime
node_heartbeat -.->|"alerts on events"| node_chat_services
node_kanban -.->|"dispatches tasks"| node_agent_runtime
node_agent_runtime -.->|"learns reusable skills"| node_skills
node_agent_runtime -.->|"uses persistent memory"| node_memory
node_memory -.->|"stores and searches"| node_database
node_settings -->|"overrides boot settings"| node_config
node_agent_runtime -->|"tracks sessions"| node_pane
node_agent_runtime -.->|"applies budget controls"| node_costops

click node_dashboard "https://github.com/szotasz/marveen/blob/develop/web/app.js"
click node_webserver "https://github.com/szotasz/marveen/blob/develop/src/web.ts"
click node_http "https://github.com/szotasz/marveen/blob/develop/src/web/http-helpers.ts"
click node_agent_routes "https://github.com/szotasz/marveen/blob/develop/src/web/routes/agents.ts"
click node_agent_config "https://github.com/szotasz/marveen/blob/develop/src/web/agent-config.ts"
click node_settings "https://github.com/szotasz/marveen/blob/develop/src/settings-store.ts"
click node_config "https://github.com/szotasz/marveen/blob/develop/src/config.ts"
click node_agent_runtime "https://github.com/szotasz/marveen/blob/develop/src/web/agent-process.ts"
click node_worker "https://github.com/szotasz/marveen/blob/develop/src/web/agent-worker.ts"
click node_channels "https://github.com/szotasz/marveen/blob/develop/src/channel-provider.ts"
click node_router "https://github.com/szotasz/marveen/blob/develop/src/web/message-router.ts"
click node_federation "https://github.com/szotasz/marveen/tree/develop/src/web/federation"
click node_schedules "https://github.com/szotasz/marveen/blob/develop/src/web/scheduled-tasks-io.ts"
click node_kanban "https://github.com/szotasz/marveen/blob/develop/src/web/routes/kanban.ts"
click node_heartbeat "https://github.com/szotasz/marveen/blob/develop/src/heartbeat.ts"
click node_skills "https://github.com/szotasz/marveen/blob/develop/src/web/skills-dir-queue.ts"
click node_memory "https://github.com/szotasz/marveen/blob/develop/src/memory.ts"
click node_database "https://github.com/szotasz/marveen/blob/develop/src/db.ts"
click node_logging "https://github.com/szotasz/marveen/blob/develop/src/logger.ts"
click node_costops "https://github.com/szotasz/marveen/blob/develop/src/costops/config.ts"
click node_pane "https://github.com/szotasz/marveen/blob/develop/src/pane-state.ts"

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_dashboard,node_webserver,node_http,node_agent_routes,node_agent_config,node_settings,node_config toneBlue
class node_agent_runtime,node_worker,node_claude toneAmber
class node_channels,node_router,node_federation,node_chat_services toneMint
class node_schedules,node_kanban,node_heartbeat,node_skills toneRose
class node_memory,node_database,node_logging,node_costops,node_pane,node_owner toneIndigo
```

## Components

### Dashboard and control

- [Mission Control](https://github.com/szotasz/marveen/blob/develop/web/app.js): `web/app.js`
- [Web server](https://github.com/szotasz/marveen/blob/develop/src/web.ts): `src/web.ts`
- [HTTP helpers](https://github.com/szotasz/marveen/blob/develop/src/web/http-helpers.ts): `src/web/http-helpers.ts`
- [Agent routes](https://github.com/szotasz/marveen/blob/develop/src/web/routes/agents.ts): `src/web/routes/agents.ts`
- [Agent config](https://github.com/szotasz/marveen/blob/develop/src/web/agent-config.ts): `src/web/agent-config.ts`
- [Settings store](https://github.com/szotasz/marveen/blob/develop/src/settings-store.ts): `src/settings-store.ts`
- [Runtime config](https://github.com/szotasz/marveen/blob/develop/src/config.ts): `src/config.ts`

### Agent execution

- [Agent runtime](https://github.com/szotasz/marveen/blob/develop/src/web/agent-process.ts): `src/web/agent-process.ts`
- [Background workers](https://github.com/szotasz/marveen/blob/develop/src/web/agent-worker.ts): `src/web/agent-worker.ts`
- **Claude Code**

### Messaging and federation

- [Channel providers](https://github.com/szotasz/marveen/blob/develop/src/channel-provider.ts): `src/channel-provider.ts`
- [Message router](https://github.com/szotasz/marveen/blob/develop/src/web/message-router.ts): `src/web/message-router.ts`
- [Agent federation](https://github.com/szotasz/marveen/tree/develop/src/web/federation): `src/web/federation`
- **Chat services**

### Work orchestration

- [Scheduled tasks](https://github.com/szotasz/marveen/blob/develop/src/web/scheduled-tasks-io.ts): `src/web/scheduled-tasks-io.ts`
- [Kanban](https://github.com/szotasz/marveen/blob/develop/src/web/routes/kanban.ts): `src/web/routes/kanban.ts`
- [Heartbeat](https://github.com/szotasz/marveen/blob/develop/src/heartbeat.ts): `src/heartbeat.ts`
- [Skills](https://github.com/szotasz/marveen/blob/develop/src/web/skills-dir-queue.ts): `src/web/skills-dir-queue.ts`

### Memory and state

- [Memory search](https://github.com/szotasz/marveen/blob/develop/src/memory.ts): `src/memory.ts`
- [SQLite database](https://github.com/szotasz/marveen/blob/develop/src/db.ts): `src/db.ts`
- [Logging](https://github.com/szotasz/marveen/blob/develop/src/logger.ts): `src/logger.ts`
- [Cost controls](https://github.com/szotasz/marveen/blob/develop/src/costops/config.ts): `src/costops/config.ts`
- [Session state](https://github.com/szotasz/marveen/blob/develop/src/pane-state.ts): `src/pane-state.ts`

### Other components

- **Owner**

## Connections

- Owner → Mission Control: steers agents
- Owner → Chat services: messages through
- Mission Control → Web server: uses
- Web server → HTTP helpers: handles requests with
- Web server → Agent routes: routes to
- Agent routes → Agent config: configures
- Agent config → Runtime config: reads settings from (evidence: `src/web/agent-config.ts`)
- Agent runtime → Agent config: reads config (evidence: `src/web/agent-process.ts`)
- Agent runtime → Claude Code: runs
- Background workers → Agent runtime: uses (evidence: `src/web/agent-worker.ts`)
- Background workers → Claude Code: runs
- Message router → Agent runtime: sends prompts (evidence: `src/web/message-router.ts`)
- Message router → SQLite database: marks delivered (evidence: `src/web/message-router.ts`)
- Message router → Agent federation: sends federated messages (evidence: `src/web/message-router.ts`)
- Channel providers → Chat services: connects channels
- Agent runtime → Channel providers: communicates through (evidence: `src/web/agent-process.ts`)
- Agent runtime → Agent federation: delegates across agents
- Scheduled tasks → Agent runtime: runs scheduled work
- Heartbeat → Chat services: alerts on events
- Kanban → Agent runtime: dispatches tasks
- Agent runtime → Skills: learns reusable skills
- Agent runtime → Memory search: uses persistent memory
- Memory search → SQLite database: stores and searches
- Settings store → Runtime config: overrides boot settings (evidence: `src/config.ts`)
- Agent runtime → Session state: tracks sessions (evidence: `src/web/agent-process.ts`)
- Agent runtime → Cost controls: applies budget controls
