# xbrxr03/clawos architecture

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

- Interactive diagram: https://gitdiagram.com/xbrxr03/clawos
- Repository: https://github.com/xbrxr03/clawos

## Overview

ClawOS is a local-first agent OS: users submit tasks through the CLI, voice activation, or dashboard; agent execution can invoke tools or workflows, with policy approval for sensitive actions, and services provide memory and other capabilities. The README documents additional product branches including research, A2A, MCP, voice, model management, and setup. Some service-to-service wiring is not shown in the excerpts, so those connections are omitted rather than inferred.

Main entry points: [`runtimes/agent/runtime.py`](https://github.com/xbrxr03/clawos/blob/main/runtimes/agent/runtime.py) (Agent runtime), [`workflows/engine.py`](https://github.com/xbrxr03/clawos/blob/main/workflows/engine.py) (Workflow engine), [`services/toolbridge/service.py`](https://github.com/xbrxr03/clawos/blob/main/services/toolbridge/service.py) (Tool bridge), [`services/waketrd/main.py`](https://github.com/xbrxr03/clawos/blob/main/services/waketrd/main.py) (Wake voice)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent execution"]
  node_agentd["Agent daemon<br/>[main.py]"]
  node_runtime["Agent runtime<br/>[runtime.py]"]
  node_tool_schemas["Tool schemas<br/>[tool_schemas.py]"]
  node_workflows["Workflow engine<br/>[engine.py]"]
  node_durable["Durable execution<br/>[durable_engine.py]"]
  node_builtin_workflows["Built-in workflows"]
end

subgraph group_safety["Safety and tools"]
  node_policy["Policy engine<br/>[service.py]"]
  node_toolbridge["Tool bridge<br/>[service.py]"]
  node_browser["Browser adapter"]
  node_approval["Approval gates"]
end

subgraph group_services["Product services"]
  node_voice["Wake voice<br/>[main.py]"]
  node_memory["Memory service<br/>[service.py]"]
  node_brain[("Knowledge graph<br/>[storage.py]")]
  node_research["Research engine<br/>[engine.py]"]
  node_calendar["Calendar service<br/>[engine.py]"]
  node_mcp["MCP server<br/>[main.py]"]
  node_a2a["Agent mesh<br/>[service.py]"]
  node_voice_service["Voice service<br/>[main.py]"]
  node_setup["First-run setup<br/>[service.py]"]
end

subgraph group_clients["User interfaces"]
  node_cli["Control CLI<br/>[main.py]"]
  node_dashboard["Dashboard<br/>[App.tsx]"]
end

subgraph group_core["Shared runtime"]
  node_config["Configuration<br/>[loader.py]"]
end

node_user(("User"))
node_model["Local model server"]

node_user -->|"submits task"| node_cli
node_user -->|"uses control panel"| node_dashboard
node_user -->|"speaks wake word"| node_voice
node_cli -.->|"submits task"| node_agentd
node_voice -->|"enters agent"| node_runtime
node_agentd -.->|"runs agent"| node_runtime
node_runtime -->|"requests inference"| node_model
node_runtime -.->|"uses tool definitions"| node_tool_schemas
node_runtime -->|"invokes tools"| node_toolbridge
node_toolbridge -->|"uses browser adapter"| node_browser
node_runtime -->|"checks tool calls"| node_policy
node_policy -->|"requests approval"| node_approval
node_runtime -->|"runs workflow"| node_workflows
node_workflows -->|"gates destructive runs"| node_policy
node_workflows -->|"gets agent"| node_agentd
node_workflows -->|"loads workflows"| node_builtin_workflows
node_workflows -.->|"durable runs"| node_durable
node_runtime -->|"uses memory"| node_memory
node_memory -->|"stores graph"| node_brain
node_runtime -->|"requests research"| node_research
node_runtime -->|"uses calendar"| node_calendar
node_mcp -->|"exposes tools"| node_toolbridge
node_user -->|"coordinates agents"| node_a2a
node_voice -.->|"uses speech service"| node_voice_service
node_setup -.->|"configures system"| node_config
node_toolbridge -->|"reads settings"| node_config
node_browser -->|"reads settings"| node_config

click node_cli "https://github.com/xbrxr03/clawos/blob/main/clawctl/main.py"
click node_dashboard "https://github.com/xbrxr03/clawos/blob/main/dashboard/frontend/src/App.tsx"
click node_voice "https://github.com/xbrxr03/clawos/blob/main/services/waketrd/main.py"
click node_agentd "https://github.com/xbrxr03/clawos/blob/main/services/agentd/v2/main.py"
click node_runtime "https://github.com/xbrxr03/clawos/blob/main/runtimes/agent/runtime.py"
click node_tool_schemas "https://github.com/xbrxr03/clawos/blob/main/runtimes/agent/tool_schemas.py"
click node_workflows "https://github.com/xbrxr03/clawos/blob/main/workflows/engine.py"
click node_durable "https://github.com/xbrxr03/clawos/blob/main/workflows/durable_engine.py"
click node_builtin_workflows "https://github.com/xbrxr03/clawos/tree/main/workflows"
click node_policy "https://github.com/xbrxr03/clawos/blob/main/services/policyd/service.py"
click node_toolbridge "https://github.com/xbrxr03/clawos/blob/main/services/toolbridge/service.py"
click node_browser "https://github.com/xbrxr03/clawos/blob/main/adapters/browser/playwright_adapter.py"
click node_approval "https://github.com/xbrxr03/clawos/blob/main/dashboard/frontend/src/overlays/ApprovalOverlay.tsx"
click node_memory "https://github.com/xbrxr03/clawos/blob/main/services/memd/service.py"
click node_brain "https://github.com/xbrxr03/clawos/blob/main/services/braind/storage.py"
click node_research "https://github.com/xbrxr03/clawos/blob/main/services/researchd/engine.py"
click node_calendar "https://github.com/xbrxr03/clawos/blob/main/services/calendard/engine.py"
click node_mcp "https://github.com/xbrxr03/clawos/blob/main/services/mcpd/main.py"
click node_a2a "https://github.com/xbrxr03/clawos/blob/main/services/a2ad/service.py"
click node_voice_service "https://github.com/xbrxr03/clawos/blob/main/services/voiced/main.py"
click node_config "https://github.com/xbrxr03/clawos/blob/main/clawos_core/config/loader.py"
click node_setup "https://github.com/xbrxr03/clawos/blob/main/services/setupd/service.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_agentd,node_runtime,node_tool_schemas,node_workflows,node_durable,node_builtin_workflows,node_user toneBlue
class node_policy,node_toolbridge,node_browser,node_approval toneAmber
class node_voice,node_memory,node_brain,node_research,node_calendar,node_mcp,node_a2a,node_voice_service,node_setup,node_model toneMint
class node_cli,node_dashboard toneRose
class node_config toneIndigo
```

## Components

### Agent execution

- [Agent daemon](https://github.com/xbrxr03/clawos/blob/main/services/agentd/v2/main.py): `services/agentd/v2/main.py`
- [Agent runtime](https://github.com/xbrxr03/clawos/blob/main/runtimes/agent/runtime.py): `runtimes/agent/runtime.py`
- [Tool schemas](https://github.com/xbrxr03/clawos/blob/main/runtimes/agent/tool_schemas.py): `runtimes/agent/tool_schemas.py`
- [Workflow engine](https://github.com/xbrxr03/clawos/blob/main/workflows/engine.py): `workflows/engine.py`
- [Durable execution](https://github.com/xbrxr03/clawos/blob/main/workflows/durable_engine.py): `workflows/durable_engine.py`
- [Built-in workflows](https://github.com/xbrxr03/clawos/tree/main/workflows): `workflows`

### Safety and tools

- [Policy engine](https://github.com/xbrxr03/clawos/blob/main/services/policyd/service.py): `services/policyd/service.py`
- [Tool bridge](https://github.com/xbrxr03/clawos/blob/main/services/toolbridge/service.py): `services/toolbridge/service.py`
- [Browser adapter](https://github.com/xbrxr03/clawos/blob/main/adapters/browser/playwright_adapter.py): `adapters/browser/playwright_adapter.py`
- [Approval gates](https://github.com/xbrxr03/clawos/blob/main/dashboard/frontend/src/overlays/ApprovalOverlay.tsx): `dashboard/frontend/src/overlays/ApprovalOverlay.tsx`

### Product services

- [Wake voice](https://github.com/xbrxr03/clawos/blob/main/services/waketrd/main.py): `services/waketrd/main.py`
- [Memory service](https://github.com/xbrxr03/clawos/blob/main/services/memd/service.py): `services/memd/service.py`
- [Knowledge graph](https://github.com/xbrxr03/clawos/blob/main/services/braind/storage.py): `services/braind/storage.py`
- [Research engine](https://github.com/xbrxr03/clawos/blob/main/services/researchd/engine.py): `services/researchd/engine.py`
- [Calendar service](https://github.com/xbrxr03/clawos/blob/main/services/calendard/engine.py): `services/calendard/engine.py`
- [MCP server](https://github.com/xbrxr03/clawos/blob/main/services/mcpd/main.py): `services/mcpd/main.py`
- [Agent mesh](https://github.com/xbrxr03/clawos/blob/main/services/a2ad/service.py): `services/a2ad/service.py`
- [Voice service](https://github.com/xbrxr03/clawos/blob/main/services/voiced/main.py): `services/voiced/main.py`
- [First-run setup](https://github.com/xbrxr03/clawos/blob/main/services/setupd/service.py): `services/setupd/service.py`

### User interfaces

- [Control CLI](https://github.com/xbrxr03/clawos/blob/main/clawctl/main.py): `clawctl/main.py`
- [Dashboard](https://github.com/xbrxr03/clawos/blob/main/dashboard/frontend/src/App.tsx): `dashboard/frontend/src/App.tsx`

### Shared runtime

- [Configuration](https://github.com/xbrxr03/clawos/blob/main/clawos_core/config/loader.py): `clawos_core/config/loader.py`

### Other components

- **User**
- **Local model server**

## Connections

- User → Control CLI: submits task
- User → Dashboard: uses control panel
- User → Wake voice: speaks wake word
- Control CLI → Agent daemon: submits task
- Wake voice → Agent runtime: enters agent
- Agent daemon → Agent runtime: runs agent
- Agent runtime → Local model server: requests inference
- Agent runtime → Tool schemas: uses tool definitions
- Agent runtime → Tool bridge: invokes tools
- Tool bridge → Browser adapter: uses browser adapter (evidence: `services/toolbridge/service.py`)
- Agent runtime → Policy engine: checks tool calls
- Policy engine → Approval gates: requests approval
- Agent runtime → Workflow engine: runs workflow (evidence: `workflows/engine.py`)
- Workflow engine → Policy engine: gates destructive runs (evidence: `workflows/engine.py`)
- Workflow engine → Agent daemon: gets agent (evidence: `workflows/engine.py`)
- Workflow engine → Built-in workflows: loads workflows (evidence: `workflows/engine.py`)
- Workflow engine → Durable execution: durable runs
- Agent runtime → Memory service: uses memory
- Memory service → Knowledge graph: stores graph
- Agent runtime → Research engine: requests research
- Agent runtime → Calendar service: uses calendar
- MCP server → Tool bridge: exposes tools (evidence: `services/mcpd/main.py`)
- User → Agent mesh: coordinates agents
- Wake voice → Voice service: uses speech service
- First-run setup → Configuration: configures system
- Tool bridge → Configuration: reads settings (evidence: `services/toolbridge/service.py`)
- Browser adapter → Configuration: reads settings (evidence: `adapters/browser/session_manager.py`)
