|
1 | 1 | # KafClaw Architecture — Overview |
2 | 2 |
|
| 3 | +{% include topnav.html %} |
| 4 | + |
3 | 5 | A quick reference for the KafClaw system architecture. For the comprehensive deep-dive, see [architecture-detailed.md](./architecture-detailed.md). |
4 | 6 |
|
5 | 7 | > See also: [FR-009 System Architecture](../requirements/FR-009-system-architecture.md), [FR-013 Package Design](../requirements/FR-013-package-design.md) |
@@ -52,25 +54,56 @@ LLM abstraction supporting OpenAI-compatible APIs: |
52 | 54 |
|
53 | 55 | ## System Diagram |
54 | 56 |
|
55 | | -``` |
56 | | -WhatsApp ---+ |
57 | | -CLI --------+ +-- Filesystem Tools |
58 | | -Web UI -----+-- Message Bus -- Agent Loop -- LLM +-- Shell Execution |
59 | | -Scheduler --+ | | +-- Web Search |
60 | | - | | +-- Memory (remember/recall) |
61 | | - | Context Builder |
62 | | - | +-- Soul Files (AGENTS.md, SOUL.md, ...) |
63 | | - | +-- Working Memory (per-user scratchpad) |
64 | | - | +-- Observations (compressed history) |
65 | | - | +-- RAG Injection (vector search) |
66 | | - | +-- Tool + Skill definitions |
67 | | - | |
68 | | - Timeline DB (SQLite) |
69 | | - +-- Event log |
70 | | - +-- Memory chunks (embeddings) |
71 | | - +-- Settings, tasks, approvals |
72 | | - +-- Group roster, skill channels |
73 | | - +-- Orchestrator hierarchy |
| 57 | +<div style="overflow:auto;border:1px solid #d4dcec;border-radius:10px;padding:10px;background:#fbfdff;"> |
| 58 | + <svg viewBox="0 0 1120 360" role="img" aria-label="KafClaw system diagram" style="min-width:900px;max-width:100%;height:auto;"> |
| 59 | + <defs> |
| 60 | + <marker id="arrowA" markerWidth="9" markerHeight="7" refX="8" refY="3.5" orient="auto"> |
| 61 | + <polygon points="0 0, 9 3.5, 0 7" fill="#2e5cab"></polygon> |
| 62 | + </marker> |
| 63 | + </defs> |
| 64 | + <rect x="410" y="40" width="300" height="64" rx="10" fill="#eaf1ff" stroke="#9bb5e6"></rect> |
| 65 | + <text x="560" y="65" text-anchor="middle" font-size="18" font-weight="700" fill="#1f3f84">Message Bus</text> |
| 66 | + <text x="560" y="84" text-anchor="middle" font-size="12" fill="#355d9c">Inbound / Outbound decoupling</text> |
| 67 | + |
| 68 | + <rect x="410" y="130" width="300" height="70" rx="10" fill="#ffffff" stroke="#d4dcec"></rect> |
| 69 | + <text x="560" y="157" text-anchor="middle" font-size="16" font-weight="700" fill="#24344d">Agent Loop</text> |
| 70 | + <text x="560" y="176" text-anchor="middle" font-size="12" fill="#4e5c73">LLM orchestration + tool loop</text> |
| 71 | + |
| 72 | + <rect x="120" y="48" width="190" height="140" rx="10" fill="#ffffff" stroke="#d4dcec"></rect> |
| 73 | + <text x="215" y="72" text-anchor="middle" font-size="14" font-weight="700" fill="#24344d">Channels</text> |
| 74 | + <text x="215" y="96" text-anchor="middle" font-size="12" fill="#4e5c73">WhatsApp</text> |
| 75 | + <text x="215" y="116" text-anchor="middle" font-size="12" fill="#4e5c73">CLI / Web UI</text> |
| 76 | + <text x="215" y="136" text-anchor="middle" font-size="12" fill="#4e5c73">Slack / Teams</text> |
| 77 | + <text x="215" y="156" text-anchor="middle" font-size="12" fill="#4e5c73">Scheduler</text> |
| 78 | + |
| 79 | + <rect x="790" y="48" width="220" height="152" rx="10" fill="#ffffff" stroke="#d4dcec"></rect> |
| 80 | + <text x="900" y="72" text-anchor="middle" font-size="14" font-weight="700" fill="#24344d">Tools + Memory</text> |
| 81 | + <text x="900" y="96" text-anchor="middle" font-size="12" fill="#4e5c73">Filesystem / Shell</text> |
| 82 | + <text x="900" y="116" text-anchor="middle" font-size="12" fill="#4e5c73">Web / Recall</text> |
| 83 | + <text x="900" y="136" text-anchor="middle" font-size="12" fill="#4e5c73">Working Memory</text> |
| 84 | + <text x="900" y="156" text-anchor="middle" font-size="12" fill="#4e5c73">Observer + RAG</text> |
| 85 | + <text x="900" y="176" text-anchor="middle" font-size="12" fill="#4e5c73">Group / Skills</text> |
| 86 | + |
| 87 | + <rect x="345" y="235" width="430" height="88" rx="10" fill="#f4f8ff" stroke="#c8d6f1"></rect> |
| 88 | + <text x="560" y="258" text-anchor="middle" font-size="14" font-weight="700" fill="#214483">Timeline DB (SQLite)</text> |
| 89 | + <text x="560" y="278" text-anchor="middle" font-size="12" fill="#4e5c73">Events • Tasks • Approvals • Memory chunks</text> |
| 90 | + <text x="560" y="297" text-anchor="middle" font-size="12" fill="#4e5c73">Group roster • Topics • Settings</text> |
| 91 | + |
| 92 | + <line x1="310" y1="98" x2="410" y2="72" stroke="#2e5cab" stroke-width="2.2" marker-end="url(#arrowA)"></line> |
| 93 | + <line x1="710" y1="72" x2="790" y2="98" stroke="#2e5cab" stroke-width="2.2" marker-end="url(#arrowA)"></line> |
| 94 | + <line x1="560" y1="104" x2="560" y2="130" stroke="#2e5cab" stroke-width="2.2" marker-end="url(#arrowA)"></line> |
| 95 | + <line x1="560" y1="200" x2="560" y2="235" stroke="#2e5cab" stroke-width="2.2" marker-end="url(#arrowA)"></line> |
| 96 | + </svg> |
| 97 | +</div> |
| 98 | + |
| 99 | +Mermaid source (GitHub code view renders this; GitHub Pages may require a Mermaid JS include depending on your theme setup): |
| 100 | + |
| 101 | +```mermaid |
| 102 | +flowchart LR |
| 103 | + CH["Channels<br/>WhatsApp / CLI / Web / Slack / Teams / Scheduler"] --> MB["Message Bus"] |
| 104 | + MB --> AL["Agent Loop"] |
| 105 | + AL --> TM["Tools + Memory<br/>Filesystem / Shell / Web / RAG"] |
| 106 | + AL --> DB["Timeline DB (SQLite)<br/>events + tasks + approvals + memory"] |
74 | 107 | ``` |
75 | 108 |
|
76 | 109 | ## Design Principles |
|
0 commit comments