# ujjwal-bru/assistclaw architecture

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

- Interactive diagram: https://gitdiagram.com/ujjwal-bru/assistclaw
- Repository: https://github.com/ujjwal-bru/assistclaw

## Overview

AssistClaw is a Go-based autonomous agent that accepts requests through messaging channels or its gateway, runs an agent loop with model and tool access, and uses memory, skills, and security controls. The README documents the major capability branches; sampled source confirms the runner’s tool dispatch, email drafting/notifications, gateway endpoints, and MCP skill traversal. Some subsystem links below rely on README-level architecture because their wiring was not sampled.

Main entry points: [`internal/agent/runner.go`](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/agent/runner.go) (Agent Runner), [`internal/gateway/server.go`](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/gateway/server.go) (Web Gateway), [`internal/email/service.go`](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/email/service.go) (Email Assistant), [`internal/channels/channel.go`](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/channels/channel.go) (Chat Channels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Interfaces"]
  node_cli["CLI<br/>[main.go]"]
  node_channels["Chat Channels<br/>[channel.go]"]
  node_gateway["Web Gateway<br/>[server.go]"]
  node_webui["Web UI<br/>[webui.go]"]
end

subgraph group_agent["Agent Runtime"]
  node_runner["Agent Runner<br/>[runner.go]"]
  node_tools["Tool Runtime<br/>[tools.go]"]
  node_cron["Scheduled Jobs<br/>[cron.go]"]
  node_email["Email Assistant<br/>[service.go]"]
end

subgraph group_knowledge["Memory and Skills"]
  node_memory[("Three-Tier Memory<br/>[memory.go]")]
  node_embeddings["Embedding Providers<br/>[providers.go]"]
  node_skills["Skill Graph<br/>[graph.go]"]
end

subgraph group_integrations["Models and Integrations"]
  node_provider["LLM Providers<br/>[registry.go]"]
  node_websearch["Web Search<br/>[web_search.go]"]
  node_mcp["MCP Server<br/>[server.go]"]
  node_sensing["Hardware Sensing<br/>[audio_stream.cpp]"]
end

subgraph group_safety["Security"]
  node_security["Guardrail and Audit<br/>[guardrail.go]"]
end

node_user(("User"))
node_mailboxes["Mailboxes"]

node_user -->|"sends messages"| node_channels
node_user -->|"submits requests"| node_gateway
node_user -->|"runs commands"| node_cli
node_channels -->|"delivers messages"| node_runner
node_gateway -->|"routes requests"| node_runner
node_cli -->|"starts agent"| node_runner
node_gateway -->|"serves UI"| node_webui
node_runner -->|"requests completions"| node_provider
node_runner -->|"dispatches calls"| node_tools
node_runner -->|"uses memory tiers"| node_memory
node_runner -->|"checks tool calls"| node_security
node_runner -->|"traverses skills"| node_skills
node_runner -->|"runs scheduled turns"| node_cron
node_mailboxes -->|"provides mail"| node_email
node_email -->|"generates summaries"| node_provider
node_email -->|"posts drafts"| node_channels
node_tools -.->|"offers search tool"| node_websearch
node_mcp -->|"reads skill nodes"| node_skills
node_memory -->|"supports semantic search"| node_embeddings
node_sensing -.->|"supplies sensor input"| node_runner

click node_cli "https://github.com/ujjwal-bru/assistclaw/blob/main/cmd/assistclaw/main.go"
click node_channels "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/channels/channel.go"
click node_gateway "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/gateway/server.go"
click node_webui "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/webui/webui.go"
click node_runner "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/agent/runner.go"
click node_tools "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/tools/tools.go"
click node_cron "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/cron/cron.go"
click node_email "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/email/service.go"
click node_memory "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/memory/memory.go"
click node_embeddings "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/embeddings/providers/providers.go"
click node_skills "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/skills/graph.go"
click node_provider "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/provider/registry.go"
click node_websearch "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/tools/web_search.go"
click node_mcp "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/mcp/server.go"
click node_security "https://github.com/ujjwal-bru/assistclaw/blob/main/internal/security/guardrail.go"
click node_sensing "https://github.com/ujjwal-bru/assistclaw/blob/main/sensing/audio/audio_stream.cpp"

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_cli,node_channels,node_gateway,node_webui,node_user toneBlue
class node_runner,node_tools,node_cron,node_email toneAmber
class node_memory,node_embeddings,node_skills toneMint
class node_provider,node_websearch,node_mcp,node_sensing toneRose
class node_security,node_mailboxes toneIndigo
```

## Components

### Interfaces

- [CLI](https://github.com/ujjwal-bru/assistclaw/blob/main/cmd/assistclaw/main.go): `cmd/assistclaw/main.go`
- [Chat Channels](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/channels/channel.go): `internal/channels/channel.go`
- [Web Gateway](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/gateway/server.go): `internal/gateway/server.go`
- [Web UI](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/webui/webui.go): `internal/webui/webui.go`

### Agent Runtime

- [Agent Runner](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/agent/runner.go): `internal/agent/runner.go`
- [Tool Runtime](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/tools/tools.go): `internal/tools/tools.go`
- [Scheduled Jobs](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/cron/cron.go): `internal/cron/cron.go`
- [Email Assistant](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/email/service.go): `internal/email/service.go`

### Memory and Skills

- [Three-Tier Memory](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/memory/memory.go): `internal/memory/memory.go`
- [Embedding Providers](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/embeddings/providers/providers.go): `internal/embeddings/providers/providers.go`
- [Skill Graph](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/skills/graph.go): `internal/skills/graph.go`

### Models and Integrations

- [LLM Providers](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/provider/registry.go): `internal/provider/registry.go`
- [Web Search](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/tools/web_search.go): `internal/tools/web_search.go`
- [MCP Server](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/mcp/server.go): `internal/mcp/server.go`
- [Hardware Sensing](https://github.com/ujjwal-bru/assistclaw/blob/main/sensing/audio/audio_stream.cpp): `sensing/audio/audio_stream.cpp`

### Security

- [Guardrail and Audit](https://github.com/ujjwal-bru/assistclaw/blob/main/internal/security/guardrail.go): `internal/security/guardrail.go`

### Other components

- **User**
- **Mailboxes**

## Connections

- User → Chat Channels: sends messages
- User → Web Gateway: submits requests
- User → CLI: runs commands
- Chat Channels → Agent Runner: delivers messages
- Web Gateway → Agent Runner: routes requests
- CLI → Agent Runner: starts agent (evidence: `cmd/assistclaw/main.go`)
- Web Gateway → Web UI: serves UI (evidence: `internal/gateway/server.go`)
- Agent Runner → LLM Providers: requests completions
- Agent Runner → Tool Runtime: dispatches calls (evidence: `internal/agent/runner.go`)
- Agent Runner → Three-Tier Memory: uses memory tiers
- Agent Runner → Guardrail and Audit: checks tool calls (evidence: `internal/agent/runner.go`)
- Agent Runner → Skill Graph: traverses skills
- Agent Runner → Scheduled Jobs: runs scheduled turns
- Mailboxes → Email Assistant: provides mail
- Email Assistant → LLM Providers: generates summaries
- Email Assistant → Chat Channels: posts drafts
- Tool Runtime → Web Search: offers search tool
- MCP Server → Skill Graph: reads skill nodes (evidence: `internal/mcp/server.go`)
- Three-Tier Memory → Embedding Providers: supports semantic search
- Hardware Sensing → Agent Runner: supplies sensor input
