synabun 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +665 -0
- package/LICENSE +191 -0
- package/README.md +853 -0
- package/hooks/claude-code/post-plan.mjs +391 -0
- package/hooks/claude-code/post-remember.mjs +239 -0
- package/hooks/claude-code/pre-compact.mjs +241 -0
- package/hooks/claude-code/pre-websearch.mjs +90 -0
- package/hooks/claude-code/prompt-submit.mjs +861 -0
- package/hooks/claude-code/session-start.mjs +494 -0
- package/hooks/claude-code/shared.mjs +368 -0
- package/hooks/claude-code/stop.mjs +646 -0
- package/hooks/claude-code/test-user-learning.mjs +531 -0
- package/mcp-server/package.json +38 -0
- package/mcp-server/run.mjs +10 -0
- package/mcp-server/src/config.ts +70 -0
- package/mcp-server/src/http.ts +93 -0
- package/mcp-server/src/index.ts +203 -0
- package/mcp-server/src/preload-http.ts +25 -0
- package/mcp-server/src/preload.ts +29 -0
- package/mcp-server/src/scripts/migrate-qdrant-to-sqlite.ts +506 -0
- package/mcp-server/src/services/categories.ts +429 -0
- package/mcp-server/src/services/discord.ts +702 -0
- package/mcp-server/src/services/file-checksums.ts +33 -0
- package/mcp-server/src/services/local-embeddings.ts +77 -0
- package/mcp-server/src/services/neural-interface.ts +344 -0
- package/mcp-server/src/services/sqlite.ts +823 -0
- package/mcp-server/src/tools/browser-advanced.ts +123 -0
- package/mcp-server/src/tools/browser-interact.ts +255 -0
- package/mcp-server/src/tools/browser-navigate.ts +77 -0
- package/mcp-server/src/tools/browser-observe.ts +1330 -0
- package/mcp-server/src/tools/browser.ts +107 -0
- package/mcp-server/src/tools/card-tools.ts +193 -0
- package/mcp-server/src/tools/card.ts +22 -0
- package/mcp-server/src/tools/category.ts +379 -0
- package/mcp-server/src/tools/discord-channel.ts +274 -0
- package/mcp-server/src/tools/discord-guild.ts +188 -0
- package/mcp-server/src/tools/discord-member.ts +158 -0
- package/mcp-server/src/tools/discord-message.ts +231 -0
- package/mcp-server/src/tools/discord-onboarding.ts +228 -0
- package/mcp-server/src/tools/discord-role.ts +209 -0
- package/mcp-server/src/tools/discord-thread.ts +110 -0
- package/mcp-server/src/tools/discord-webhook.ts +176 -0
- package/mcp-server/src/tools/discord.ts +40 -0
- package/mcp-server/src/tools/forget.ts +38 -0
- package/mcp-server/src/tools/git-tools.ts +141 -0
- package/mcp-server/src/tools/git.ts +13 -0
- package/mcp-server/src/tools/image-tools.ts +98 -0
- package/mcp-server/src/tools/image.ts +17 -0
- package/mcp-server/src/tools/leonardo-browser-tools.ts +281 -0
- package/mcp-server/src/tools/leonardo.ts +28 -0
- package/mcp-server/src/tools/loop.ts +348 -0
- package/mcp-server/src/tools/memories.ts +118 -0
- package/mcp-server/src/tools/recall.ts +323 -0
- package/mcp-server/src/tools/reflect.ts +145 -0
- package/mcp-server/src/tools/remember.ts +115 -0
- package/mcp-server/src/tools/response.ts +26 -0
- package/mcp-server/src/tools/restore.ts +34 -0
- package/mcp-server/src/tools/sync.ts +114 -0
- package/mcp-server/src/tools/tictactoe-tools.ts +98 -0
- package/mcp-server/src/tools/tictactoe.ts +13 -0
- package/mcp-server/src/tools/utils.ts +25 -0
- package/mcp-server/src/tools/whiteboard-tools.ts +260 -0
- package/mcp-server/src/tools/whiteboard.ts +22 -0
- package/mcp-server/src/tui.ts +940 -0
- package/mcp-server/src/types.ts +85 -0
- package/mcp-server/tsconfig.json +19 -0
- package/neural-interface/package.json +27 -0
- package/neural-interface/public/apple-touch-icon.png +0 -0
- package/neural-interface/public/category-logos/claude.svg +1 -0
- package/neural-interface/public/category-logos/gemini-color.svg +1 -0
- package/neural-interface/public/category-logos/openai.svg +1 -0
- package/neural-interface/public/category-logos/synabun.png +0 -0
- package/neural-interface/public/claude-chat.css +878 -0
- package/neural-interface/public/claude-chat.html +92 -0
- package/neural-interface/public/claude-chat.js +1168 -0
- package/neural-interface/public/favicon-16x16.png +0 -0
- package/neural-interface/public/favicon-32x32.png +0 -0
- package/neural-interface/public/gallery.svg +6 -0
- package/neural-interface/public/icon-192.png +0 -0
- package/neural-interface/public/icon-512.png +0 -0
- package/neural-interface/public/index-legacy.html +14677 -0
- package/neural-interface/public/index.html +212 -0
- package/neural-interface/public/index2d-legacy.html +8193 -0
- package/neural-interface/public/index2d.html +127 -0
- package/neural-interface/public/invite.html +351 -0
- package/neural-interface/public/leonardoai.svg +1 -0
- package/neural-interface/public/logo-synabun.png +0 -0
- package/neural-interface/public/logoHD.png +0 -0
- package/neural-interface/public/manifest.json +14 -0
- package/neural-interface/public/offline.html +299 -0
- package/neural-interface/public/onboarding.html +2335 -0
- package/neural-interface/public/openclaw-logo-text.png +0 -0
- package/neural-interface/public/pin-svgrepo-com.svg +25 -0
- package/neural-interface/public/sessionicon.svg +8 -0
- package/neural-interface/public/shared/ansi-parser.js +305 -0
- package/neural-interface/public/shared/api.js +1043 -0
- package/neural-interface/public/shared/colors.js +153 -0
- package/neural-interface/public/shared/constants.js +141 -0
- package/neural-interface/public/shared/html-shell.js +777 -0
- package/neural-interface/public/shared/html-term-renderer.js +1022 -0
- package/neural-interface/public/shared/i18n.js +147 -0
- package/neural-interface/public/shared/registry.js +82 -0
- package/neural-interface/public/shared/state.js +86 -0
- package/neural-interface/public/shared/storage.js +150 -0
- package/neural-interface/public/shared/styles.css +21212 -0
- package/neural-interface/public/shared/ui-automation-studio.js +3573 -0
- package/neural-interface/public/shared/ui-bookmarks.js +231 -0
- package/neural-interface/public/shared/ui-claude-panel.js +6333 -0
- package/neural-interface/public/shared/ui-command-runner.js +534 -0
- package/neural-interface/public/shared/ui-cost-widget.js +602 -0
- package/neural-interface/public/shared/ui-detail.js +1454 -0
- package/neural-interface/public/shared/ui-explorer.js +1356 -0
- package/neural-interface/public/shared/ui-file-explorer.js +2750 -0
- package/neural-interface/public/shared/ui-games.js +411 -0
- package/neural-interface/public/shared/ui-help.js +107 -0
- package/neural-interface/public/shared/ui-image-gallery.js +461 -0
- package/neural-interface/public/shared/ui-invite.js +519 -0
- package/neural-interface/public/shared/ui-keybinds.js +452 -0
- package/neural-interface/public/shared/ui-layouts.js +297 -0
- package/neural-interface/public/shared/ui-link.js +731 -0
- package/neural-interface/public/shared/ui-loading.js +255 -0
- package/neural-interface/public/shared/ui-menubar.js +499 -0
- package/neural-interface/public/shared/ui-multiselect.js +93 -0
- package/neural-interface/public/shared/ui-navbar.js +222 -0
- package/neural-interface/public/shared/ui-notifications.js +287 -0
- package/neural-interface/public/shared/ui-panels.js +309 -0
- package/neural-interface/public/shared/ui-resume.js +653 -0
- package/neural-interface/public/shared/ui-search.js +145 -0
- package/neural-interface/public/shared/ui-sessions.js +531 -0
- package/neural-interface/public/shared/ui-settings.js +5987 -0
- package/neural-interface/public/shared/ui-sidebar.js +1905 -0
- package/neural-interface/public/shared/ui-skills.js +2805 -0
- package/neural-interface/public/shared/ui-stats.js +38 -0
- package/neural-interface/public/shared/ui-sync.js +201 -0
- package/neural-interface/public/shared/ui-terminal.js +6385 -0
- package/neural-interface/public/shared/ui-tooltip.js +123 -0
- package/neural-interface/public/shared/ui-trash.js +439 -0
- package/neural-interface/public/shared/ui-tutorial-draw.js +875 -0
- package/neural-interface/public/shared/ui-tutorial-steps.js +2276 -0
- package/neural-interface/public/shared/ui-tutorial.js +1117 -0
- package/neural-interface/public/shared/ui-update.js +244 -0
- package/neural-interface/public/shared/ui-whiteboard.js +3262 -0
- package/neural-interface/public/shared/ui-workspaces.js +722 -0
- package/neural-interface/public/shared/utils.js +360 -0
- package/neural-interface/public/shared/vterm-buffer.js +1102 -0
- package/neural-interface/public/sw.js +52 -0
- package/neural-interface/public/synabun.png +0 -0
- package/neural-interface/public/toolbar-album.svg +8 -0
- package/neural-interface/public/toolbar-question.svg +6 -0
- package/neural-interface/public/toolbar-sessions.svg +6 -0
- package/neural-interface/public/variant/2d/background.js +113 -0
- package/neural-interface/public/variant/2d/context-menu.js +133 -0
- package/neural-interface/public/variant/2d/gfx.js +45 -0
- package/neural-interface/public/variant/2d/graph.js +1635 -0
- package/neural-interface/public/variant/2d/hulls.js +207 -0
- package/neural-interface/public/variant/2d/lasso.js +135 -0
- package/neural-interface/public/variant/2d/layout.js +594 -0
- package/neural-interface/public/variant/2d/main.js +521 -0
- package/neural-interface/public/variant/2d/minimap.js +312 -0
- package/neural-interface/public/variant/2d/settings-gfx.js +98 -0
- package/neural-interface/public/variant/3d/background.js +884 -0
- package/neural-interface/public/variant/3d/camera.js +661 -0
- package/neural-interface/public/variant/3d/gfx.js +116 -0
- package/neural-interface/public/variant/3d/graph.js +2399 -0
- package/neural-interface/public/variant/3d/main.js +500 -0
- package/neural-interface/public/variant/3d/settings-gfx.js +228 -0
- package/neural-interface/scripts/rebuild-pty.js +100 -0
- package/neural-interface/server.js +15000 -0
- package/neural-interface/templates/CLAUDE-template.md +211 -0
- package/package.json +53 -0
- package/postinstall.js +135 -0
- package/setup.js +260 -0
- package/skills/leonardo/SKILL.md +159 -0
- package/skills/leonardo/icon.svg +1 -0
- package/skills/leonardo/modules/browser-guide.md +378 -0
- package/skills/leonardo/modules/image-prompter.md +277 -0
- package/skills/leonardo/modules/model-advisor.md +100 -0
- package/skills/leonardo/modules/prompt-library.md +110 -0
- package/skills/leonardo/modules/style-guide.md +186 -0
- package/skills/leonardo/modules/video-prompter.md +311 -0
- package/skills/synabun/SKILL.md +185 -0
- package/skills/synabun/icon.png +0 -0
- package/skills/synabun/modules/audit.md +374 -0
- package/skills/synabun/modules/changelog.md +194 -0
- package/skills/synabun/modules/idea.md +144 -0
- package/skills/synabun/modules/memorize.md +188 -0
- package/skills/synabun/synabunicon.png +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,853 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="public/synabun.png" alt="SynaBun" width="120" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">SynaBun</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Persistent vector memory for AI assistants — powered by SQLite and local embeddings.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://discord.gg/x6yWqE9GZP"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord" /></a>
|
|
13
|
+
<a href="https://x.com/SynabunAI"><img src="https://img.shields.io/badge/Follow-%40SynabunAI-000000?logo=x&logoColor=white" alt="X / Twitter" /></a>
|
|
14
|
+
<img src="https://img.shields.io/badge/Node.js-22%2B-339933?logo=nodedotjs&logoColor=white" alt="Node.js 22+" />
|
|
15
|
+
<img src="https://img.shields.io/badge/MCP-Protocol-8B5CF6" alt="MCP Protocol" />
|
|
16
|
+
<img src="https://img.shields.io/badge/SQLite-Database-003B57?logo=sqlite&logoColor=white" alt="SQLite" />
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://synabun.ai">synabun.ai</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Any Claude Code instance (or MCP-compatible AI tool) can connect to SynaBun and retain knowledge across sessions through semantic vector search. Memories are stored in a local SQLite database with built-in vector search — no external services, no API keys, no Docker.
|
|
26
|
+
|
|
27
|
+
## Screenshots
|
|
28
|
+
|
|
29
|
+
<table>
|
|
30
|
+
<tr>
|
|
31
|
+
<td align="center" width="50%">
|
|
32
|
+
<strong>Neural Interface</strong><br><br>
|
|
33
|
+
<img src="docs/screenshots/neural-interface.png" alt="3D memory graph visualization" width="100%" />
|
|
34
|
+
<br><em>Interactive 3D force-directed graph — memories as nodes, relationships as edges</em>
|
|
35
|
+
</td>
|
|
36
|
+
<td align="center" width="50%">
|
|
37
|
+
<strong>Claude Code Skin</strong><br><br>
|
|
38
|
+
<img src="docs/screenshots/claude-code-skin.png" alt="Claude Code side panel skin" width="100%" />
|
|
39
|
+
<br><em>Side panel UI for browsing and managing memories alongside your editor</em>
|
|
40
|
+
</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr>
|
|
43
|
+
<td align="center" width="50%">
|
|
44
|
+
<strong>Terminal & Editor</strong><br><br>
|
|
45
|
+
<img src="docs/screenshots/terminal-editor.png" alt="Claude Code terminal with memory tools" width="100%" />
|
|
46
|
+
<br><em>Memory tools running directly in your terminal alongside code</em>
|
|
47
|
+
</td>
|
|
48
|
+
<td align="center" width="50%">
|
|
49
|
+
<strong>Automation Studio</strong><br><br>
|
|
50
|
+
<img src="docs/screenshots/automation-studio.png" alt="Automation studio for background tasks" width="100%" />
|
|
51
|
+
<br><em>Autonomous background loops — set a task and let it run</em>
|
|
52
|
+
</td>
|
|
53
|
+
</tr>
|
|
54
|
+
</table>
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
- **Semantic Search** — find memories by meaning, not keywords, using cosine similarity
|
|
59
|
+
- **Multi-Project** — single collection serves all projects with automatic project detection and cross-project recall
|
|
60
|
+
- **Smart Relevance** — time decay (90-day half-life), project boost (1.2x), and access frequency scoring
|
|
61
|
+
- **User-Defined Categories** — hierarchical categories with prescriptive routing descriptions; dynamic schema refresh without server restart
|
|
62
|
+
- **Neural Interface** — interactive 3D force-directed graph visualization at `localhost:3344`
|
|
63
|
+
- **Local Embeddings** — built-in Transformers.js (`all-MiniLM-L6-v2`, 384 dims) — no API key or internet needed after first run
|
|
64
|
+
- **Onboarding Wizard** — guided setup through the Neural Interface UI
|
|
65
|
+
- **Trash & Restore** — soft-delete with full restore capability; trash management via Neural Interface
|
|
66
|
+
- **Memory Sync** — SHA-256 file hash tracking detects when related source files change, flagging stale memories
|
|
67
|
+
- **OpenClaw Bridge** — read-only integration overlays OpenClaw workspace memories as ephemeral nodes in the 3D graph
|
|
68
|
+
- **Category Logos** — upload custom logos for parent categories, rendered on sun nodes in the 3D visualization
|
|
69
|
+
- **Backup & Restore** — export and import SQLite database snapshots via the Neural Interface
|
|
70
|
+
- **Claude Code Hooks** — 7 lifecycle hooks automate memory recall, storage, and session indexing
|
|
71
|
+
- **User Learning** — autonomous observation of user communication patterns, preferences, and behavioral singularity across sessions
|
|
72
|
+
- **Claude Code `/synabun` Command** — single slash command hub with interactive menu for brainstorming, auditing, health checks, and memory search
|
|
73
|
+
- **Leonardo AI Integration** — 4 browser-based MCP tools for AI image and video generation via Leonardo.ai — no API key needed, full UI automation via Playwright with the `/leonardo` skill for guided creation
|
|
74
|
+
|
|
75
|
+
## Table of Contents
|
|
76
|
+
|
|
77
|
+
- [Screenshots](#screenshots)
|
|
78
|
+
- [Quick Start](#quick-start)
|
|
79
|
+
- [Architecture](#architecture)
|
|
80
|
+
- [MCP Tools](#mcp-tools)
|
|
81
|
+
- [Neural Interface](#neural-interface)
|
|
82
|
+
- [Usage](#usage)
|
|
83
|
+
- [Memory Categories](#memory-categories)
|
|
84
|
+
- [Importance Scale](#importance-scale)
|
|
85
|
+
- [How It Works](#how-it-works)
|
|
86
|
+
- [Configuration](#configuration)
|
|
87
|
+
- [Claude Code Hooks](#claude-code-hooks)
|
|
88
|
+
- [Claude Code Skills](#claude-code-skills)
|
|
89
|
+
- [CLAUDE.md Integration](#claudemd-integration)
|
|
90
|
+
- [Multi-Project Support](#multi-project-support)
|
|
91
|
+
- [Known Limitations](#known-limitations)
|
|
92
|
+
- [Troubleshooting](#troubleshooting)
|
|
93
|
+
- [Cost](#cost)
|
|
94
|
+
- [File Structure](#file-structure)
|
|
95
|
+
- [License](#license)
|
|
96
|
+
|
|
97
|
+
## Documentation
|
|
98
|
+
|
|
99
|
+
| Document | Description |
|
|
100
|
+
|----------|-------------|
|
|
101
|
+
| **[Website Docs](https://synabun.ai/docs.html)** | Full documentation on synabun.ai |
|
|
102
|
+
| **[README](./README.md)** | Quick start, architecture, configuration |
|
|
103
|
+
| **[Usage Guide](./docs/usage-guide.md)** | Detailed usage patterns, tool quirks, best practices |
|
|
104
|
+
| **[API Reference](./docs/api-reference.md)** | Neural Interface REST API (55+ endpoints) |
|
|
105
|
+
| **[Hooks Guide](./docs/hooks.md)** | Claude Code hooks: 7 lifecycle hooks for memory automation |
|
|
106
|
+
| **[Contributing](./CONTRIBUTING.md)** | Bug reports, feature requests, and forking guide |
|
|
107
|
+
| **[Security](./SECURITY.md)** | Security model and vulnerability reporting |
|
|
108
|
+
| **[Changelog](./CHANGELOG.md)** | Version history |
|
|
109
|
+
|
|
110
|
+
**Contributions:** We welcome [bug reports and feature requests](https://github.com/ZaphreBR/synabun/issues). Pull requests are not accepted. See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
|
|
111
|
+
|
|
112
|
+
## Quick Start
|
|
113
|
+
|
|
114
|
+
### Prerequisites
|
|
115
|
+
|
|
116
|
+
- Node.js 22.5+ (for built-in `node:sqlite`)
|
|
117
|
+
|
|
118
|
+
No Docker, no API keys, no external services required.
|
|
119
|
+
|
|
120
|
+
<details>
|
|
121
|
+
<summary><strong>Optional: Build tools for terminal features</strong></summary>
|
|
122
|
+
|
|
123
|
+
The Neural Interface includes an embedded terminal powered by `node-pty` (native addon). If build tools are missing, `npm install` will warn but continue — everything else works fine.
|
|
124
|
+
|
|
125
|
+
| Platform | Install |
|
|
126
|
+
|----------|---------|
|
|
127
|
+
| macOS | `xcode-select --install` |
|
|
128
|
+
| Linux | `sudo apt install build-essential python3` |
|
|
129
|
+
| Windows | [VS Build Tools 2022](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with "Desktop development with C++" |
|
|
130
|
+
|
|
131
|
+
</details>
|
|
132
|
+
|
|
133
|
+
### Install via npm
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm install -g synabun
|
|
137
|
+
synabun
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Or clone from GitHub
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
git clone https://github.com/danilokhury/Synabun.git
|
|
144
|
+
cd Synabun
|
|
145
|
+
npm start
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Either method will:
|
|
149
|
+
1. Check prerequisites (Node.js 22.5+)
|
|
150
|
+
2. Install all dependencies
|
|
151
|
+
3. Build the MCP server
|
|
152
|
+
4. Create the SQLite database (`data/memory.db`)
|
|
153
|
+
5. Download the embedding model (~23MB, cached permanently)
|
|
154
|
+
6. Launch the Neural Interface
|
|
155
|
+
7. Open the onboarding wizard in your browser
|
|
156
|
+
|
|
157
|
+
<details>
|
|
158
|
+
<summary><strong>Manual setup (advanced)</strong></summary>
|
|
159
|
+
|
|
160
|
+
### 1. Build the MCP server
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
cd mcp-server
|
|
164
|
+
npm install
|
|
165
|
+
npm run build
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
> **Note:** Always use `npm run build` (not `npx tsc`) — npx can install an unrelated `tsc` package instead of using the local TypeScript compiler.
|
|
169
|
+
|
|
170
|
+
### 2. Register with your AI tool
|
|
171
|
+
|
|
172
|
+
Add to your project's `.mcp.json`:
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"mcpServers": {
|
|
177
|
+
"SynaBun": {
|
|
178
|
+
"command": "node",
|
|
179
|
+
"args": ["/path/to/Synabun/mcp-server/run.mjs"]
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Or register globally for all projects:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
claude mcp add SynaBun -s user \
|
|
189
|
+
-- node "/path/to/Synabun/mcp-server/run.mjs"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
No environment variables needed — SQLite and local embeddings work out of the box.
|
|
193
|
+
|
|
194
|
+
### 3. Verify
|
|
195
|
+
|
|
196
|
+
Restart Claude Code, then run `/mcp`. You should see the `SynaBun` server with 72 tools listed.
|
|
197
|
+
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
<details>
|
|
201
|
+
<summary><strong>Platform-specific path notes</strong></summary>
|
|
202
|
+
|
|
203
|
+
The `.mcp.json` path must match the platform where **Claude Code is running**:
|
|
204
|
+
|
|
205
|
+
| Platform | Path format | Example |
|
|
206
|
+
|----------|-------------|---------|
|
|
207
|
+
| **Windows** | Forward slashes | `D:/Apps/Synabun/mcp-server/run.mjs` |
|
|
208
|
+
| **WSL** | Linux mount paths | `/mnt/d/Apps/Synabun/mcp-server/run.mjs` |
|
|
209
|
+
| **Linux/macOS** | Native paths | `/home/user/Apps/Synabun/mcp-server/run.mjs` |
|
|
210
|
+
|
|
211
|
+
**Common pitfall:** If Claude Code runs on Windows but you use a WSL-style path like `/mnt/j/...`, Node.js will resolve it to `J:\mnt\j\...` (prepending the drive letter), which doesn't exist. Always use Windows-native paths when Claude Code runs on Windows.
|
|
212
|
+
|
|
213
|
+
</details>
|
|
214
|
+
|
|
215
|
+
## Architecture
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
AI Assistant (any project)
|
|
219
|
+
│
|
|
220
|
+
│ MCP Protocol (stdio or HTTP)
|
|
221
|
+
│
|
|
222
|
+
┌───┴──────────────────────────┐
|
|
223
|
+
│ SynaBun MCP Server │ Node.js 22.5+ / TypeScript
|
|
224
|
+
│ │
|
|
225
|
+
│ 72 tools across 9 groups: │
|
|
226
|
+
│ Memory (8), Browser (39), │
|
|
227
|
+
│ Whiteboard (5), Cards (5), │
|
|
228
|
+
│ Discord (8), Leonardo (4), │
|
|
229
|
+
│ Git (1), Loop (1), │
|
|
230
|
+
│ TicTacToe (1) │
|
|
231
|
+
│ │
|
|
232
|
+
│ Transformers.js │ Local embeddings
|
|
233
|
+
│ all-MiniLM-L6-v2 │ (384 dims, ~23MB model)
|
|
234
|
+
│ │
|
|
235
|
+
│ node:sqlite │ Built-in SQLite
|
|
236
|
+
│ data/memory.db │ (vectors as Float32 BLOBs)
|
|
237
|
+
│ │
|
|
238
|
+
│ Playwright │ Browser automation
|
|
239
|
+
│ (Chromium) │ (persistent sessions)
|
|
240
|
+
└──────────────────────────────┘
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Everything runs in a single Node.js process — no external services, no Docker, no API keys.
|
|
244
|
+
|
|
245
|
+
## MCP Tools (72)
|
|
246
|
+
|
|
247
|
+
SynaBun exposes 72 tools via the Model Context Protocol, organized into 9 groups:
|
|
248
|
+
|
|
249
|
+
### Memory (8 tools)
|
|
250
|
+
|
|
251
|
+
| Tool | Purpose | Key Parameters |
|
|
252
|
+
|------|---------|----------------|
|
|
253
|
+
| `remember` | Store a new memory | `content`, `category`, `project`, `tags`, `importance`, `subcategory` |
|
|
254
|
+
| `recall` | Semantic search across memories | `query`, `category`, `project`, `tags`, `limit`, `min_importance` |
|
|
255
|
+
| `reflect` | Update an existing memory | `memory_id` (full UUID), `content`, `importance`, `tags`, `category` |
|
|
256
|
+
| `forget` | Soft-delete a memory (moves to trash) | `memory_id` |
|
|
257
|
+
| `restore` | Restore a trashed memory | `memory_id` |
|
|
258
|
+
| `memories` | List recent memories or get stats | `action` (recent, stats, by-category, by-project) |
|
|
259
|
+
| `sync` | Detect stale memories via file hash comparison | `project` (optional filter) |
|
|
260
|
+
| `category` | Create, update, delete, or list categories | `action` (create, update, delete, list), `name`, `description`, `parent` |
|
|
261
|
+
|
|
262
|
+
### Browser (39 tools)
|
|
263
|
+
|
|
264
|
+
18 general browser automation tools + 21 social media extraction tools, all powered by Playwright with persistent Chromium sessions.
|
|
265
|
+
|
|
266
|
+
**General automation:**
|
|
267
|
+
`browser_navigate`, `browser_click`, `browser_fill`, `browser_type`, `browser_hover`, `browser_select`, `browser_press`, `browser_evaluate`, `browser_snapshot`, `browser_content`, `browser_screenshot`, `browser_session`, `browser_go_back`, `browser_go_forward`, `browser_reload`, `browser_wait`, `browser_scroll`, `browser_upload`
|
|
268
|
+
|
|
269
|
+
**Social media extraction:**
|
|
270
|
+
`browser_extract_tweets`, `browser_extract_fb_posts`, `browser_extract_tiktok_videos`, `browser_extract_tiktok_search`, `browser_extract_tiktok_studio`, `browser_extract_tiktok_profile`, `browser_extract_wa_chats`, `browser_extract_wa_messages`, `browser_extract_ig_feed`, `browser_extract_ig_profile`, `browser_extract_ig_post`, `browser_extract_ig_reels`, `browser_extract_ig_search`, `browser_extract_li_feed`, `browser_extract_li_profile`, `browser_extract_li_post`, `browser_extract_li_notifications`, `browser_extract_li_messages`, `browser_extract_li_search_people`, `browser_extract_li_network`, `browser_extract_li_jobs`
|
|
271
|
+
|
|
272
|
+
### Whiteboard (5 tools)
|
|
273
|
+
|
|
274
|
+
| Tool | Purpose |
|
|
275
|
+
|------|---------|
|
|
276
|
+
| `whiteboard_read` | View whiteboard contents |
|
|
277
|
+
| `whiteboard_add` | Place new items on the whiteboard |
|
|
278
|
+
| `whiteboard_update` | Modify items on the whiteboard |
|
|
279
|
+
| `whiteboard_remove` | Delete items from the whiteboard |
|
|
280
|
+
| `whiteboard_screenshot` | Capture the whiteboard as an image |
|
|
281
|
+
|
|
282
|
+
### Cards (5 tools)
|
|
283
|
+
|
|
284
|
+
| Tool | Purpose |
|
|
285
|
+
|------|---------|
|
|
286
|
+
| `card_list` | See all open memory cards |
|
|
287
|
+
| `card_open` | Open a memory card on screen |
|
|
288
|
+
| `card_close` | Dismiss open memory cards |
|
|
289
|
+
| `card_update` | Move, resize, pin, or compact cards |
|
|
290
|
+
| `card_screenshot` | Capture open cards as an image |
|
|
291
|
+
|
|
292
|
+
### Discord (8 tools)
|
|
293
|
+
|
|
294
|
+
| Tool | Purpose |
|
|
295
|
+
|------|---------|
|
|
296
|
+
| `discord_guild` | Server info, channels, members, roles, audit log |
|
|
297
|
+
| `discord_channel` | Create, edit, delete channels and set permissions |
|
|
298
|
+
| `discord_role` | Create, edit, delete roles, assign/remove from members |
|
|
299
|
+
| `discord_message` | Send, edit, delete, pin, react, bulk delete, list messages |
|
|
300
|
+
| `discord_member` | Member info, kick, ban, unban, timeout, nickname |
|
|
301
|
+
| `discord_onboarding` | Welcome screen, rules, verification, onboarding prompts |
|
|
302
|
+
| `discord_webhook` | Create, edit, delete, list, execute webhooks |
|
|
303
|
+
| `discord_thread` | Create, archive, unarchive, lock, delete threads |
|
|
304
|
+
|
|
305
|
+
### Automation (1 tool)
|
|
306
|
+
|
|
307
|
+
| Tool | Purpose |
|
|
308
|
+
|------|---------|
|
|
309
|
+
| `loop` | Run, stop, or check autonomous background tasks |
|
|
310
|
+
|
|
311
|
+
### Leonardo AI (4 tools)
|
|
312
|
+
|
|
313
|
+
Browser-based AI image and video generation via [Leonardo.ai](https://app.leonardo.ai). No API key needed — all tools automate the Leonardo.ai web UI directly via Playwright.
|
|
314
|
+
|
|
315
|
+
| Tool | Purpose |
|
|
316
|
+
|------|---------|
|
|
317
|
+
| `leonardo_browser_navigate` | Navigate to specific Leonardo.ai pages (home, library, image editor, video, upscaler, blueprints, realtime canvas, models) |
|
|
318
|
+
| `leonardo_browser_generate` | Fill the prompt and click Generate — configure UI settings (model, style, dimensions, motion controls) beforehand using generic browser tools |
|
|
319
|
+
| `leonardo_browser_library` | View or search the Leonardo.ai generation library |
|
|
320
|
+
| `leonardo_browser_download` | Capture the current Leonardo.ai page as a screenshot to see generation results |
|
|
321
|
+
|
|
322
|
+
> **Tip:** Use the `/leonardo` skill in Claude Code for an expert-guided creation experience with a 7-phase video prompter, 6-phase image prompter, model advisor with decision matrices for 30+ models, curated prompt library, and style guide with motion controls and camera combos.
|
|
323
|
+
|
|
324
|
+
## Neural Interface
|
|
325
|
+
|
|
326
|
+
SynaBun includes a 3D visualization UI for browsing and managing memories.
|
|
327
|
+
|
|
328
|
+
**Start it:**
|
|
329
|
+
```bash
|
|
330
|
+
cd neural-interface
|
|
331
|
+
npm start
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Then open **http://localhost:3344**
|
|
335
|
+
|
|
336
|
+
**What you get:**
|
|
337
|
+
- Interactive force-directed graph — memories as nodes, relationships as edges
|
|
338
|
+
- Click nodes to inspect, edit, or delete memories
|
|
339
|
+
- Semantic search bar (press `/` to focus)
|
|
340
|
+
- Category sidebar with filtering, hierarchy editing, and custom logos
|
|
341
|
+
- Drag nodes to pin them in 3D space
|
|
342
|
+
- Trash management — view, restore, or permanently purge deleted memories
|
|
343
|
+
- Memory Sync — detect stale memories whose source files have changed (SHA-256 hash comparison)
|
|
344
|
+
- Backup & Restore — export and import database snapshots
|
|
345
|
+
- OpenClaw Bridge — overlay OpenClaw workspace memories as read-only ephemeral nodes
|
|
346
|
+
- Graphics quality presets (Low, Medium, High, Ultra)
|
|
347
|
+
- Onboarding wizard for first-time setup
|
|
348
|
+
- Category export — download all memories in a category as Markdown
|
|
349
|
+
|
|
350
|
+
The Neural Interface also serves as the admin panel for category management, hook installation, skill management, and MCP registration — all from a single web UI.
|
|
351
|
+
|
|
352
|
+
## Usage
|
|
353
|
+
|
|
354
|
+
### Storing memories
|
|
355
|
+
|
|
356
|
+
Format content in **Markdown** for readability:
|
|
357
|
+
|
|
358
|
+
```javascript
|
|
359
|
+
remember({
|
|
360
|
+
content: `## Redis Price Cache Configuration
|
|
361
|
+
|
|
362
|
+
**TTL:** 1 hour (3600 seconds)
|
|
363
|
+
**Location:** \`orchestratorSingleton.ts\`
|
|
364
|
+
|
|
365
|
+
**Note:** Increasing TTL improves performance but delays price updates.`,
|
|
366
|
+
category: "project",
|
|
367
|
+
importance: 7,
|
|
368
|
+
tags: ["redis", "cache", "pricing"],
|
|
369
|
+
subcategory: "architecture"
|
|
370
|
+
})
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Searching memories
|
|
374
|
+
|
|
375
|
+
```javascript
|
|
376
|
+
recall({
|
|
377
|
+
query: "how does the price caching work",
|
|
378
|
+
limit: 5
|
|
379
|
+
})
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Results include similarity score, importance, age, and full content. Filter by category, project, tags, or minimum importance.
|
|
383
|
+
|
|
384
|
+
### Browsing and stats
|
|
385
|
+
|
|
386
|
+
```javascript
|
|
387
|
+
memories({ action: "stats" }) // Counts by category and project
|
|
388
|
+
memories({ action: "recent", limit: 10 }) // Most recent
|
|
389
|
+
memories({ action: "by-category", category: "learning" }) // Filter by category
|
|
390
|
+
memories({ action: "by-project", project: "myapp" }) // Filter by project
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Updating memories
|
|
394
|
+
|
|
395
|
+
```javascript
|
|
396
|
+
reflect({
|
|
397
|
+
memory_id: "8f7cab3b-644e-4cea-8662-de0ca695bdf2", // Full UUID required
|
|
398
|
+
importance: 9,
|
|
399
|
+
add_tags: ["critical"]
|
|
400
|
+
})
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Deleting and restoring memories
|
|
404
|
+
|
|
405
|
+
```javascript
|
|
406
|
+
// Soft-delete (moves to trash)
|
|
407
|
+
forget({ memory_id: "8f7cab3b-644e-4cea-8662-de0ca695bdf2" })
|
|
408
|
+
|
|
409
|
+
// Undo — restore from trash
|
|
410
|
+
restore({ memory_id: "8f7cab3b-644e-4cea-8662-de0ca695bdf2" })
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Detecting stale memories
|
|
414
|
+
|
|
415
|
+
```javascript
|
|
416
|
+
// Check which memories have outdated file references
|
|
417
|
+
sync({ project: "my-project" })
|
|
418
|
+
// Returns: list of memories whose related_files have changed since last update
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
The `sync` tool compares SHA-256 hashes of files referenced in `related_files` against stored checksums. Use it to find memories that may need updating after code changes.
|
|
422
|
+
|
|
423
|
+
For detailed usage patterns and best practices, see the [Usage Guide](./docs/usage-guide.md).
|
|
424
|
+
|
|
425
|
+
## Memory Categories
|
|
426
|
+
|
|
427
|
+
Categories are fully user-defined, stored per-connection in `mcp-server/data/custom-categories-{connId}.json`. There are no hardcoded defaults. Manage them via MCP tools or the [Neural Interface](#neural-interface).
|
|
428
|
+
|
|
429
|
+
### How Claude Decides Where to Store Memories
|
|
430
|
+
|
|
431
|
+
Category descriptions are **routing instructions** that Claude reads every time it calls `remember`. Claude reads ALL category descriptions from the tool schema and picks the best match.
|
|
432
|
+
|
|
433
|
+
```
|
|
434
|
+
You create categories with descriptions
|
|
435
|
+
↓
|
|
436
|
+
buildCategoryDescription() assembles them into a hierarchical guide
|
|
437
|
+
↓
|
|
438
|
+
The guide is embedded in the MCP tool schema (Zod .describe())
|
|
439
|
+
↓
|
|
440
|
+
Claude reads the guide when calling remember/recall/reflect
|
|
441
|
+
↓
|
|
442
|
+
Claude picks the category whose description best matches the memory
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Descriptions refresh dynamically — when you change a description via MCP tools (`category_update`), the tool schemas rebuild and Claude sees the update immediately via `notifications/tools/list_changed`. No server restart needed.
|
|
446
|
+
|
|
447
|
+
### Writing Effective Descriptions
|
|
448
|
+
|
|
449
|
+
Descriptions should be **prescriptive rules**, not vague labels:
|
|
450
|
+
|
|
451
|
+
| Quality | Example |
|
|
452
|
+
|---------|---------|
|
|
453
|
+
| Bad | `"Pricing and stores"` |
|
|
454
|
+
| Good | `"ONLY for deal/pricing memories: store imports, price comparisons, Gamivo/YuPlay/Steam pricing. Never put project bugs here."` |
|
|
455
|
+
| Bad | `"Bug fixes"` |
|
|
456
|
+
| Good | `"Bug fixes, root cause analysis, error resolutions. Must be about actual code bugs — not feature requests or ideas."` |
|
|
457
|
+
|
|
458
|
+
**Tips:**
|
|
459
|
+
- Be explicit about boundaries — say what does NOT belong as much as what does
|
|
460
|
+
- Reference other categories by name — "use deals for pricing, use bug-fixes for bugs"
|
|
461
|
+
- List concrete examples — "Gamivo, YuPlay, Steam pricing data"
|
|
462
|
+
- Keep it under ~200 chars — Claude reads all descriptions at once, brevity helps
|
|
463
|
+
|
|
464
|
+
### Parent Categories
|
|
465
|
+
|
|
466
|
+
Parent categories group related children into visual clusters. They affect how Claude sees the hierarchy:
|
|
467
|
+
|
|
468
|
+
```
|
|
469
|
+
[criticalpixel] (parent) — All CriticalPixel memories go here
|
|
470
|
+
bug-fixes = Bug fixes, root cause analysis, error resolutions for CP code
|
|
471
|
+
databases = Database schemas, queries, migrations, Supabase config
|
|
472
|
+
deals = ONLY deal/pricing memories: store imports, price comparisons...
|
|
473
|
+
memory-system = MCP server architecture, SQLite config, embedding pipeline...
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
Create parents via MCP tools:
|
|
477
|
+
```javascript
|
|
478
|
+
category_create({ name: "my-project", description: "All memories for my-project" })
|
|
479
|
+
category_update({ name: "bug-fixes", parent: "my-project" })
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
Or via the Neural Interface sidebar — click the **Parent** button, then drag categories onto it.
|
|
483
|
+
|
|
484
|
+
### Dynamic Schema Refresh
|
|
485
|
+
|
|
486
|
+
```
|
|
487
|
+
category_create / category_update / category_delete
|
|
488
|
+
→ refreshCategorySchemas()
|
|
489
|
+
→ invalidateCategoryCache()
|
|
490
|
+
→ tool.update({ paramsSchema: ... })
|
|
491
|
+
→ SDK sends notifications/tools/list_changed
|
|
492
|
+
→ Claude re-fetches tool list → sees updated descriptions
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
## Importance Scale
|
|
496
|
+
|
|
497
|
+
| Score | Meaning | When to use |
|
|
498
|
+
|-------|---------|------------|
|
|
499
|
+
| 1-2 | Trivial | Temporary workarounds, minor preferences |
|
|
500
|
+
| 3-4 | Low | Common patterns, routine configs |
|
|
501
|
+
| 5 | Normal | Standard decisions (default) |
|
|
502
|
+
| 6-7 | Significant | Important patterns, non-obvious fixes |
|
|
503
|
+
| 8-9 | Critical | Hard-won bug fixes, key architecture decisions |
|
|
504
|
+
| 10 | Foundational | Core architecture, security rules, owner preferences |
|
|
505
|
+
|
|
506
|
+
Memories with importance **8+** are immune to time-based relevance decay.
|
|
507
|
+
|
|
508
|
+
## How It Works
|
|
509
|
+
|
|
510
|
+
### Embedding and storage
|
|
511
|
+
|
|
512
|
+
When `remember` is called, the content text is embedded locally via Transformers.js (`all-MiniLM-L6-v2`) which returns a 384-dimensional normalized vector. This vector (stored as a Float32Array BLOB), along with the payload (content, category, tags, timestamps, etc.), is inserted into the SQLite `memories` table.
|
|
513
|
+
|
|
514
|
+
### Semantic search
|
|
515
|
+
|
|
516
|
+
When `recall` is called, the query is embedded the same way, then cosine similarity is computed in JavaScript against all stored vectors. Results are re-ranked with:
|
|
517
|
+
|
|
518
|
+
- **Time decay** — 90-day half-life (older memories score lower, unless importance >= 8)
|
|
519
|
+
- **Project boost** — memories from the current project get a 1.2x score multiplier
|
|
520
|
+
- **Access boost** — frequently recalled memories get a small relevance increase
|
|
521
|
+
|
|
522
|
+
### SQLite schema
|
|
523
|
+
|
|
524
|
+
The database stores memories, session chunks, and trash in a single `memory.db` file. Columns are indexed on `category`, `project`, `importance`, and `created_at` for fast filtered queries.
|
|
525
|
+
|
|
526
|
+
### Access tracking
|
|
527
|
+
|
|
528
|
+
Every time a memory is returned by `recall`, its `accessed_at` timestamp and `access_count` are updated (fire-and-forget, non-blocking).
|
|
529
|
+
|
|
530
|
+
## Configuration
|
|
531
|
+
|
|
532
|
+
### Environment variables
|
|
533
|
+
|
|
534
|
+
SynaBun works with zero configuration by default. All settings are optional:
|
|
535
|
+
|
|
536
|
+
```env
|
|
537
|
+
# Optional overrides
|
|
538
|
+
SQLITE_DB_PATH=/custom/path/to/memory.db # Default: data/memory.db
|
|
539
|
+
MEMORY_DATA_DIR=/custom/data/dir # Default: mcp-server/data/
|
|
540
|
+
NEURAL_PORT=3344 # Neural Interface port (default: 3344)
|
|
541
|
+
SETUP_COMPLETE=true
|
|
542
|
+
|
|
543
|
+
# API keys (optional — only needed for specific integrations)
|
|
544
|
+
DISCORD_BOT_TOKEN=your-token-here # Discord server management
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
| Variable | Description |
|
|
548
|
+
|----------|-------------|
|
|
549
|
+
| `SQLITE_DB_PATH` | Path to SQLite database file (default: `data/memory.db`) |
|
|
550
|
+
| `MEMORY_DATA_DIR` | Data directory for runtime files (default: `mcp-server/data/`) |
|
|
551
|
+
| `NEURAL_PORT` | Neural Interface server port (default: 3344) |
|
|
552
|
+
| `DISCORD_BOT_TOKEN` | Discord bot token for server management tools |
|
|
553
|
+
|
|
554
|
+
Set these in the `.env` file at the project root, or let SynaBun use the defaults.
|
|
555
|
+
|
|
556
|
+
## Embeddings
|
|
557
|
+
|
|
558
|
+
SynaBun uses **local embeddings** via Transformers.js — no API key or internet connection needed (after the initial ~23MB model download).
|
|
559
|
+
|
|
560
|
+
| Property | Value |
|
|
561
|
+
|----------|-------|
|
|
562
|
+
| **Model** | `Xenova/all-MiniLM-L6-v2` |
|
|
563
|
+
| **Dimensions** | 384 |
|
|
564
|
+
| **Runtime** | ONNX (via `@huggingface/transformers`) |
|
|
565
|
+
| **Cache** | `~/.cache/huggingface/` (permanent, auto-downloaded on first use) |
|
|
566
|
+
| **Cost** | Free |
|
|
567
|
+
|
|
568
|
+
The model runs entirely in-process — no external service calls, no API keys, no network dependency after first download.
|
|
569
|
+
|
|
570
|
+
## Claude Code Hooks
|
|
571
|
+
|
|
572
|
+
SynaBun ships with 7 [Claude Code hooks](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/hooks) that automate memory usage across the entire coding session lifecycle.
|
|
573
|
+
|
|
574
|
+
| Hook | Event | Purpose |
|
|
575
|
+
|------|-------|---------|
|
|
576
|
+
| `session-start.mjs` | `SessionStart` | Greeting, boot sequence, compaction recovery, loop detection, session registration |
|
|
577
|
+
| `prompt-submit.mjs` | `UserPromptSubmit` | Tiered recall nudges, loop iteration injection, category tree on first threshold |
|
|
578
|
+
| `pre-compact.mjs` | `PreCompact` | Captures session transcript before context compaction for conversation indexing |
|
|
579
|
+
| `stop.mjs` | `Stop` | Combined obligations: compaction, loops, task memory, user learning, conversation turns, auto-store, unstored plans |
|
|
580
|
+
| `post-remember.mjs` | `PostToolUse` | Tracks edit count and clears enforcement flags when memories are stored. User learning flag management |
|
|
581
|
+
| `pre-websearch.mjs` | `PreToolUse` | Blocks WebSearch/WebFetch during active browser sessions to prevent interference |
|
|
582
|
+
| `post-plan.mjs` | `PostToolUse` | Auto-stores plans as memories when exiting plan mode |
|
|
583
|
+
|
|
584
|
+
**Install via Neural Interface:** Settings > Integrations > Enable (global or per-project).
|
|
585
|
+
|
|
586
|
+
For detailed hook documentation, customization options, and custom hook templates, see the [Hooks Guide](./docs/hooks.md).
|
|
587
|
+
|
|
588
|
+
## Claude Code Skills
|
|
589
|
+
|
|
590
|
+
SynaBun ships [Claude Code skills](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials/custom-slash-commands) — slash commands that provide expert-guided workflows.
|
|
591
|
+
|
|
592
|
+
### `/synabun` — Memory Command Hub
|
|
593
|
+
|
|
594
|
+
The entry point for all memory-powered capabilities. Type `/synabun` in Claude Code and an interactive menu appears:
|
|
595
|
+
|
|
596
|
+
| Option | What it does |
|
|
597
|
+
|--------|-------------|
|
|
598
|
+
| **Brainstorm Ideas** | Cross-pollinate memories to spark creative ideas. Uses multi-round recall with 5 query strategies (direct, adjacent, problem-space, solution-space, cross-domain) and synthesizes ideas traced back to specific memories. |
|
|
599
|
+
| **Audit Memories** | Validate stored memories against the current codebase. Runs 6 phases: landscape survey, checksum pre-scan, bulk retrieval, parallel semantic verification, interactive classification (STALE/INVALID/VALID/UNVERIFIABLE), and audit report. |
|
|
600
|
+
| **Memory Health** | Quick stats overview and staleness check — total count, category distribution, stale file references. |
|
|
601
|
+
| **Search Memories** | Find something specific across your entire memory bank using semantic search. |
|
|
602
|
+
|
|
603
|
+
### `/leonardo` — Master Media Prompter
|
|
604
|
+
|
|
605
|
+
Expert-guided AI image and video creation via Leonardo.ai. Supports quick mode for power users and interactive questionnaires for guided creation.
|
|
606
|
+
|
|
607
|
+
| Mode | Usage |
|
|
608
|
+
|------|-------|
|
|
609
|
+
| **Interactive menu** | `/leonardo` — choose between Create Video, Create Image, Quick Generate, or Account Info |
|
|
610
|
+
| **Direct routing** | `/leonardo video sunset over ocean` or `/leonardo image cyberpunk portrait` |
|
|
611
|
+
| **Quick mode** | `/leonardo quick a cinematic drone shot of a volcano` — skip the questionnaire, use smart defaults |
|
|
612
|
+
|
|
613
|
+
The skill includes 5 expert modules: video prompter (7-phase cinematic questionnaire with motion controls and style stacking), image prompter (6-phase composition questionnaire with style presets), model advisor (decision matrices for 30+ models), prompt library (curated templates), and style guide (style stacking, motion controls, camera combos).
|
|
614
|
+
|
|
615
|
+
**Install:** Copy the skills to your global skills directory:
|
|
616
|
+
|
|
617
|
+
```bash
|
|
618
|
+
# Skills live at:
|
|
619
|
+
~/.claude/skills/synabun/SKILL.md
|
|
620
|
+
~/.claude/skills/leonardo/SKILL.md
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
## CLAUDE.md Integration
|
|
624
|
+
|
|
625
|
+
Add this to any project's `CLAUDE.md` to instruct Claude to use memory automatically:
|
|
626
|
+
|
|
627
|
+
<details>
|
|
628
|
+
<summary><strong>Show CLAUDE.md template</strong></summary>
|
|
629
|
+
|
|
630
|
+
```markdown
|
|
631
|
+
## Persistent Memory
|
|
632
|
+
|
|
633
|
+
You have persistent vector memory via the `SynaBun` MCP server (72 tools).
|
|
634
|
+
Core memory tools: remember, recall, forget, restore, reflect, memories, sync, category.
|
|
635
|
+
Also available: browser automation (39 tools), whiteboard (5), cards (5), discord (8), leonardo AI (4), git, loop, tictactoe.
|
|
636
|
+
|
|
637
|
+
### Auto-Recall (do this automatically)
|
|
638
|
+
- At session start: recall context about the current project
|
|
639
|
+
- When user mentions a specific topic: recall what you know
|
|
640
|
+
- Before architecture decisions: recall past decisions
|
|
641
|
+
- When debugging: recall past similar bugs
|
|
642
|
+
|
|
643
|
+
### Auto-Remember (do this automatically)
|
|
644
|
+
- After fixing a hard bug: remember the solution (importance 7+)
|
|
645
|
+
- After architecture decisions: remember the decision and why (importance 8+)
|
|
646
|
+
- When user says "remember this": importance 8+
|
|
647
|
+
- API quirks or gotchas discovered: remember as learning
|
|
648
|
+
- Session-ending context: remember ongoing work as conversation
|
|
649
|
+
|
|
650
|
+
### Memory Tool Quirks
|
|
651
|
+
- `remember` accepts `tags` and `importance` directly and returns the full UUID.
|
|
652
|
+
- `forget` is a soft delete — use `restore` to undo.
|
|
653
|
+
- The `reflect` tool's ID parameter is `memory_id` (not `id`). It requires the FULL UUID format.
|
|
654
|
+
- Make memory MCP calls sequentially, not in parallel — one failure cascades to all sibling calls in the batch.
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
</details>
|
|
658
|
+
|
|
659
|
+
## Multi-Project Support
|
|
660
|
+
|
|
661
|
+
The `project` field is auto-detected from the working directory name. Memories from different projects are stored in the same collection but can be filtered independently.
|
|
662
|
+
|
|
663
|
+
When `recall` is called without a project filter, it searches **all** projects but gives a 1.2x boost to results matching the current project. Cross-project knowledge (like general patterns or tool usage) is still surfaced when relevant.
|
|
664
|
+
|
|
665
|
+
## Database
|
|
666
|
+
|
|
667
|
+
SynaBun stores all data in a single SQLite file (`data/memory.db`). No external database service needed.
|
|
668
|
+
|
|
669
|
+
```bash
|
|
670
|
+
# Database location
|
|
671
|
+
ls mcp-server/data/memory.db
|
|
672
|
+
|
|
673
|
+
# Backup (just copy the file)
|
|
674
|
+
cp mcp-server/data/memory.db ~/backups/memory-$(date +%Y%m%d).db
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
### Rebuilding after code changes
|
|
678
|
+
|
|
679
|
+
```bash
|
|
680
|
+
cd mcp-server
|
|
681
|
+
npm run build
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
No need to restart Claude Code — the MCP server is spawned fresh on each session.
|
|
685
|
+
|
|
686
|
+
### Migrating from Qdrant
|
|
687
|
+
|
|
688
|
+
If you have an existing Qdrant-based installation, use the migration script:
|
|
689
|
+
|
|
690
|
+
```bash
|
|
691
|
+
cd mcp-server
|
|
692
|
+
npm run migrate
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
This reads all memories from your Qdrant instance, re-embeds them with the local model, and inserts them into the new SQLite database.
|
|
696
|
+
|
|
697
|
+
## Known Limitations
|
|
698
|
+
|
|
699
|
+
### 1. `reflect` requires full UUID
|
|
700
|
+
|
|
701
|
+
`remember` returns the full UUID in its output. Use it directly with `reflect`:
|
|
702
|
+
|
|
703
|
+
```
|
|
704
|
+
reflect({ memory_id: "8f7cab3b" }) // Bad Request
|
|
705
|
+
reflect({ memory_id: "8f7cab3b-644e-4cea-8662-de0ca695bdf2" }) // Works
|
|
706
|
+
```
|
|
707
|
+
|
|
708
|
+
For existing memories, use `recall` to get the full UUID.
|
|
709
|
+
|
|
710
|
+
### 2. Parallel tool call failures
|
|
711
|
+
|
|
712
|
+
When making parallel MCP tool calls, if one fails, all sibling calls in that batch may fail. Make memory calls sequentially.
|
|
713
|
+
|
|
714
|
+
## Troubleshooting
|
|
715
|
+
|
|
716
|
+
<details>
|
|
717
|
+
<summary><strong>Common issues and fixes</strong></summary>
|
|
718
|
+
|
|
719
|
+
| Symptom | Cause | Fix |
|
|
720
|
+
|---------|-------|-----|
|
|
721
|
+
| `Cannot find module '.../dist/index.js'` | TypeScript not compiled | `npm run build` inside `mcp-server/` |
|
|
722
|
+
| `npx tsc` installs wrong package | npm's `tsc` package shadows TypeScript | Use `npm run build` instead |
|
|
723
|
+
| Node resolves path to `J:\mnt\j\...` | WSL path used with Windows Claude Code | Use Windows paths (`J:/...`) |
|
|
724
|
+
| `node:sqlite` not found | Node.js version too old | Upgrade to Node.js 22.5+ |
|
|
725
|
+
| `remember` fails with type errors | Rare — older MCP SDK serialization | Update MCP SDK, or use `reflect` as fallback |
|
|
726
|
+
| `reflect` returns "Bad Request" | Using shortened ID | Use full UUID from `remember` output or `recall` |
|
|
727
|
+
| "Sibling tool call errored" | Parallel MCP call batch failure | Make memory calls sequentially |
|
|
728
|
+
| Slow first `remember`/`recall` | Embedding model loading on first use | Normal — model loads once per session (~2-3s) |
|
|
729
|
+
|
|
730
|
+
</details>
|
|
731
|
+
|
|
732
|
+
## Cost
|
|
733
|
+
|
|
734
|
+
**Free.** SynaBun uses local embeddings (Transformers.js) and a local SQLite database. No API calls, no cloud services, no usage-based billing.
|
|
735
|
+
|
|
736
|
+
## File Structure
|
|
737
|
+
|
|
738
|
+
```
|
|
739
|
+
Synabun/
|
|
740
|
+
├── LICENSE # Apache 2.0 License
|
|
741
|
+
├── LICENSE-COMMERCIAL.md # Commercial licensing (Open Core model)
|
|
742
|
+
├── CONTRIBUTING.md # Bug reports, feature requests, and forking guide
|
|
743
|
+
├── CHANGELOG.md # Version history
|
|
744
|
+
├── SECURITY.md # Security policy
|
|
745
|
+
├── .env.example # Example environment configuration
|
|
746
|
+
├── .env # API key config (generated by setup wizard, gitignored)
|
|
747
|
+
├── setup.js # One-command setup & launch script
|
|
748
|
+
├── README.md # This file
|
|
749
|
+
├── CLAUDE.md # Claude Code project instructions (gitignored)
|
|
750
|
+
├── public/
|
|
751
|
+
│ ├── synabun.png # Logo
|
|
752
|
+
│ └── openclaw-logo-text.png # OpenClaw bridge logo
|
|
753
|
+
├── data/ # Runtime data directory
|
|
754
|
+
│ ├── memory.db # SQLite database (all memories + vectors)
|
|
755
|
+
│ ├── claude-code-projects.json # Tracked project paths with hook status
|
|
756
|
+
│ ├── hook-features.json # Hook feature flags (conversationMemory, greeting, userLearning)
|
|
757
|
+
│ ├── mcp-api-key.json # API key for HTTP MCP transport
|
|
758
|
+
│ ├── pending-compact/ # PreCompact enforcement flags (per session)
|
|
759
|
+
│ ├── pending-remember/ # Edit tracking flags (per session)
|
|
760
|
+
│ └── precompact/ # Session transcript cache (pre-compaction)
|
|
761
|
+
├── docs/
|
|
762
|
+
│ ├── usage-guide.md # Detailed usage patterns & best practices
|
|
763
|
+
│ ├── api-reference.md # Neural Interface REST API reference
|
|
764
|
+
│ └── hooks.md # Claude Code hook system documentation
|
|
765
|
+
├── skills/
|
|
766
|
+
│ ├── synabun/
|
|
767
|
+
│ │ ├── SKILL.md # /synabun command hub (entry point)
|
|
768
|
+
│ │ └── modules/
|
|
769
|
+
│ │ ├── idea.md # Brainstorm Ideas module
|
|
770
|
+
│ │ └── audit.md # Audit Memories module
|
|
771
|
+
│ └── leonardo/
|
|
772
|
+
│ ├── SKILL.md # /leonardo master media prompter
|
|
773
|
+
│ └── modules/
|
|
774
|
+
│ ├── video-prompter.md # 5-phase video creation questionnaire
|
|
775
|
+
│ ├── image-prompter.md # 5-phase image creation questionnaire
|
|
776
|
+
│ ├── model-advisor.md # Decision matrices for 30+ models
|
|
777
|
+
│ ├── prompt-library.md # Curated prompt templates
|
|
778
|
+
│ └── style-guide.md # Style stacking & motion controls
|
|
779
|
+
├── hooks/
|
|
780
|
+
│ └── claude-code/
|
|
781
|
+
│ ├── session-start.mjs # SessionStart — greeting, boot sequence, compaction recovery, session registration
|
|
782
|
+
│ ├── prompt-submit.mjs # UserPromptSubmit — tiered recall nudges, loop iteration injection
|
|
783
|
+
│ ├── pre-compact.mjs # PreCompact — transcript capture before compaction
|
|
784
|
+
│ ├── stop.mjs # Stop — combined obligations: compaction, loops, task memory, plans
|
|
785
|
+
│ ├── post-remember.mjs # PostToolUse — edit tracking, flag clearing, user learning
|
|
786
|
+
│ ├── pre-websearch.mjs # PreToolUse — blocks WebSearch during active browser sessions
|
|
787
|
+
│ └── post-plan.mjs # PostToolUse — auto-stores plans as memories
|
|
788
|
+
├── memory-seed/ # Bootstrap seed data for new installations
|
|
789
|
+
│ ├── README.md
|
|
790
|
+
│ ├── architecture/ # 5 architecture overview memories
|
|
791
|
+
│ ├── mcp-tools/ # 7 tool documentation memories
|
|
792
|
+
│ ├── neural-interface/ # 5 UI/API documentation memories
|
|
793
|
+
│ ├── hooks/ # 4 hook documentation memories
|
|
794
|
+
│ ├── setup/ # 3 setup/onboarding memories
|
|
795
|
+
│ └── development/ # 4 development guide memories
|
|
796
|
+
├── .tests/ # Vitest test suite
|
|
797
|
+
│ ├── vitest.config.ts
|
|
798
|
+
│ ├── unit/ # Tool-level unit tests (6 files)
|
|
799
|
+
│ ├── scenarios/ # Usage pattern + cost benchmark tests (5 files)
|
|
800
|
+
│ ├── mocks/ # SQLite/embedding mocks
|
|
801
|
+
│ └── utils/ # Test utilities
|
|
802
|
+
├── neural-interface/ # 3D visualization UI (http://localhost:3344)
|
|
803
|
+
│ ├── server.js # Express API — 55+ endpoints
|
|
804
|
+
│ ├── package.json
|
|
805
|
+
│ └── public/
|
|
806
|
+
│ ├── index.html # Three.js force-directed 3D graph
|
|
807
|
+
│ ├── index2d.html # 2D canvas visualization variant
|
|
808
|
+
│ ├── onboarding.html # Setup wizard
|
|
809
|
+
│ └── shared/ # Shared CSS/JS assets
|
|
810
|
+
└── mcp-server/ # MCP server (Node.js + TypeScript)
|
|
811
|
+
├── package.json
|
|
812
|
+
├── tsconfig.json
|
|
813
|
+
├── run.mjs # Entry wrapper (sets cwd, imports dist/)
|
|
814
|
+
├── data/
|
|
815
|
+
│ ├── custom-categories-*.json # Per-connection category definitions
|
|
816
|
+
│ └── display-settings.json # MCP response display config
|
|
817
|
+
├── dist/ # Compiled JS (generated by npm run build)
|
|
818
|
+
└── src/
|
|
819
|
+
├── index.ts # Tool registration + schema refresh (72 tools)
|
|
820
|
+
├── config.ts # Namespaced env config, project detection
|
|
821
|
+
├── types.ts # MemoryPayload interface (incl. file_checksums)
|
|
822
|
+
├── http.ts # HTTP MCP transport
|
|
823
|
+
├── tui.ts # Terminal UI for interactive management
|
|
824
|
+
├── services/
|
|
825
|
+
│ ├── sqlite.ts # SQLite storage layer (vectors as Float32 BLOBs)
|
|
826
|
+
│ ├── local-embeddings.ts # Local embedding generation (Transformers.js)
|
|
827
|
+
│ ├── categories.ts # Category CRUD, hierarchy, descriptions
|
|
828
|
+
│ └── file-checksums.ts # SHA-256 hashing for sync tool
|
|
829
|
+
└── tools/
|
|
830
|
+
├── remember.ts # Store a memory
|
|
831
|
+
├── recall.ts # Semantic search with time decay
|
|
832
|
+
├── forget.ts # Soft-delete (moves to trash)
|
|
833
|
+
├── restore.ts # Restore from trash
|
|
834
|
+
├── reflect.ts # Update a memory
|
|
835
|
+
├── memories.ts # List and stats
|
|
836
|
+
├── sync.ts # Stale memory detection via file hashes
|
|
837
|
+
├── category-create.ts # Create category (triggers schema refresh)
|
|
838
|
+
├── category-update.ts # Edit category (triggers schema refresh)
|
|
839
|
+
├── category-delete.ts # Delete category (triggers schema refresh)
|
|
840
|
+
├── category-list.ts # List categories with hierarchy
|
|
841
|
+
├── leonardo.ts # Leonardo.ai tool registration barrel (4 browser-based tools)
|
|
842
|
+
└── leonardo-browser-tools.ts # Browser-based generation, library, navigation, download
|
|
843
|
+
```
|
|
844
|
+
|
|
845
|
+
## License
|
|
846
|
+
|
|
847
|
+
Licensed under the [Apache License, Version 2.0](./LICENSE).
|
|
848
|
+
|
|
849
|
+
You are free to use, modify, and distribute SynaBun under Apache 2.0. Premium features and enterprise extensions may be offered under a separate commercial license. See [LICENSE-COMMERCIAL.md](./LICENSE-COMMERCIAL.md) for details.
|
|
850
|
+
|
|
851
|
+
## Trademark Notice
|
|
852
|
+
|
|
853
|
+
"SynaBun" is a trademark of its authors. The license does not grant permission to use the SynaBun name, trademarks, service marks, or branding. If you fork this project, you must use a different name for your derivative work.
|