# mateaix/mateclaw architecture

> Architecture diagram of the GitHub repository mateaix/mateclaw, 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/mateaix/mateclaw
- Repository: https://github.com/mateaix/mateclaw

## Overview

MateClaw is a multi-surface, Spring Boot agent product: users interact through the web console, desktop, embedded webchat, or messaging channels; server-side agents run turns, use configured models and tools, and produce conversation and knowledge results. The README documents native and DSH runtimes, durable Goals, Team Runs, approvals, memory, Wiki, and integrations. Source excerpts are selective, so unsampled subsystem links below rely only on those README descriptions; this is a product map, not a complete call graph.

Main entry points: [`mateclaw-server/src/main/java/vip/mate/agent/AgentService.java`](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/AgentService.java) (Agent orchestration), [`mateclaw-ui/src/App.vue`](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-ui/src/App.vue) (Web console), [`mateclaw-server/src/main/java/vip/mate/llm/service/ModelProviderService.java`](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/llm/service/ModelProviderService.java) (Model providers), [`mateclaw-server/src/main/java/vip/mate/wiki`](https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/wiki) (LLM Wiki)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surfaces["User surfaces"]
  node_console["Web console<br/>[App.vue]"]
  node_desktop["Desktop app<br/>[App.vue]"]
  node_webchat["Webchat widget<br/>[index.ts]"]
  node_channels["IM channels"]
end

subgraph group_runtime["Agent execution"]
  node_agent["Agent orchestration<br/>[AgentService.java]"]
  node_native["Native graph runtime"]
  node_dsh["DSH runtime"]
  node_team["Team Runs"]
  node_goals["Persistent Goals"]
  node_models["Model providers"]
  node_conversation[("Conversations")]
  node_tools["Tool execution"]
end

subgraph group_knowledge["Knowledge and memory"]
  node_wiki["LLM Wiki"]
  node_wiki_pipeline["Wiki pipelines"]
  node_memory[("Memory and search")]
end

subgraph group_governance["Security and governance"]
  node_approval["Tool approvals"]
  node_audit["Audit and evidence"]
  node_auth["Authentication<br/>[AuthService.java]"]
end

subgraph group_extensions["Integrations"]
  node_plugin_api["Plugin API"]
  node_mem0["Mem0 plugin<br/>[Mem0Plugin.java]"]
end

node_user(("User"))

node_user -->|"uses"| node_console
node_user -->|"uses"| node_desktop
node_user -->|"uses"| node_webchat
node_user -->|"messages through"| node_channels
node_console -->|"configures and invokes"| node_agent
node_desktop -->|"accesses"| node_agent
node_webchat -->|"accesses"| node_agent
node_channels -->|"routes messages"| node_agent
node_agent -->|"runs natively"| node_native
node_agent -->|"runs externally"| node_dsh
node_agent -->|"coordinates"| node_team
node_agent -->|"continues goals"| node_goals
node_native -->|"requests inference"| node_models
node_dsh -->|"uses configured models"| node_models
node_agent -->|"dispatches tools"| node_tools
node_agent -->|"persists turns"| node_conversation
node_agent -->|"uses memory"| node_memory
node_agent -->|"gates actions"| node_approval
node_agent -->|"records execution evidence"| node_audit
node_console -.->|"authenticates"| node_auth
node_wiki -->|"processes material"| node_wiki_pipeline
node_wiki -->|"creates embeddings"| node_models
node_plugin_api -.->|"implements extension"| node_mem0

