# rt-codes/themisforge architecture

> Architecture diagram of the GitHub repository rt-codes/themisforge, 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/rt-codes/themisforge
- Repository: https://github.com/rt-codes/themisforge

## Overview

Themis is a self-hosted app for assigning work to AI agents, organizing it in projects, and reviewing runs and results. The main workflow is to configure an agent and its capabilities, create a task, run it immediately or on a schedule, then inspect its logs and outputs. Workflows add graph-based, multi-step execution; shared folders, access controls, and resource limits govern agent work. The graph combines documented product capabilities with relationships visible in the provided excerpts and SOURCE INDEX; some unsampled subsystem internals and links are therefore omitted.

Main entry points: [`backend/app/scheduler.py`](https://github.com/rt-codes/themisforge/blob/main/backend/app/scheduler.py) (Task scheduler), [`backend/app/routers/projects.py`](https://github.com/rt-codes/themisforge/blob/main/backend/app/routers/projects.py) (Project and task API), [`backend/app/project_config.py`](https://github.com/rt-codes/themisforge/blob/main/backend/app/project_config.py) (Project configuration), [`backend/app/cells.py`](https://github.com/rt-codes/themisforge/blob/main/backend/app/cells.py) (Isolated agent cells)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_webapp["Themis web app<br/>[App.svelte]"]
  node_taskui["Task controls<br/>[TaskSheet.svelte]"]
end

subgraph group_projects["Projects and planning"]
  node_project_routes["Project and task API<br/>[projects.py]"]
  node_projects["Projects and boards<br/>[boards.py]"]
end

subgraph group_execution["Agent execution"]
  node_schedule["Scheduling<br/>[scheduling.py]"]
  node_scheduler["Task scheduler<br/>[scheduler.py]"]
  node_cells["Isolated agent cells<br/>[cells.py]"]
  node_harness["Agent harness<br/>[harness.py]"]
  node_workflows["Workflow engine<br/>[workflows.py]"]
  node_run_history["Run logs and results<br/>[runlog.py]"]
end

subgraph group_capabilities["Agent capabilities"]
  node_project_config["Project configuration<br/>[project_config.py]"]
  node_skills["Skills<br/>[skills.py]"]
  node_connections["Service connections<br/>[connections.py]"]
  node_mcp_auth["MCP sign-in<br/>[scheme.py]"]
  node_volumes["Shared folders<br/>[volumes.py]"]
end

subgraph group_platform["Platform and state"]
  node_api["HTTP API<br/>[main.py]"]
  node_database[("Application database<br/>[models.py]")]
  node_settings["Runtime settings<br/>[app_settings.py]"]
end

node_user(("Project owner"))

node_user -->|"uses"| node_webapp
node_webapp -.->|"opens tasks"| node_taskui
node_taskui -->|"requests task run"| node_api
node_api -->|"routes requests"| node_project_routes
node_project_routes -->|"uses boards"| node_projects
node_project_routes -->|"reads and writes"| node_database
node_project_routes -->|"uses scheduling"| node_schedule
node_schedule -.->|"makes work due"| node_scheduler
node_scheduler -->|"starts cells"| node_cells
node_scheduler -->|"plans capabilities"| node_project_config
node_scheduler -->|"prepares runs"| node_harness
node_harness -->|"runs in"| node_cells
node_scheduler -.->|"records output"| node_run_history
node_user -->|"designs workflows"| node_workflows
node_workflows -->|"runs agent steps"| node_cells
node_project_config -->|"loads skills"| node_skills
node_project_config -->|"plans connections"| node_connections
node_project_config -->|"loads folder access"| node_volumes
node_connections -->|"stores credentials"| node_database
node_mcp_auth -->|"uses connection policy"| node_connections
node_settings -->|"loads and saves"| node_database
node_cells -.->|"mounts approved folders"| node_volumes
node_user -->|"reviews results"| node_run_history

click node_webapp "https://github.com/rt-codes/themisforge/blob/main/frontend/src/App.svelte"
click node_taskui "https://github.com/rt-codes/themisforge/blob/main/frontend/src/lib/components/project/TaskSheet.svelte"
click node_api "https://github.com/rt-codes/themisforge/blob/main/backend/app/main.py"
click node_project_routes "https://github.com/rt-codes/themisforge/blob/main/backend/app/routers/projects.py"
click node_projects "https://github.com/rt-codes/themisforge/blob/main/backend/app/boards.py"
click node_schedule "https://github.com/rt-codes/themisforge/blob/main/backend/app/scheduling.py"
click node_scheduler "https://github.com/rt-codes/themisforge/blob/main/backend/app/scheduler.py"
click node_cells "https://github.com/rt-codes/themisforge/blob/main/backend/app/cells.py"
click node_harness "https://github.com/rt-codes/themisforge/blob/main/backend/app/harness.py"
click node_workflows "https://github.com/rt-codes/themisforge/blob/main/backend/app/workflows.py"
click node_run_history "https://github.com/rt-codes/themisforge/blob/main/backend/app/runlog.py"
click node_project_config "https://github.com/rt-codes/themisforge/blob/main/backend/app/project_config.py"
click node_skills "https://github.com/rt-codes/themisforge/blob/main/backend/app/skills.py"
click node_connections "https://github.com/rt-codes/themisforge/blob/main/backend/app/connections.py"
click node_mcp_auth "https://github.com/rt-codes/themisforge/blob/main/backend/app/mcp_auth/scheme.py"
click node_volumes "https://github.com/rt-codes/themisforge/blob/main/backend/app/volumes.py"
click node_database "https://github.com/rt-codes/themisforge/blob/main/backend/app/models.py"
click node_settings "https://github.com/rt-codes/themisforge/blob/main/backend/app/app_settings.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_webapp,node_taskui toneBlue
class node_project_routes,node_projects toneAmber
class node_schedule,node_scheduler,node_cells,node_harness,node_workflows,node_run_history toneMint
class node_project_config,node_skills,node_connections,node_mcp_auth,node_volumes toneRose
class node_api,node_database,node_settings,node_user toneIndigo
```

## Components

### User experience

- [Themis web app](https://github.com/rt-codes/themisforge/blob/main/frontend/src/App.svelte): `frontend/src/App.svelte`
- [Task controls](https://github.com/rt-codes/themisforge/blob/main/frontend/src/lib/components/project/TaskSheet.svelte): `frontend/src/lib/components/project/TaskSheet.svelte`

### Projects and planning

- [Project and task API](https://github.com/rt-codes/themisforge/blob/main/backend/app/routers/projects.py): `backend/app/routers/projects.py`
- [Projects and boards](https://github.com/rt-codes/themisforge/blob/main/backend/app/boards.py): `backend/app/boards.py`

### Agent execution

- [Scheduling](https://github.com/rt-codes/themisforge/blob/main/backend/app/scheduling.py): `backend/app/scheduling.py`
- [Task scheduler](https://github.com/rt-codes/themisforge/blob/main/backend/app/scheduler.py): `backend/app/scheduler.py`
- [Isolated agent cells](https://github.com/rt-codes/themisforge/blob/main/backend/app/cells.py): `backend/app/cells.py`
- [Agent harness](https://github.com/rt-codes/themisforge/blob/main/backend/app/harness.py): `backend/app/harness.py`
- [Workflow engine](https://github.com/rt-codes/themisforge/blob/main/backend/app/workflows.py): `backend/app/workflows.py`
- [Run logs and results](https://github.com/rt-codes/themisforge/blob/main/backend/app/runlog.py): `backend/app/runlog.py`

### Agent capabilities

- [Project configuration](https://github.com/rt-codes/themisforge/blob/main/backend/app/project_config.py): `backend/app/project_config.py`
- [Skills](https://github.com/rt-codes/themisforge/blob/main/backend/app/skills.py): `backend/app/skills.py`
- [Service connections](https://github.com/rt-codes/themisforge/blob/main/backend/app/connections.py): `backend/app/connections.py`
- [MCP sign-in](https://github.com/rt-codes/themisforge/blob/main/backend/app/mcp_auth/scheme.py): `backend/app/mcp_auth/scheme.py`
- [Shared folders](https://github.com/rt-codes/themisforge/blob/main/backend/app/volumes.py): `backend/app/volumes.py`

### Platform and state

- [HTTP API](https://github.com/rt-codes/themisforge/blob/main/backend/app/main.py): `backend/app/main.py`
- [Application database](https://github.com/rt-codes/themisforge/blob/main/backend/app/models.py): `backend/app/models.py`
- [Runtime settings](https://github.com/rt-codes/themisforge/blob/main/backend/app/app_settings.py): `backend/app/app_settings.py`

### Other components

- **Project owner**

## Connections

- Project owner → Themis web app: uses (evidence: `README.md`)
- Themis web app → Task controls: opens tasks
- Task controls → HTTP API: requests task run (evidence: `frontend/src/lib/components/project/TaskSheet.svelte`)
- HTTP API → Project and task API: routes requests (evidence: `backend/app/main.py`)
- Project and task API → Projects and boards: uses boards (evidence: `backend/app/routers/projects.py`)
- Project and task API → Application database: reads and writes (evidence: `backend/app/routers/projects.py`)
- Project and task API → Scheduling: uses scheduling (evidence: `backend/app/routers/projects.py`)
- Scheduling → Task scheduler: makes work due (evidence: `backend/app/scheduler.py`)
- Task scheduler → Isolated agent cells: starts cells (evidence: `backend/app/scheduler.py`)
- Task scheduler → Project configuration: plans capabilities (evidence: `backend/app/scheduler.py`)
- Task scheduler → Agent harness: prepares runs (evidence: `backend/app/scheduler.py`)
- Agent harness → Isolated agent cells: runs in (evidence: `backend/app/harness.py`)
- Task scheduler → Run logs and results: records output
- Project owner → Workflow engine: designs workflows (evidence: `README.md`)
- Workflow engine → Isolated agent cells: runs agent steps (evidence: `backend/app/workflows.py`)
- Project configuration → Skills: loads skills (evidence: `backend/app/project_config.py`)
- Project configuration → Service connections: plans connections (evidence: `backend/app/project_config.py`)
- Project configuration → Shared folders: loads folder access (evidence: `backend/app/project_config.py`)
- Service connections → Application database: stores credentials (evidence: `backend/app/connections.py`)
- MCP sign-in → Service connections: uses connection policy (evidence: `backend/app/mcp_auth/scheme.py`)
- Runtime settings → Application database: loads and saves (evidence: `backend/app/app_settings.py`)
- Isolated agent cells → Shared folders: mounts approved folders
- Project owner → Run logs and results: reviews results (evidence: `README.md`)
