# upmo-ai/upmo architecture

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

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

## Overview

Upmo is a self-hostable AI-agent work platform: a React app fronts a modular Go backend backed by Postgres. The principal flow is a person opening a task, an agent planning and working with scoped tools, a check verifying the result, and an approval before consequential changes. Separate branches provide identity, connectors, knowledge, model routing and budgets, artifacts, and a full audit log. Workflow stages and guarantees follow the README; source-index references support the shown task, web, gateway, and knowledge boundaries, but unsampled implementations are not asserted in detail.

Main entry points: [`internal/tasks/app/runner.go`](https://github.com/upmo-ai/upmo/blob/main/internal/tasks/app/runner.go) (Task orchestration), [`internal/tasks/adapters/http/tasks.go`](https://github.com/upmo-ai/upmo/blob/main/internal/tasks/adapters/http/tasks.go) (Task HTTP API), [`web/src/app/brain-api.ts`](https://github.com/upmo-ai/upmo/blob/main/web/src/app/brain-api.ts) (API client), [`web/src/App.tsx`](https://github.com/upmo-ai/upmo/blob/main/web/src/App.tsx) (Web app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_webapp["Web app<br/>[App.tsx]"]
  node_webapi["API client<br/>[brain-api.ts]"]
  node_taskui["Task workspace<br/>[tasks.tsx]"]
  node_identityui["Identity settings<br/>[members.tsx]"]
end

subgraph group_work["Task execution"]
  node_taskhttp["Task HTTP API<br/>[tasks.go]"]
  node_taskapp["Task orchestration<br/>[runner.go]"]
  node_taskdomain["Task lifecycle<br/>[step.go]"]
  node_taskstore[("Task persistence<br/>[store.go]")]
  node_sandbox["Sandbox runtime<br/>[engine.go]"]
  node_sandboxd["Sandbox service<br/>[sandboxd.go]"]
  node_approvals["Checks and approvals<br/>[approval.go]"]
  node_artifacts["Task artifacts<br/>[artifacts.go]"]
end

subgraph group_integrations["Tools and models"]
  node_connectors["Tool connectors<br/>[connectors.go]"]
  node_gateway["Model gateway<br/>[gateway.go]"]
  node_gatewayroutes["Model routing<br/>[routes.go]"]
end

subgraph group_knowledge["Knowledge and memory"]
  node_knowledge["Knowledge ingest<br/>[ingest.go]"]
  node_knowledgeapi["Knowledge API<br/>[knowledge.go]"]
  node_memory["Agent memory<br/>[memory.go]"]
end

subgraph group_trust["Identity and oversight"]
  node_identity["Identity and access<br/>[identity.go]"]
  node_audit["Audit log<br/>[audit.go]"]
end

node_person(("Workspace user"))
node_postgres[("Postgres")]

node_person -->|"uses"| node_webapp
node_webapp -->|"creates client"| node_webapi
node_webapp -->|"routes to"| node_taskui
node_webapi -->|"calls API"| node_taskhttp
node_taskui -->|"requests tasks"| node_webapi
node_person -->|"opens task"| node_taskhttp
node_taskhttp -->|"dispatches"| node_taskapp
node_taskapp -->|"advances"| node_taskdomain
node_taskapp -->|"reads and writes"| node_taskstore
node_taskapp -->|"runs work"| node_sandbox
node_sandbox -->|"requests sandbox"| node_sandboxd
node_taskapp -->|"checks and gates"| node_approvals
node_approvals -->|"requests approval"| node_person
node_taskapp -->|"uses tools"| node_connectors
node_taskapp -->|"requests models"| node_gateway
node_gateway -->|"dispatches route"| node_gatewayroutes
node_taskapp -->|"uses knowledge"| node_knowledgeapi
node_knowledgeapi -.->|"ingests sources"| node_knowledge
node_taskapp -.->|"uses memory"| node_memory
node_person -->|"manages access"| node_identityui
node_identityui -->|"requests identity"| node_webapi
node_taskhttp -.->|"checks access"| node_identity
node_taskapp -.->|"produces artifacts"| node_artifacts
node_taskapp -->|"records actions"| node_audit
node_taskstore -->|"persists tasks"| node_postgres
node_gatewayroutes -->|"stores routes"| node_postgres
node_knowledge -->|"stores chunks"| node_postgres

click node_webapp "https://github.com/upmo-ai/upmo/blob/main/web/src/App.tsx"
click node_webapi "https://github.com/upmo-ai/upmo/blob/main/web/src/app/brain-api.ts"
click node_taskui "https://github.com/upmo-ai/upmo/blob/main/web/src/features/tasks/tasks.tsx"
click node_identityui "https://github.com/upmo-ai/upmo/blob/main/web/src/features/identity/members.tsx"
click node_taskhttp "https://github.com/upmo-ai/upmo/blob/main/internal/tasks/adapters/http/tasks.go"
click node_taskapp "https://github.com/upmo-ai/upmo/blob/main/internal/tasks/app/runner.go"
click node_taskdomain "https://github.com/upmo-ai/upmo/blob/main/internal/tasks/domain/step.go"
click node_taskstore "https://github.com/upmo-ai/upmo/blob/main/internal/tasks/adapters/postgres/store.go"
click node_sandbox "https://github.com/upmo-ai/upmo/blob/main/internal/runtime/engine/engine.go"
click node_sandboxd "https://github.com/upmo-ai/upmo/blob/main/internal/sandboxd/sandboxd.go"
click node_approvals "https://github.com/upmo-ai/upmo/blob/main/internal/tasks/app/approval.go"
click node_connectors "https://github.com/upmo-ai/upmo/blob/main/internal/connectors/connectors.go"
click node_gateway "https://github.com/upmo-ai/upmo/blob/main/internal/gateway/gateway.go"
click node_gatewayroutes "https://github.com/upmo-ai/upmo/blob/main/internal/gateway/app/routes.go"
click node_knowledge "https://github.com/upmo-ai/upmo/blob/main/internal/knowledge/app/ingest.go"
click node_knowledgeapi "https://github.com/upmo-ai/upmo/blob/main/internal/knowledge/adapters/http/knowledge.go"
click node_memory "https://github.com/upmo-ai/upmo/blob/main/internal/memory/memory.go"
click node_identity "https://github.com/upmo-ai/upmo/blob/main/internal/identity/identity.go"
click node_audit "https://github.com/upmo-ai/upmo/blob/main/internal/platform/audit/audit.go"
click node_artifacts "https://github.com/upmo-ai/upmo/blob/main/internal/artifacts/artifacts.go"

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_webapi,node_taskui,node_identityui,node_person toneBlue
class node_taskhttp,node_taskapp,node_taskdomain,node_taskstore,node_sandbox,node_sandboxd,node_approvals,node_artifacts,node_postgres toneAmber
class node_connectors,node_gateway,node_gatewayroutes toneMint
class node_knowledge,node_knowledgeapi,node_memory toneRose
class node_identity,node_audit toneIndigo
```

## Components

### Web experience

- [Web app](https://github.com/upmo-ai/upmo/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [API client](https://github.com/upmo-ai/upmo/blob/main/web/src/app/brain-api.ts): `web/src/app/brain-api.ts`
- [Task workspace](https://github.com/upmo-ai/upmo/blob/main/web/src/features/tasks/tasks.tsx): `web/src/features/tasks/tasks.tsx`
- [Identity settings](https://github.com/upmo-ai/upmo/blob/main/web/src/features/identity/members.tsx): `web/src/features/identity/members.tsx`

### Task execution

- [Task HTTP API](https://github.com/upmo-ai/upmo/blob/main/internal/tasks/adapters/http/tasks.go): `internal/tasks/adapters/http/tasks.go`
- [Task orchestration](https://github.com/upmo-ai/upmo/blob/main/internal/tasks/app/runner.go): `internal/tasks/app/runner.go`
- [Task lifecycle](https://github.com/upmo-ai/upmo/blob/main/internal/tasks/domain/step.go): `internal/tasks/domain/step.go`
- [Task persistence](https://github.com/upmo-ai/upmo/blob/main/internal/tasks/adapters/postgres/store.go): `internal/tasks/adapters/postgres/store.go`
- [Sandbox runtime](https://github.com/upmo-ai/upmo/blob/main/internal/runtime/engine/engine.go): `internal/runtime/engine/engine.go`
- [Sandbox service](https://github.com/upmo-ai/upmo/blob/main/internal/sandboxd/sandboxd.go): `internal/sandboxd/sandboxd.go`
- [Checks and approvals](https://github.com/upmo-ai/upmo/blob/main/internal/tasks/app/approval.go): `internal/tasks/app/approval.go`
- [Task artifacts](https://github.com/upmo-ai/upmo/blob/main/internal/artifacts/artifacts.go): `internal/artifacts/artifacts.go`

### Tools and models

- [Tool connectors](https://github.com/upmo-ai/upmo/blob/main/internal/connectors/connectors.go): `internal/connectors/connectors.go`
- [Model gateway](https://github.com/upmo-ai/upmo/blob/main/internal/gateway/gateway.go): `internal/gateway/gateway.go`
- [Model routing](https://github.com/upmo-ai/upmo/blob/main/internal/gateway/app/routes.go): `internal/gateway/app/routes.go`

### Knowledge and memory

- [Knowledge ingest](https://github.com/upmo-ai/upmo/blob/main/internal/knowledge/app/ingest.go): `internal/knowledge/app/ingest.go`
- [Knowledge API](https://github.com/upmo-ai/upmo/blob/main/internal/knowledge/adapters/http/knowledge.go): `internal/knowledge/adapters/http/knowledge.go`
- [Agent memory](https://github.com/upmo-ai/upmo/blob/main/internal/memory/memory.go): `internal/memory/memory.go`

### Identity and oversight

- [Identity and access](https://github.com/upmo-ai/upmo/blob/main/internal/identity/identity.go): `internal/identity/identity.go`
- [Audit log](https://github.com/upmo-ai/upmo/blob/main/internal/platform/audit/audit.go): `internal/platform/audit/audit.go`

### Other components

- **Workspace user**
- **Postgres**

## Connections

- Workspace user → Web app: uses
- Web app → API client: creates client (evidence: `web/src/App.tsx`)
- Web app → Task workspace: routes to
- API client → Task HTTP API: calls API (evidence: `web/src/app/brain-api.ts`)
- Task workspace → API client: requests tasks (evidence: `web/src/features/tasks/tasks.tsx`)
- Workspace user → Task HTTP API: opens task
- Task HTTP API → Task orchestration: dispatches (evidence: `internal/tasks/adapters/http/tasks.go`)
- Task orchestration → Task lifecycle: advances
- Task orchestration → Task persistence: reads and writes
- Task orchestration → Sandbox runtime: runs work
- Sandbox runtime → Sandbox service: requests sandbox
- Task orchestration → Checks and approvals: checks and gates
- Checks and approvals → Workspace user: requests approval
- Task orchestration → Tool connectors: uses tools
- Task orchestration → Model gateway: requests models
- Model gateway → Model routing: dispatches route
- Task orchestration → Knowledge API: uses knowledge
- Knowledge API → Knowledge ingest: ingests sources
- Task orchestration → Agent memory: uses memory
- Workspace user → Identity settings: manages access
- Identity settings → API client: requests identity (evidence: `web/src/features/identity/members.tsx`)
- Task HTTP API → Identity and access: checks access
- Task orchestration → Task artifacts: produces artifacts
- Task orchestration → Audit log: records actions
- Task persistence → Postgres: persists tasks
- Model routing → Postgres: stores routes
- Knowledge ingest → Postgres: stores chunks (evidence: `internal/knowledge/app/ingest.go`)
