# gamurigm/trama-platform architecture

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

- Interactive diagram: https://gitdiagram.com/gamurigm/trama-platform
- Repository: https://github.com/gamurigm/trama-platform

## Overview

TRAMA coordinates independent AI-agent projects: users register projects, define requirements, plan phases and tasks, approve work, then track execution, results, and operational status. The Python platform provides the API, durable state, coordination and worker runtime; the terminal UI is a user-facing client. Distributed deployments add a Go admission gateway and outbox. README-documented MCP/Hermes, CCCC, and optional knowledge integrations are preserved, but unsampled implementation details limit their edges; dashed edges indicate documented but unverified wiring.

Main entry points: [`src/trama_platform/runtime.py`](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/runtime.py) (Task runtime), [`tui/src/App.tsx`](https://github.com/gamurigm/trama-platform/blob/main/tui/src/App.tsx) (Terminal console), [`tui/src/api/client.ts`](https://github.com/gamurigm/trama-platform/blob/main/tui/src/api/client.ts) (API client), [`src/trama_platform/worker.py`](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/worker.py) (Python worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User interfaces"]
  node_tui["Terminal console<br/>[App.tsx]"]
  node_tui_client["API client<br/>[client.ts]"]
  node_projects["Projects view<br/>[ProjectsView.tsx]"]
  node_planning["Planning view<br/>[PlanningView.tsx]"]
  node_tasks["Tasks view<br/>[TasksView.tsx]"]
  node_observability_view["Observability view"]
  node_integrations_view["Integrations view"]
end

subgraph group_platform["Platform core"]
  node_api["Platform API<br/>[api.py]"]
  node_contracts["Domain contracts<br/>[contracts.py]"]
  node_settings["Configuration<br/>[settings.py]"]
  node_state[("State store<br/>[state_store.py]")]
  node_storage["Store selection<br/>[storage.py]"]
end

subgraph group_execution["Execution and coordination"]
  node_runtime["Task runtime<br/>[runtime.py]"]
  node_queue["Dispatch queue<br/>[queueing.py]"]
  node_leases["Task leases<br/>[leases.py]"]
  node_worker["Python worker<br/>[worker.py]"]
  node_coordination["Coordination adapter<br/>[coordination.py]"]
end

subgraph group_distributed["Distributed services"]
  node_gateway["Admission gateway<br/>[main.go]"]
  node_admission["Admission service<br/>[service.go]"]
  node_admission_store[("Admission store<br/>[postgres.go]")]
  node_outbox_worker["Outbox worker<br/>[worker.go]"]
  node_nats["NATS events<br/>[nats.go]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_integrations["Agent and knowledge integrations"]
  node_mcp["MCP tools<br/>[mcp_server.py]"]
  node_hermes["Hermes agent<br/>[hermes.py]"]
  node_cccc["CCCC execution<br/>[coordination.py]"]
  node_knowledge["Knowledge adapters"]
  node_utopia["Utopia MCP<br/>[utopia_mcp.py]"]
end

node_user(("Operator"))

node_user -->|"operates"| node_tui
node_tui -->|"renders"| node_projects
node_tui -->|"renders"| node_planning
node_tui -->|"renders"| node_tasks
node_tui -->|"renders"| node_observability_view
node_tui -->|"renders"| node_integrations_view
node_projects -.->|"uses API"| node_tui_client
node_planning -.->|"uses API"| node_tui_client
node_tasks -.->|"uses API"| node_tui_client
node_observability_view -.->|"uses API"| node_tui_client
node_integrations_view -.->|"uses API"| node_tui_client
node_tui_client -.->|"HTTP requests"| node_api
node_user -->|"uses API"| node_api
node_api -.->|"reads and writes"| node_state
node_api -.->|"coordinates work"| node_runtime
node_api -.->|"uses contracts"| node_contracts
node_storage -->|"reads settings"| node_settings
node_storage -->|"selects backend"| node_state
node_worker -->|"runs tasks"| node_runtime
node_worker -->|"selects coordination"| node_coordination
node_worker -->|"uses state"| node_state
node_worker -->|"consumes events"| node_queue
node_runtime -->|"dispatches work"| node_queue
node_runtime -->|"uses leases"| node_leases
node_runtime -->|"persists state"| node_state
node_runtime -->|"uses contracts"| node_contracts
node_coordination -.->|"bridges tasks"| node_cccc
node_gateway -->|"routes requests"| node_admission
node_gateway -->|"opens connection"| node_postgres
node_admission -.->|"uses store"| node_admission_store
node_admission_store -.->|"persists admissions"| node_postgres
node_outbox_worker -.->|"publishes events"| node_nats
node_user -.->|"uses tools"| node_mcp
node_worker -.->|"supervises agent"| node_hermes
node_runtime -.->|"optional memory"| node_knowledge
node_runtime -.->|"optional knowledge"| node_utopia

click node_tui "https://github.com/gamurigm/trama-platform/blob/main/tui/src/App.tsx"
click node_tui_client "https://github.com/gamurigm/trama-platform/blob/main/tui/src/api/client.ts"
click node_projects "https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/ProjectsView.tsx"
click node_planning "https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/PlanningView.tsx"
click node_tasks "https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/TasksView.tsx"
click node_observability_view "https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/ObservabilityView.tsx"
click node_integrations_view "https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/IntegrationsView.tsx"
click node_api "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/api.py"
click node_contracts "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/contracts.py"
click node_settings "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/settings.py"
click node_state "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/state_store.py"
click node_storage "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/storage.py"
click node_runtime "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/runtime.py"
click node_queue "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/queueing.py"
click node_leases "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/leases.py"
click node_worker "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/worker.py"
click node_coordination "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/coordination.py"
click node_gateway "https://github.com/gamurigm/trama-platform/blob/main/gateway/cmd/trama-gateway/main.go"
click node_admission "https://github.com/gamurigm/trama-platform/blob/main/gateway/internal/admission/service.go"
click node_admission_store "https://github.com/gamurigm/trama-platform/blob/main/gateway/internal/admission/postgres.go"
click node_outbox_worker "https://github.com/gamurigm/trama-platform/blob/main/gateway/internal/outbox/worker.go"
click node_nats "https://github.com/gamurigm/trama-platform/blob/main/gateway/internal/outbox/nats.go"
click node_mcp "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/mcp_server.py"
click node_hermes "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/hermes.py"
click node_cccc "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/coordination.py"
click node_knowledge "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/semantica_adapter.py"
click node_utopia "https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/utopia_mcp.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_tui,node_tui_client,node_projects,node_planning,node_tasks,node_observability_view,node_integrations_view toneBlue
class node_api,node_contracts,node_settings,node_state,node_storage toneAmber
class node_runtime,node_queue,node_leases,node_worker,node_coordination toneMint
class node_gateway,node_admission,node_admission_store,node_outbox_worker,node_nats,node_postgres toneRose
class node_mcp,node_hermes,node_cccc,node_knowledge,node_utopia,node_user toneIndigo
```

## Components

### User interfaces

- [Terminal console](https://github.com/gamurigm/trama-platform/blob/main/tui/src/App.tsx): `tui/src/App.tsx`
- [API client](https://github.com/gamurigm/trama-platform/blob/main/tui/src/api/client.ts): `tui/src/api/client.ts`
- [Projects view](https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/ProjectsView.tsx): `tui/src/components/ProjectsView.tsx`
- [Planning view](https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/PlanningView.tsx): `tui/src/components/PlanningView.tsx`
- [Tasks view](https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/TasksView.tsx): `tui/src/components/TasksView.tsx`
- [Observability view](https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/ObservabilityView.tsx): `tui/src/components/ObservabilityView.tsx`
- [Integrations view](https://github.com/gamurigm/trama-platform/blob/main/tui/src/components/IntegrationsView.tsx): `tui/src/components/IntegrationsView.tsx`

### Platform core

- [Platform API](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/api.py): `src/trama_platform/api.py`
- [Domain contracts](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/contracts.py): `src/trama_platform/contracts.py`
- [Configuration](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/settings.py): `src/trama_platform/settings.py`
- [State store](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/state_store.py): `src/trama_platform/state_store.py`
- [Store selection](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/storage.py): `src/trama_platform/storage.py`

### Execution and coordination

- [Task runtime](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/runtime.py): `src/trama_platform/runtime.py`
- [Dispatch queue](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/queueing.py): `src/trama_platform/queueing.py`
- [Task leases](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/leases.py): `src/trama_platform/leases.py`
- [Python worker](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/worker.py): `src/trama_platform/worker.py`
- [Coordination adapter](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/coordination.py): `src/trama_platform/coordination.py`

### Distributed services

- [Admission gateway](https://github.com/gamurigm/trama-platform/blob/main/gateway/cmd/trama-gateway/main.go): `gateway/cmd/trama-gateway/main.go`
- [Admission service](https://github.com/gamurigm/trama-platform/blob/main/gateway/internal/admission/service.go): `gateway/internal/admission/service.go`
- [Admission store](https://github.com/gamurigm/trama-platform/blob/main/gateway/internal/admission/postgres.go): `gateway/internal/admission/postgres.go`
- [Outbox worker](https://github.com/gamurigm/trama-platform/blob/main/gateway/internal/outbox/worker.go): `gateway/internal/outbox/worker.go`
- [NATS events](https://github.com/gamurigm/trama-platform/blob/main/gateway/internal/outbox/nats.go): `gateway/internal/outbox/nats.go`
- **PostgreSQL**

### Agent and knowledge integrations

- [MCP tools](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/mcp_server.py): `src/trama_platform/mcp_server.py`
- [Hermes agent](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/hermes.py): `src/trama_platform/hermes.py`
- [CCCC execution](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/coordination.py): `src/trama_platform/coordination.py`
- [Knowledge adapters](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/semantica_adapter.py): `src/trama_platform/semantica_adapter.py`
- [Utopia MCP](https://github.com/gamurigm/trama-platform/blob/main/src/trama_platform/utopia_mcp.py): `src/trama_platform/utopia_mcp.py`

### Other components

- **Operator**

## Connections

- Operator → Terminal console: operates
- Terminal console → Projects view: renders (evidence: `tui/src/App.tsx`)
- Terminal console → Planning view: renders (evidence: `tui/src/App.tsx`)
- Terminal console → Tasks view: renders (evidence: `tui/src/App.tsx`)
- Terminal console → Observability view: renders (evidence: `tui/src/App.tsx`)
- Terminal console → Integrations view: renders (evidence: `tui/src/App.tsx`)
- Projects view → API client: uses API
- Planning view → API client: uses API
- Tasks view → API client: uses API
- Observability view → API client: uses API
- Integrations view → API client: uses API
- API client → Platform API: HTTP requests
- Operator → Platform API: uses API
- Platform API → State store: reads and writes
- Platform API → Task runtime: coordinates work
- Platform API → Domain contracts: uses contracts
- Store selection → Configuration: reads settings (evidence: `src/trama_platform/storage.py`)
- Store selection → State store: selects backend (evidence: `src/trama_platform/storage.py`)
- Python worker → Task runtime: runs tasks (evidence: `src/trama_platform/worker.py`)
- Python worker → Coordination adapter: selects coordination (evidence: `src/trama_platform/worker.py`)
- Python worker → State store: uses state (evidence: `src/trama_platform/worker.py`)
- Python worker → Dispatch queue: consumes events (evidence: `src/trama_platform/worker.py`)
- Task runtime → Dispatch queue: dispatches work (evidence: `src/trama_platform/runtime.py`)
- Task runtime → Task leases: uses leases (evidence: `src/trama_platform/runtime.py`)
- Task runtime → State store: persists state (evidence: `src/trama_platform/runtime.py`)
- Task runtime → Domain contracts: uses contracts (evidence: `src/trama_platform/runtime.py`)
- Coordination adapter → CCCC execution: bridges tasks (evidence: `src/trama_platform/coordination.py`)
- Admission gateway → Admission service: routes requests (evidence: `gateway/cmd/trama-gateway/main.go`)
- Admission gateway → PostgreSQL: opens connection (evidence: `gateway/cmd/trama-gateway/main.go`)
- Admission service → Admission store: uses store
- Admission store → PostgreSQL: persists admissions
- Outbox worker → NATS events: publishes events
- Operator → MCP tools: uses tools
- Python worker → Hermes agent: supervises agent
- Task runtime → Knowledge adapters: optional memory
- Task runtime → Utopia MCP: optional knowledge