click node_console "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-ui/src/App.vue"
click node_desktop "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-desktop/src/App.vue"
click node_webchat "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-webchat/src/index.ts"
click node_channels "https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/channel"
click node_agent "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/AgentService.java"
click node_native "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/graph/StateGraphReActAgent.java"
click node_dsh "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/runtime/dsh/DshRuntimeService.java"
click node_team "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/team/service/TeamTaskService.java"
click node_goals "https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/agent/graph"
click node_models "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/llm/service/ModelProviderService.java"
click node_conversation "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/workspace/conversation/ConversationService.java"
click node_tools "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/graph/executor/ToolResultStorage.java"
click node_wiki "https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/wiki"
click node_wiki_pipeline "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/wiki/pipeline/WikiPipelineService.java"
click node_memory "https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/memory"
click node_approval "https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/approval"
click node_audit "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/execution/evidence/service/ExecutionEvidenceQueryService.java"
click node_auth "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/auth/service/AuthService.java"
click node_plugin_api "https://github.com/mateaix/mateclaw/tree/dev/mateclaw-plugin-api/src/main/java/vip/mate/plugin/api"
click node_mem0 "https://github.com/mateaix/mateclaw/blob/dev/mateclaw-plugin-mem0/src/main/java/vip/mate/plugin/mem0/Mem0Plugin.java"

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_console,node_desktop,node_webchat,node_channels,node_user toneBlue
class node_agent,node_native,node_dsh,node_team,node_goals,node_models,node_conversation,node_tools toneAmber
class node_wiki,node_wiki_pipeline,node_memory toneMint
class node_approval,node_audit,node_auth toneRose
class node_plugin_api,node_mem0 toneIndigo
```

## Components

### User surfaces

- [Web console](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-ui/src/App.vue): `mateclaw-ui/src/App.vue`
- [Desktop app](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-desktop/src/App.vue): `mateclaw-desktop/src/App.vue`
- [Webchat widget](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-webchat/src/index.ts): `mateclaw-webchat/src/index.ts`
- [IM channels](https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/channel): `mateclaw-server/src/main/java/vip/mate/channel`

### Agent execution

- [Agent orchestration](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/AgentService.java): `mateclaw-server/src/main/java/vip/mate/agent/AgentService.java`
- [Native graph runtime](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/graph/StateGraphReActAgent.java): `mateclaw-server/src/main/java/vip/mate/agent/graph/StateGraphReActAgent.java`
- [DSH runtime](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/runtime/dsh/DshRuntimeService.java): `mateclaw-server/src/main/java/vip/mate/agent/runtime/dsh/DshRuntimeService.java`
- [Team Runs](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/team/service/TeamTaskService.java): `mateclaw-server/src/main/java/vip/mate/team/service/TeamTaskService.java`
- [Persistent Goals](https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/agent/graph): `mateclaw-server/src/main/java/vip/mate/agent/graph`
- [Model providers](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/llm/service/ModelProviderService.java): `mateclaw-server/src/main/java/vip/mate/llm/service/ModelProviderService.java`
- [Conversations](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/workspace/conversation/ConversationService.java): `mateclaw-server/src/main/java/vip/mate/workspace/conversation/ConversationService.java`
- [Tool execution](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/agent/graph/executor/ToolResultStorage.java): `mateclaw-server/src/main/java/vip/mate/agent/graph/executor/ToolResultStorage.java`

### Knowledge and memory

- [LLM Wiki](https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/wiki): `mateclaw-server/src/main/java/vip/mate/wiki`
- [Wiki pipelines](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/wiki/pipeline/WikiPipelineService.java): `mateclaw-server/src/main/java/vip/mate/wiki/pipeline/WikiPipelineService.java`
- [Memory and search](https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/memory): `mateclaw-server/src/main/java/vip/mate/memory`

### Security and governance

- [Tool approvals](https://github.com/mateaix/mateclaw/tree/dev/mateclaw-server/src/main/java/vip/mate/approval): `mateclaw-server/src/main/java/vip/mate/approval`
- [Audit and evidence](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/execution/evidence/service/ExecutionEvidenceQueryService.java): `mateclaw-server/src/main/java/vip/mate/execution/evidence/service/ExecutionEvidenceQueryService.java`
- [Authentication](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-server/src/main/java/vip/mate/auth/service/AuthService.java): `mateclaw-server/src/main/java/vip/mate/auth/service/AuthService.java`

### Integrations

- [Plugin API](https://github.com/mateaix/mateclaw/tree/dev/mateclaw-plugin-api/src/main/java/vip/mate/plugin/api): `mateclaw-plugin-api/src/main/java/vip/mate/plugin/api`
- [Mem0 plugin](https://github.com/mateaix/mateclaw/blob/dev/mateclaw-plugin-mem0/src/main/java/vip/mate/plugin/mem0/Mem0Plugin.java): `mateclaw-plugin-mem0/src/main/java/vip/mate/plugin/mem0/Mem0Plugin.java`

### Other components

- **User**

## Connections

- User → Web console: uses (evidence: `README.md`)
- User → Desktop app: uses (evidence: `README.md`)
- User → Webchat widget: uses (evidence: `README.md`)
- User → IM channels: messages through (evidence: `README.md`)
- Web console → Agent orchestration: configures and invokes (evidence: `README.md`)
- Desktop app → Agent orchestration: accesses (evidence: `README.md`)
- Webchat widget → Agent orchestration: accesses (evidence: `README.md`)
- IM channels → Agent orchestration: routes messages (evidence: `README.md`)
- Agent orchestration → Native graph runtime: runs natively (evidence: `README.md`)
- Agent orchestration → DSH runtime: runs externally (evidence: `README.md`)
- Agent orchestration → Team Runs: coordinates (evidence: `README.md`)
- Agent orchestration → Persistent Goals: continues goals (evidence: `README.md`)
- Native graph runtime → Model providers: requests inference (evidence: `README.md`)
- DSH runtime → Model providers: uses configured models (evidence: `README.md`)
- Agent orchestration → Tool execution: dispatches tools (evidence: `README.md`)
- Agent orchestration → Conversations: persists turns (evidence: `README.md`)
- Agent orchestration → Memory and search: uses memory (evidence: `README.md`)
- Agent orchestration → Tool approvals: gates actions (evidence: `README.md`)
- Agent orchestration → Audit and evidence: records execution evidence (evidence: `README.md`)
- Web console → Authentication: authenticates
- LLM Wiki → Wiki pipelines: processes material (evidence: `mateclaw-server/src/main/java/vip/mate/wiki/pipeline/WikiPipelineService.java`)
- LLM Wiki → Model providers: creates embeddings (evidence: `mateclaw-server/src/main/java/vip/mate/wiki/service/WikiEmbeddingService.java`)
- Plugin API → Mem0 plugin: implements extension
