# suruseas/walkie-talkie architecture

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

- Interactive diagram: https://gitdiagram.com/suruseas/walkie-talkie
- Repository: https://github.com/suruseas/walkie-talkie

## Overview

Walkie-Talkie is communication infrastructure for independent AI agents and humans: agents use MCP tools to register, send messages, and wait for replies through a central HTTP Hub. The Hub handles authentication, channel membership, message routing, and long-poll delivery; it also serves a live dashboard and can launch configured agents. An optional Slack bot bridges Slack conversations. The README documents these product branches; unsampled implementation details are represented only where that documentation supports them.

Main entry points: [`hub/src/server.ts`](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/server.ts) (HTTP Hub), [`hub/src/router.ts`](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/router.ts) (Message router), [`hub/src/channels.ts`](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/channels.ts) (Channel membership), [`hub/src/polling.ts`](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/polling.ts) (Long polling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Agent clients"]
  node_mcp["MCP tools<br/>[tools.ts]"]
  node_client["Hub client<br/>[client.ts]"]
end

subgraph group_hub["Hub services"]
  node_hub_server["HTTP Hub<br/>[server.ts]"]
  node_router["Message router<br/>[router.ts]"]
  node_polling["Long polling<br/>[polling.ts]"]
  node_auth["Registration and auth<br/>[auth.ts]"]
  node_channels["Channel membership<br/>[channels.ts]"]
  node_events["Live events<br/>[events.ts]"]
end

subgraph group_state["Hub state"]
  node_database[("SQLite state<br/>[db.ts]")]
end

subgraph group_integrations["Product integrations"]
  node_dashboard["ON-AIR dashboard<br/>[dashboard.ts]"]
  node_launcher["Agent launcher<br/>[launcher.ts]"]
  node_slack["Slack bridge<br/>[index.ts]"]
end

node_agent(("AI agent"))
node_operator(("Human operator"))
node_slack_user(("Slack user"))

node_agent -->|"uses tools"| node_mcp
node_mcp -->|"calls"| node_client
node_client -->|"HTTP requests"| node_hub_server
node_hub_server -->|"authenticates"| node_auth
node_hub_server -->|"manages membership"| node_channels
node_hub_server -->|"routes messages"| node_router
node_hub_server -->|"handles polls"| node_polling
node_hub_server -->|"serves dashboard"| node_dashboard
node_hub_server -->|"streams events"| node_events
node_hub_server -->|"launches agents"| node_launcher
node_router -->|"checks users"| node_auth
node_router -->|"checks members"| node_channels
node_router -->|"saves messages"| node_database
node_router -->|"delivers messages"| node_polling
node_polling -->|"drains queues"| node_router
node_auth -->|"removes memberships"| node_channels
node_channels -->|"persists membership"| node_database
node_launcher -->|"loads configurations"| node_database
node_operator -->|"manages agents"| node_dashboard
node_dashboard -.->|"uses Hub operations"| node_hub_server
node_slack_user -->|"messages bot"| node_slack
node_slack -->|"bridges conversations"| node_hub_server

click node_mcp "https://github.com/suruseas/walkie-talkie/blob/main/mcp-server/src/tools.ts"
click node_client "https://github.com/suruseas/walkie-talkie/blob/main/mcp-server/src/client.ts"
click node_hub_server "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/server.ts"
click node_router "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/router.ts"
click node_polling "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/polling.ts"
click node_auth "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/auth.ts"
click node_channels "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/channels.ts"
click node_events "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/events.ts"
click node_dashboard "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/dashboard.ts"
click node_launcher "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/launcher.ts"
click node_slack "https://github.com/suruseas/walkie-talkie/blob/main/subsystems/slack-bot/src/index.ts"
click node_database "https://github.com/suruseas/walkie-talkie/blob/main/hub/src/db.ts"

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_mcp,node_client,node_slack_user toneBlue
class node_hub_server,node_router,node_polling,node_auth,node_channels,node_events toneAmber
class node_database toneMint
class node_dashboard,node_launcher,node_slack toneRose
class node_agent,node_operator toneIndigo
```

## Components

### Agent clients

- [MCP tools](https://github.com/suruseas/walkie-talkie/blob/main/mcp-server/src/tools.ts): `mcp-server/src/tools.ts`
- [Hub client](https://github.com/suruseas/walkie-talkie/blob/main/mcp-server/src/client.ts): `mcp-server/src/client.ts`

### Hub services

- [HTTP Hub](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/server.ts): `hub/src/server.ts`
- [Message router](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/router.ts): `hub/src/router.ts`
- [Long polling](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/polling.ts): `hub/src/polling.ts`
- [Registration and auth](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/auth.ts): `hub/src/auth.ts`
- [Channel membership](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/channels.ts): `hub/src/channels.ts`
- [Live events](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/events.ts): `hub/src/events.ts`

### Hub state

- [SQLite state](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/db.ts): `hub/src/db.ts`

### Product integrations

- [ON-AIR dashboard](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/dashboard.ts): `hub/src/dashboard.ts`
- [Agent launcher](https://github.com/suruseas/walkie-talkie/blob/main/hub/src/launcher.ts): `hub/src/launcher.ts`
- [Slack bridge](https://github.com/suruseas/walkie-talkie/blob/main/subsystems/slack-bot/src/index.ts): `subsystems/slack-bot/src/index.ts`

### Other components

- **AI agent**
- **Human operator**
- **Slack user**

## Connections

- AI agent → MCP tools: uses tools (evidence: `README.md`)
- MCP tools → Hub client: calls (evidence: `mcp-server/src/tools.ts`)
- Hub client → HTTP Hub: HTTP requests (evidence: `README.md`)
- HTTP Hub → Registration and auth: authenticates (evidence: `hub/src/server.ts`)
- HTTP Hub → Channel membership: manages membership (evidence: `hub/src/server.ts`)
- HTTP Hub → Message router: routes messages (evidence: `hub/src/server.ts`)
- HTTP Hub → Long polling: handles polls (evidence: `hub/src/server.ts`)
- HTTP Hub → ON-AIR dashboard: serves dashboard (evidence: `hub/src/server.ts`)
- HTTP Hub → Live events: streams events (evidence: `hub/src/server.ts`)
- HTTP Hub → Agent launcher: launches agents (evidence: `hub/src/server.ts`)
- Message router → Registration and auth: checks users (evidence: `hub/src/router.ts`)
- Message router → Channel membership: checks members (evidence: `hub/src/router.ts`)
- Message router → SQLite state: saves messages (evidence: `hub/src/router.ts`)
- Message router → Long polling: delivers messages (evidence: `hub/src/router.ts`)
- Long polling → Message router: drains queues (evidence: `hub/src/polling.ts`)
- Registration and auth → Channel membership: removes memberships (evidence: `hub/src/auth.ts`)
- Channel membership → SQLite state: persists membership (evidence: `hub/src/channels.ts`)
- Agent launcher → SQLite state: loads configurations (evidence: `hub/src/launcher.ts`)
- Human operator → ON-AIR dashboard: manages agents (evidence: `README.md`)
- ON-AIR dashboard → HTTP Hub: uses Hub operations (evidence: `hub/src/server.ts`)
- Slack user → Slack bridge: messages bot (evidence: `README.md`)
- Slack bridge → HTTP Hub: bridges conversations (evidence: `README.md`)
