# chattermate/chattermate.chat architecture

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

- Interactive diagram: https://gitdiagram.com/chattermate/chattermate.chat
- Repository: https://github.com/chattermate/chattermate.chat

## Overview

ChatterMate is an omnichannel AI customer-support platform with a shared inbox and human handoff. A visitor starts a conversation through the web widget or a connected channel; the platform uses an AI agent and configured knowledge to answer, while supporting escalation to human agents. The product also includes knowledge ingestion, journeys, lead capture, AI ticketing, and an AI-generated help center. The graph combines documented capabilities with router registration visible in the sampled backend entry point; several runtime links are dashed where implementation details were not sampled.

Main entry points: [`backend/app/agents/chat_agent.py`](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/agents/chat_agent.py) (AI agent), [`backend/app/api/widget_chat.py`](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/api/widget_chat.py) (Widget chat API), [`frontend/src/webclient`](https://github.com/chattermate/chattermate.chat/tree/main/frontend/src/webclient) (Web widget), [`backend/app/api/channels`](https://github.com/chattermate/chattermate.chat/tree/main/backend/app/api/channels) (Channel endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Customer entry"]
  node_widget["Web widget"]
  node_channel_routes["Channel endpoints"]
  node_webhooks["Channel webhooks"]
  node_chat_api["Widget chat API<br/>[widget_chat.py]"]
  node_channel_runtime["Channel adapters"]
end

subgraph group_support["AI support"]
  node_agent["AI agent<br/>[chat_agent.py]"]
  node_mcp["MCP tools<br/>[mcp_manager.py]"]
  node_database[("Application database<br/>[database.py]")]
end

subgraph group_operations["Support operations"]
  node_human_inbox["Human handoff inbox<br/>[chat.py]"]
  node_journeys["Customer journeys<br/>[journey_engine.py]"]
  node_lead_capture["Lead capture<br/>[lead_capture.py]"]
  node_tickets["AI ticketing"]
  node_ticket_alerts["Ticket alert intake<br/>[ticket_webhooks.py]"]
  node_crm["CRM integrations<br/>[registry.py]"]
end

subgraph group_knowledge["Knowledge and help center"]
  node_knowledge_search["Knowledge search"]
  node_knowledge_ingest["Knowledge ingestion"]
  node_faq["AI help center"]
end

node_customer(("Customer"))

node_customer -->|"starts chat"| node_widget
node_customer -->|"messages via"| node_channel_routes
node_channel_routes -.->|"uses adapters"| node_channel_runtime
node_webhooks -.->|"dispatches to"| node_channel_runtime
node_widget -.->|"sends messages"| node_chat_api
node_chat_api -.->|"invokes"| node_agent
node_agent -->|"answers from"| node_knowledge_search
node_agent -->|"calls tools"| node_mcp
node_agent -->|"hands off"| node_human_inbox
node_agent -->|"qualifies leads"| node_lead_capture
node_agent -.->|"runs journeys"| node_journeys
node_agent -->|"investigates tickets"| node_tickets
node_ticket_alerts -->|"creates tickets"| node_tickets
node_knowledge_ingest -.->|"prepares sources"| node_knowledge_search
node_faq -->|"generates content"| node_knowledge_ingest
node_agent -->|"syncs contacts"| node_crm
node_chat_api -.->|"persists chat"| node_database
node_human_inbox -.->|"stores conversations"| node_database

click node_widget "https://github.com/chattermate/chattermate.chat/tree/main/frontend/src/webclient"
click node_channel_routes "https://github.com/chattermate/chattermate.chat/tree/main/backend/app/api/channels"
click node_webhooks "https://github.com/chattermate/chattermate.chat/tree/main/backend/app/api/webhooks"
click node_chat_api "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/api/widget_chat.py"
click node_channel_runtime "https://github.com/chattermate/chattermate.chat/tree/main/backend/app/channels"
click node_agent "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/agents/chat_agent.py"
click node_knowledge_search "https://github.com/chattermate/chattermate.chat/tree/main/backend/app/knowledge"
click node_mcp "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/tools/mcp_manager.py"
click node_human_inbox "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/api/chat.py"
click node_journeys "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/services/journey_engine.py"
click node_lead_capture "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/services/lead_capture.py"
click node_tickets "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/services/ticket_investigation.py"
click node_ticket_alerts "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/api/ticket_webhooks.py"
click node_crm "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/crm/registry.py"
click node_knowledge_ingest "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/workers/knowledge_processor.py"
click node_faq "https://github.com/chattermate/chattermate.chat/tree/main/backend/app/api/help_center"
click node_database "https://github.com/chattermate/chattermate.chat/blob/main/backend/app/database.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_widget,node_channel_routes,node_webhooks,node_chat_api,node_channel_runtime toneBlue
class node_agent,node_mcp,node_database toneAmber
class node_human_inbox,node_journeys,node_lead_capture,node_tickets,node_ticket_alerts,node_crm toneMint
class node_knowledge_search,node_knowledge_ingest,node_faq toneRose
class node_customer toneIndigo
```

## Components

### Customer entry

- [Web widget](https://github.com/chattermate/chattermate.chat/tree/main/frontend/src/webclient): `frontend/src/webclient`
- [Channel endpoints](https://github.com/chattermate/chattermate.chat/tree/main/backend/app/api/channels): `backend/app/api/channels`
- [Channel webhooks](https://github.com/chattermate/chattermate.chat/tree/main/backend/app/api/webhooks): `backend/app/api/webhooks`
- [Widget chat API](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/api/widget_chat.py): `backend/app/api/widget_chat.py`
- [Channel adapters](https://github.com/chattermate/chattermate.chat/tree/main/backend/app/channels): `backend/app/channels`

### AI support

- [AI agent](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/agents/chat_agent.py): `backend/app/agents/chat_agent.py`
- [MCP tools](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/tools/mcp_manager.py): `backend/app/tools/mcp_manager.py`
- [Application database](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/database.py): `backend/app/database.py`

### Support operations

- [Human handoff inbox](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [Customer journeys](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/services/journey_engine.py): `backend/app/services/journey_engine.py`
- [Lead capture](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/services/lead_capture.py): `backend/app/services/lead_capture.py`
- [AI ticketing](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/services/ticket_investigation.py): `backend/app/services/ticket_investigation.py`
- [Ticket alert intake](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/api/ticket_webhooks.py): `backend/app/api/ticket_webhooks.py`
- [CRM integrations](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/crm/registry.py): `backend/app/crm/registry.py`

### Knowledge and help center

- [Knowledge search](https://github.com/chattermate/chattermate.chat/tree/main/backend/app/knowledge): `backend/app/knowledge`
- [Knowledge ingestion](https://github.com/chattermate/chattermate.chat/blob/main/backend/app/workers/knowledge_processor.py): `backend/app/workers/knowledge_processor.py`
- [AI help center](https://github.com/chattermate/chattermate.chat/tree/main/backend/app/api/help_center): `backend/app/api/help_center`

### Other components

- **Customer**

## Connections

- Customer → Web widget: starts chat (evidence: `README.md`)
- Customer → Channel endpoints: messages via (evidence: `README.md`)
- Channel endpoints → Channel adapters: uses adapters
- Channel webhooks → Channel adapters: dispatches to
- Web widget → Widget chat API: sends messages
- Widget chat API → AI agent: invokes
- AI agent → Knowledge search: answers from (evidence: `README.md`)
- AI agent → MCP tools: calls tools (evidence: `README.md`)
- AI agent → Human handoff inbox: hands off (evidence: `README.md`)
- AI agent → Lead capture: qualifies leads (evidence: `README.md`)
- AI agent → Customer journeys: runs journeys
- AI agent → AI ticketing: investigates tickets (evidence: `README.md`)
- Ticket alert intake → AI ticketing: creates tickets (evidence: `backend/app/api/ticket_webhooks.py`)
- Knowledge ingestion → Knowledge search: prepares sources
- AI help center → Knowledge ingestion: generates content (evidence: `README.md`)
- AI agent → CRM integrations: syncs contacts (evidence: `README.md`)
- Widget chat API → Application database: persists chat
- Human handoff inbox → Application database: stores conversations (evidence: `backend/app/api/chat.py`)
