Skip to content

Commit bc1ae3d

Browse files
Replace ASCII diagrams with Mermaid
- Add @docusaurus/theme-mermaid plugin - Convert architecture overview diagram to Mermaid graph - Convert heartbeat cycle to Mermaid flowchart with decision diamond - Convert gateway lifecycle to Mermaid LR flowchart - Convert core concepts overview diagram to Mermaid graph
1 parent ff4e007 commit bc1ae3d

7 files changed

Lines changed: 1431 additions & 177 deletions

File tree

‎docs/architecture/gateway.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ openclaw gateway stop
7373

7474
## Process Lifecycle
7575

76-
```
77-
Boot → Load Config → Initialize Memory
78-
→ Start WebSocket Server
79-
→ Connect Channels
80-
→ Register Skills
81-
→ Start Heartbeat Timer
82-
→ Ready (accepting connections)
76+
```mermaid
77+
flowchart LR
78+
Boot["🔄 Boot"] --> Config["Load Config"]
79+
Config --> Memory["Initialize\nMemory"]
80+
Memory --> WS["Start WebSocket\nServer"]
81+
WS --> Chan["Connect\nChannels"]
82+
Chan --> Skills["Register\nSkills"]
83+
Skills --> HB["Start Heartbeat\nTimer"]
84+
HB --> Ready["✅ Ready\n(accepting connections)"]
8385
```
8486

8587
On shutdown, the Gateway:

‎docs/architecture/heartbeat.md‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@ The Heartbeat is what transforms OpenClaw from a reactive chatbot into a **proac
1212

1313
Every N minutes (default: 30), the Gateway triggers a heartbeat cycle:
1414

15-
```
16-
┌─────────────────────────────────────┐
17-
│ Heartbeat Cycle │
18-
│ │
19-
│ 1. Timer fires (every 30 min) │
20-
│ 2. Gateway sends heartbeat prompt │
21-
│ 3. Agent reads HEARTBEAT.md │
22-
│ 4. Agent checks pending tasks │
23-
│ 5. Agent checks channel queues │
24-
│ 6. Decision: │
25-
│ ├─ Nothing to do → HEARTBEAT_OK │
26-
│ └─ Task found → Execute + report │
27-
│ 7. Timer resets │
28-
│ │
29-
└─────────────────────────────────────┘
15+
```mermaid
16+
flowchart TD
17+
Timer["⏱️ Timer fires\n(every 30 min)"] --> Prompt["Gateway sends\nheartbeat prompt"]
18+
Prompt --> ReadHB["Agent reads\nHEARTBEAT.md"]
19+
ReadHB --> CheckTasks["Check pending tasks"]
20+
CheckTasks --> CheckQueues["Check channel queues"]
21+
CheckQueues --> Decision{"Anything\nto do?"}
22+
Decision -- No --> OK["HEARTBEAT_OK\n(go back to sleep)"]
23+
Decision -- Yes --> Execute["Execute task\n& report to user"]
24+
OK --> Reset["Timer resets"]
25+
Execute --> Reset
26+
Reset -.-> Timer
3027
```
3128

3229
## Defining Heartbeat Tasks

‎docs/architecture/overview.md‎

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,27 @@ OpenClaw uses a **Gateway-centric architecture** where a single long-running pro
1010

1111
## High-Level Architecture
1212

