# jake-edwards-ei/agentchattr architecture

> Architecture diagram of the GitHub repository jake-edwards-ei/agentchattr, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jake-edwards-ei/agentchattr
- Repository: https://github.com/jake-edwards-ei/agentchattr

## Overview

agentchattr is a local multi-agent chat server: people and agents share persistent channels, and @mentions wake terminal agents so they can read context and respond. The core loop runs from browser or MCP message entry through routing, wrapper dispatch, and agent replies; the loop guard limits agent-to-agent hops. Jobs, roles/rules, schedules, archives, and structured multi-agent sessions extend that collaboration workflow. The README documents these capabilities, but sampled source does not establish every subsystem’s internal wiring, so those links are shown conservatively.

Main entry points: [`app.py`](https://github.com/jake-edwards-ei/agentchattr/blob/main/app.py) (Web Server), [`wrapper.py`](https://github.com/jake-edwards-ei/agentchattr/blob/main/wrapper.py) (Agent Wrappers), [`mcp_bridge.py`](https://github.com/jake-edwards-ei/agentchattr/blob/main/mcp_bridge.py) (MCP Tools), [`session_engine.py`](https://github.com/jake-edwards-ei/agentchattr/blob/main/session_engine.py) (Session Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Chat Interaction"]
  node_browser["Chat UI<br/>[chat.js]"]
  node_channels_ui["Channels UI<br/>[channels.js]"]
  node_web_server["Web Server<br/>[app.py]"]
  node_sessions_ui["Sessions UI<br/>[sessions.js]"]
end

subgraph group_coordination["Agent Coordination"]
  node_router["Mention Router<br/>[router.py]"]
  node_agent_registry["Agent Registry<br/>[registry.py]"]
  node_agent_wrappers["Agent Wrappers<br/>[wrapper.py]"]
  node_mcp_tools["MCP Tools<br/>[mcp_bridge.py]"]
  node_mcp_proxy["MCP Proxy<br/>[mcp_proxy.py]"]
end

subgraph group_workflows["Work Management"]
  node_jobs["Jobs<br/>[jobs.py]"]
  node_schedules["Schedules<br/>[schedules.py]"]
  node_rules["Rules<br/>[rules.py]"]
  node_archive["Chat Archive<br/>[archive.py]"]
  node_summaries["Summaries<br/>[summaries.py]"]
  node_session_engine["Session Engine<br/>[session_engine.py]"]
end

subgraph group_persistence["Persistence"]
  node_chat_store[("Chat Store<br/>[store.py]")]
  node_session_store[("Session Store<br/>[session_store.py]")]
  node_templates["Session Templates"]
  node_config["Configuration<br/>[config_loader.py]"]
end

node_human(("Human"))
node_agents(("Coding Agents"))
node_agent_processes(("Agent Terminals"))

node_human -->|"sends messages"| node_browser
node_browser -->|"WebSocket events"| node_web_server
node_channels_ui -->|"channel commands"| node_web_server
node_web_server -->|"stores messages"| node_chat_store
node_web_server -->|"routes mentions"| node_router
node_web_server -->|"checks agents"| node_agent_registry
node_web_server -->|"triggers agents"| node_agent_wrappers
node_agent_wrappers -->|"injects prompts"| node_agent_processes
node_agent_processes -->|"runs CLI"| node_agents
node_agents -->|"calls tools"| node_mcp_tools
node_mcp_tools -->|"reads and writes"| node_chat_store
node_mcp_tools -->|"updates jobs"| node_jobs
node_mcp_proxy -.->|"proxies MCP"| node_mcp_tools
node_web_server -->|"handles job requests"| node_jobs
node_web_server -->|"handles schedule requests"| node_schedules
node_web_server -->|"handles rule requests"| node_rules
node_web_server -->|"handles archive requests"| node_archive
node_web_server -->|"creates summaries"| node_summaries
node_sessions_ui -->|"session requests"| node_web_server
node_web_server -->|"coordinates sessions"| node_session_engine
node_session_engine -->|"updates runs"| node_session_store
node_session_engine -->|"observes messages"| node_chat_store
node_session_store -->|"loads templates"| node_templates
node_web_server -->|"loads settings"| node_config
node_web_server -->|"WebSocket updates"| node_browser
node_web_server -->|"routes selected agents"| node_agent_wrappers
node_agent_wrappers -->|"agent replies"| node_web_server
node_router -->|"selects targets"| node_agent_wrappers

click node_browser "https://github.com/jake-edwards-ei/agentchattr/blob/main/static/chat.js"
click node_channels_ui "https://github.com/jake-edwards-ei/agentchattr/blob/main/static/channels.js"
click node_web_server "https://github.com/jake-edwards-ei/agentchattr/blob/main/app.py"
click node_chat_store "https://github.com/jake-edwards-ei/agentchattr/blob/main/store.py"
click node_router "https://github.com/jake-edwards-ei/agentchattr/blob/main/router.py"
click node_agent_registry "https://github.com/jake-edwards-ei/agentchattr/blob/main/registry.py"
click node_agent_wrappers "https://github.com/jake-edwards-ei/agentchattr/blob/main/wrapper.py"
click node_mcp_tools "https://github.com/jake-edwards-ei/agentchattr/blob/main/mcp_bridge.py"
click node_mcp_proxy "https://github.com/jake-edwards-ei/agentchattr/blob/main/mcp_proxy.py"
click node_jobs "https://github.com/jake-edwards-ei/agentchattr/blob/main/jobs.py"
click node_schedules "https://github.com/jake-edwards-ei/agentchattr/blob/main/schedules.py"
click node_rules "https://github.com/jake-edwards-ei/agentchattr/blob/main/rules.py"
click node_archive "https://github.com/jake-edwards-ei/agentchattr/blob/main/archive.py"
click node_summaries "https://github.com/jake-edwards-ei/agentchattr/blob/main/summaries.py"
click node_sessions_ui "https://github.com/jake-edwards-ei/agentchattr/blob/main/static/sessions.js"
click node_session_engine "https://github.com/jake-edwards-ei/agentchattr/blob/main/session_engine.py"
click node_session_store "https://github.com/jake-edwards-ei/agentchattr/blob/main/session_store.py"
click node_templates "https://github.com/jake-edwards-ei/agentchattr/tree/main/session_templates"
click node_config "https://github.com/jake-edwards-ei/agentchattr/blob/main/config_loader.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_browser,node_channels_ui,node_web_server,node_sessions_ui toneBlue
class node_router,node_agent_registry,node_agent_wrappers,node_mcp_tools,node_mcp_proxy toneAmber
class node_jobs,node_schedules,node_rules,node_archive,node_summaries,node_session_engine toneMint
class node_chat_store,node_session_store,node_templates,node_config toneRose
class node_human,node_agents,node_agent_processes toneIndigo
```

## Components

### Chat Interaction

- [Chat UI](https://github.com/jake-edwards-ei/agentchattr/blob/main/static/chat.js): `static/chat.js`
- [Channels UI](https://github.com/jake-edwards-ei/agentchattr/blob/main/static/channels.js): `static/channels.js`
- [Web Server](https://github.com/jake-edwards-ei/agentchattr/blob/main/app.py): `app.py`
- [Sessions UI](https://github.com/jake-edwards-ei/agentchattr/blob/main/static/sessions.js): `static/sessions.js`

### Agent Coordination

- [Mention Router](https://github.com/jake-edwards-ei/agentchattr/blob/main/router.py): `router.py`
- [Agent Registry](https://github.com/jake-edwards-ei/agentchattr/blob/main/registry.py): `registry.py`
- [Agent Wrappers](https://github.com/jake-edwards-ei/agentchattr/blob/main/wrapper.py): `wrapper.py`
- [MCP Tools](https://github.com/jake-edwards-ei/agentchattr/blob/main/mcp_bridge.py): `mcp_bridge.py`
- [MCP Proxy](https://github.com/jake-edwards-ei/agentchattr/blob/main/mcp_proxy.py): `mcp_proxy.py`

### Work Management

- [Jobs](https://github.com/jake-edwards-ei/agentchattr/blob/main/jobs.py): `jobs.py`
- [Schedules](https://github.com/jake-edwards-ei/agentchattr/blob/main/schedules.py): `schedules.py`
- [Rules](https://github.com/jake-edwards-ei/agentchattr/blob/main/rules.py): `rules.py`
- [Chat Archive](https://github.com/jake-edwards-ei/agentchattr/blob/main/archive.py): `archive.py`
- [Summaries](https://github.com/jake-edwards-ei/agentchattr/blob/main/summaries.py): `summaries.py`
- [Session Engine](https://github.com/jake-edwards-ei/agentchattr/blob/main/session_engine.py): `session_engine.py`

### Persistence

- [Chat Store](https://github.com/jake-edwards-ei/agentchattr/blob/main/store.py): `store.py`
- [Session Store](https://github.com/jake-edwards-ei/agentchattr/blob/main/session_store.py): `session_store.py`
- [Session Templates](https://github.com/jake-edwards-ei/agentchattr/tree/main/session_templates): `session_templates`
- [Configuration](https://github.com/jake-edwards-ei/agentchattr/blob/main/config_loader.py): `config_loader.py`

### Other components

- **Human**
- **Coding Agents**
- **Agent Terminals**

## Connections

- Human → Chat UI: sends messages
- Chat UI → Web Server: WebSocket events
- Channels UI → Web Server: channel commands
- Web Server → Chat Store: stores messages
- Web Server → Mention Router: routes mentions
- Web Server → Agent Registry: checks agents
- Web Server → Agent Wrappers: triggers agents
- Agent Wrappers → Agent Terminals: injects prompts
- Agent Terminals → Coding Agents: runs CLI
- Coding Agents → MCP Tools: calls tools
- MCP Tools → Chat Store: reads and writes
- MCP Tools → Jobs: updates jobs
- MCP Proxy → MCP Tools: proxies MCP
- Web Server → Jobs: handles job requests
- Web Server → Schedules: handles schedule requests
- Web Server → Rules: handles rule requests
- Web Server → Chat Archive: handles archive requests
- Web Server → Summaries: creates summaries
- Sessions UI → Web Server: session requests
- Web Server → Session Engine: coordinates sessions
- Session Engine → Session Store: updates runs
- Session Engine → Chat Store: observes messages
- Session Store → Session Templates: loads templates
- Web Server → Configuration: loads settings
- Web Server → Chat UI: WebSocket updates
- Web Server → Agent Wrappers: routes selected agents
- Agent Wrappers → Web Server: agent replies
- Mention Router → Agent Wrappers: selects targets