13-
```
14-
┌─────────────┐
15-
│ Channels │
16-
│ (WhatsApp, │
17-
│ Telegram, │
18-
│ Discord...) │
19-
└──────┬──────┘
20-
│
21-
▼
22-
┌──────────────────────────────────────────────┐
23-
│ Gateway │
24-
│ (ws://localhost:18789) │
25-
│ │
26-
│ ┌──────────┐ ┌──────────┐ ┌────────────┐ │
27-
│ │ Router │ │ Heartbeat│ │ Skill │ │
28-
│ │ │ │ Timer │ │ Registry │ │
29-
│ └────┬─────┘ └────┬─────┘ └─────┬──────┘ │
30-
│ │ │ │ │
31-
│ └──────────────┼──────────────┘ │
32-
│ │ │
33-
│ ┌───────┴────────┐ │
34-
│ │ Orchestrator │ │
35-
│ └───────┬────────┘ │
36-
│ │ │
37-
│ ┌────────────┼────────────┐ │
38-
│ ▼ ▼ ▼ │
39-
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
40-
│ │ Brain │ │ Hands │ │ Memory │ │
41-
│ │ (LLM) │ │ (Exec) │ │ (Local) │ │
42-
│ └──────────┘ └──────────┘ └──────────┘ │
43-
└──────────────────────────────────────────────┘
13+
```mermaid
14+
graph TD
15+
Channels["🔗 Channels\n(WhatsApp, Telegram, Discord...)"]
16+
17+
subgraph Gateway["⚡ Gateway (ws://localhost:18789)"]
18+
Router["Router"]
19+
Heartbeat["Heartbeat\nTimer"]
20+
SkillReg["Skill\nRegistry"]
21+
Orchestrator["Orchestrator"]
22+
Brain["🧠 Brain\n(LLM)"]
23+
Hands["🤖 Hands\n(Exec)"]
24+
Memory["💾 Memory\n(Local)"]
25+
end
26+
27+
Channels --> Router
28+
Router --> Orchestrator
29+
Heartbeat --> Orchestrator
30+
SkillReg --> Orchestrator
31+
Orchestrator --> Brain
32+
Orchestrator --> Hands
33+
Orchestrator --> Memory
4434
```
4535

4636
## Component Summary

‎docs/getting-started/core-concepts.md‎

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,28 +85,18 @@ This enables proactive behaviors like:
8585

8686
## How They Fit Together
8787

88-
```
89-
┌─────────────────────────────────────────────┐
90-
│ Gateway │
91-
│ ┌─────────┐ ┌─────────┐ ┌─────────────┐ │
92-
│ │ Brain │ │ Hands │ │ Heartbeat │ │
93-
│ │ (LLM) │←→│ (Shell, │ │ (30m loop) │ │
94-
│ │ │ │ Files, │ │ │ │
95-
│ └────┬────┘ │ Browser) │ └──────┬──────┘ │
96-
│ │ └─────────┘ │ │
97-
│ └───────────┬───────────────┘ │
98-
│ │ │
99-
│ ┌────────────────┴─────────────────┐ │
100-
│ │ Memory │ │
101-
│ │ (~/.openclaw/memory/*.md) │ │
102-
│ └──────────────────────────────────┘ │
103-
│ │
104-
│ ┌──────────────────────────────────┐ │
105-
│ │ Channels │ │
106-
│ │ WhatsApp │ Telegram │ Discord │ │
107-
│ │ Slack │ Signal │ WebChat │ │
108-
│ └──────────────────────────────────┘ │
109-
└─────────────────────────────────────────────┘
88+
```mermaid
89+
graph TD
90+
subgraph Gateway["⚡ Gateway"]
91+
Brain["🧠 Brain\n(LLM)"]
92+
Hands["🤖 Hands\n(Shell, Files, Browser)"]
93+
HB["⏱️ Heartbeat\n(30m loop)"]
94+
Brain <--> Hands
95+
Brain --- Memory["💾 Memory\n(~/.openclaw/memory/*.md)"]
96+
HB --- Memory
97+
end
98+
99+
Channels["🔗 Channels\nWhatsApp · Telegram · Discord\nSlack · Signal · WebChat"] --> Gateway
110100
```
111101

112102
## Skills

‎docusaurus.config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ const config: Config = {
1818
v4: true,
1919
},
2020

21+
markdown: {
22+
mermaid: true,
23+
},
24+
25+
themes: ['@docusaurus/theme-mermaid'],
26+
2127
i18n: {
2228
defaultLocale: 'en',
2329
locales: ['en'],

0 commit comments

Comments
 (0)