@sym-bot/sym 0.1.0 → 0.2.1
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/PRD.md +1 -1
- package/README.md +237 -70
- package/TECHNICAL-SPEC.md +250 -197
- package/bin/setup-claude.sh +31 -1
- package/bin/sym-daemon.js +437 -0
- package/docs/mesh-memory-protocol.md +563 -0
- package/docs/mmp-architecture-image-prompt.txt +12 -0
- package/docs/p2p-protocol-research.md +907 -0
- package/docs/protocol-wake.md +242 -0
- package/integrations/claude-code/mcp-server.js +264 -41
- package/integrations/telegram/bot.js +418 -0
- package/lib/ipc-client.js +241 -0
- package/lib/node.js +489 -39
- package/lib/transport.js +88 -0
- package/package.json +5 -3
- package/sym-relay/Dockerfile +7 -0
- package/sym-relay/lib/logger.js +28 -0
- package/sym-relay/lib/relay.js +388 -0
- package/sym-relay/package-lock.json +40 -0
- package/sym-relay/package.json +18 -0
- package/sym-relay/render.yaml +14 -0
- package/sym-relay/server.js +67 -0
- package/.mcp.json +0 -12
package/PRD.md
CHANGED
|
@@ -166,7 +166,7 @@ SYM is the product layer. The SDK is the engine.
|
|
|
166
166
|
| **Audience** | App developers | AI tool users |
|
|
167
167
|
| **Decision** | Drift evaluation | Memory, mood, peer coupling |
|
|
168
168
|
| **Platform** | TypeScript, Python, Swift | Node.js, Swift |
|
|
169
|
-
| **Install** | `npm install mesh-cognition` | `npm install sym` / SPM |
|
|
169
|
+
| **Install** | `npm install mesh-cognition` | `npm install @sym-bot/sym` / SPM |
|
|
170
170
|
|
|
171
171
|
---
|
|
172
172
|
|
package/README.md
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
# SYM
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Reference implementation of the [Mesh Memory Protocol (MMP)](https://sym.bot/protocol) — every agent is a sovereign node.**
|
|
4
4
|
|
|
5
5
|
Your AI agents share everything or nothing. There's no intelligence in the decision. SYM adds the missing layer — each node encodes its context into a cognitive state, and the coupling engine evaluates drift before sharing. Aligned agents share knowledge. Divergent agents stay independent. The architecture decides, not policy.
|
|
6
6
|
|
|
7
|
-
[](https://www.npmjs.com/package/sym)
|
|
7
|
+
[](https://www.npmjs.com/package/@sym-bot/sym)
|
|
8
8
|
[](LICENSE)
|
|
9
|
+
[](https://sym.bot/protocol)
|
|
9
10
|
|
|
10
11
|
---
|
|
11
12
|
|
|
12
13
|
## Quick Start
|
|
13
14
|
|
|
14
15
|
```bash
|
|
15
|
-
|
|
16
|
-
cd sym && npm install
|
|
16
|
+
npm install @sym-bot/sym
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
```javascript
|
|
20
|
-
const { SymNode } = require('
|
|
20
|
+
const { SymNode } = require('@sym-bot/sym');
|
|
21
21
|
|
|
22
|
-
const node = new SymNode({
|
|
22
|
+
const node = new SymNode({
|
|
23
|
+
name: 'my-agent',
|
|
24
|
+
cognitiveProfile: 'Coding assistant that understands bugs, APIs, and debugging',
|
|
25
|
+
});
|
|
23
26
|
await node.start();
|
|
24
27
|
|
|
25
28
|
node.remember('race condition in order processing', { tags: ['bug'] });
|
|
@@ -28,7 +31,49 @@ node.recall('order');
|
|
|
28
31
|
await node.stop();
|
|
29
32
|
```
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
Peers on the same network discover each other automatically via Bonjour. Peers across the internet connect through the WebSocket relay. The coupling engine decides what to share.
|
|
35
|
+
|
|
36
|
+
## sym-daemon
|
|
37
|
+
|
|
38
|
+
The daemon is your device's persistent mesh presence — a **physical node** that runs continuously as a background service. It maintains relay connections, Bonjour discovery, and peer state even when no apps are running.
|
|
39
|
+
|
|
40
|
+
### Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Install the daemon as a launchd LaunchAgent (macOS)
|
|
44
|
+
node bin/sym-daemon.js --install
|
|
45
|
+
|
|
46
|
+
# Check daemon status
|
|
47
|
+
node bin/sym-daemon.js --status
|
|
48
|
+
|
|
49
|
+
# Remove the daemon
|
|
50
|
+
node bin/sym-daemon.js --uninstall
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
On macOS, the daemon installs as a launchd LaunchAgent that:
|
|
54
|
+
- **Auto-starts on login** — mesh presence begins immediately
|
|
55
|
+
- **Auto-restarts on crash** — the mesh never goes down
|
|
56
|
+
- **Maintains relay connection permanently** — internet peers always reachable
|
|
57
|
+
|
|
58
|
+
### Physical and Virtual Nodes
|
|
59
|
+
|
|
60
|
+
The daemon introduces a two-tier node model:
|
|
61
|
+
|
|
62
|
+
- **Physical node** (sym-daemon) — the device itself. One per machine. Always running. Owns the relay connection, Bonjour identity, and peer state.
|
|
63
|
+
- **Virtual nodes** (apps) — Claude Code, MeloTune Mac, or any app that connects to the daemon via Unix socket IPC at `/tmp/sym.sock`.
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
MacBook (sym-daemon, always running)
|
|
67
|
+
├── Claude Code (virtual node, via IPC)
|
|
68
|
+
├── MeloTune Mac (virtual node, via IPC)
|
|
69
|
+
│
|
|
70
|
+
├── Bonjour (LAN peers)
|
|
71
|
+
└── Relay (internet peers)
|
|
72
|
+
├── MeloTune iPhone
|
|
73
|
+
└── Telegram bot
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
When Claude Code restarts, the mesh doesn't break. The daemon holds the connection. When Claude Code starts again, it reconnects to the daemon via IPC and resumes where it left off. The mesh is the daemon — apps come and go.
|
|
32
77
|
|
|
33
78
|
## Cognitive Coupling
|
|
34
79
|
|
|
@@ -41,12 +86,12 @@ SYM doesn't blindly broadcast. Each node encodes its memories into a hidden stat
|
|
|
41
86
|
```
|
|
42
87
|
Three agents. Two work on APIs. One writes a food blog.
|
|
43
88
|
|
|
44
|
-
API Dev ↔ API Fix: drift 0.
|
|
45
|
-
API Dev ↔ Blogger: drift 1.
|
|
46
|
-
API Fix ↔ Blogger: drift 1.
|
|
89
|
+
API Dev ↔ API Fix: drift 0.38 → guarded (related context, shared with reduced confidence)
|
|
90
|
+
API Dev ↔ Blogger: drift 1.19 → rejected (unrelated context)
|
|
91
|
+
API Fix ↔ Blogger: drift 1.18 → rejected (unrelated context)
|
|
47
92
|
|
|
48
93
|
API Dev remembers "race condition in order processing"
|
|
49
|
-
→ Shared with API Fix ✓
|
|
94
|
+
→ Shared with API Fix ✓ (guarded — related domain)
|
|
50
95
|
→ Not shared with Blogger ✗ (rejected by coupling engine)
|
|
51
96
|
```
|
|
52
97
|
|
|
@@ -54,41 +99,51 @@ The blogger never sees the API bug. The architecture decided — no policy, no r
|
|
|
54
99
|
|
|
55
100
|
## How It Works
|
|
56
101
|
|
|
57
|
-
There is no central service. Each
|
|
102
|
+
There is no central service. Each device runs a sym-daemon that maintains its mesh identity, memory, and cognitive state. Apps connect to the daemon as virtual nodes. The mesh emerges from peer connections between physical nodes.
|
|
58
103
|
|
|
59
104
|
```
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
│
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
└────────┼────────┘ └────────┼───────┘ └────────┼───────┘
|
|
69
|
-
│ │ │
|
|
70
|
-
└──── MMP P2P ───────┴──── MMP P2P ──────┘
|
|
71
|
-
|
|
72
|
-
discover → encode → exchange state → evaluate drift → couple or reject
|
|
105
|
+
MacBook (sym-daemon, always running)
|
|
106
|
+
├── Claude Code (virtual node, via IPC)
|
|
107
|
+
├── MeloTune Mac (virtual node, via IPC)
|
|
108
|
+
│
|
|
109
|
+
├── Bonjour (LAN peers)
|
|
110
|
+
└── Relay (internet peers)
|
|
111
|
+
├── MeloTune iPhone
|
|
112
|
+
└── Telegram bot
|
|
73
113
|
```
|
|
74
114
|
|
|
75
|
-
Each node:
|
|
76
|
-
-
|
|
77
|
-
-
|
|
115
|
+
Each physical node:
|
|
116
|
+
- Declares its cognitive identity via `cognitiveProfile`
|
|
117
|
+
- Encodes context into a hidden state vector (context encoder)
|
|
118
|
+
- Discovers local peers via Bonjour/mDNS (`_sym._tcp`)
|
|
119
|
+
- Connects to remote peers via WebSocket relay
|
|
78
120
|
- Exchanges cognitive state with peers
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
- Evaluates incoming mood against own cognitive state — the SDK's coupling engine decides whether to act
|
|
121
|
+
- Shares memories only with aligned peers (drift ≤ 0.5)
|
|
122
|
+
- Evaluates incoming mood with configurable `moodThreshold` (default 0.8)
|
|
82
123
|
- Re-encodes periodically as context evolves
|
|
124
|
+
- Accepts virtual node connections via Unix socket IPC (`/tmp/sym.sock`)
|
|
83
125
|
|
|
84
|
-
|
|
126
|
+
Each virtual node:
|
|
127
|
+
- Connects to the local daemon via IPC — no direct network access needed
|
|
128
|
+
- Sends memories, moods, and messages through the daemon
|
|
129
|
+
- Receives mesh events (peer joins, coupling decisions, incoming memories)
|
|
130
|
+
- Can start and stop independently without disrupting the mesh
|
|
131
|
+
|
|
132
|
+
One engine makes every decision. Memory sharing, peer coupling, and mood relevance all go through the [Mesh Cognition SDK](https://github.com/sym-bot/mesh-cognition-sdk)'s `SemanticCoupler`.
|
|
85
133
|
|
|
86
134
|
## API
|
|
87
135
|
|
|
88
136
|
```javascript
|
|
89
|
-
const { SymNode } = require('sym');
|
|
90
|
-
|
|
91
|
-
const node = new SymNode({
|
|
137
|
+
const { SymNode } = require('@sym-bot/sym');
|
|
138
|
+
|
|
139
|
+
const node = new SymNode({
|
|
140
|
+
name: 'my-agent',
|
|
141
|
+
cognitiveProfile: 'What this agent understands and responds to',
|
|
142
|
+
moodThreshold: 0.8, // how permissive to mood signals (default 0.8)
|
|
143
|
+
relay: 'wss://your-relay.example.com', // optional relay for internet mesh
|
|
144
|
+
relayToken: 'shared-secret', // optional relay auth token
|
|
145
|
+
relayOnly: false, // skip Bonjour, relay only (default false)
|
|
146
|
+
});
|
|
92
147
|
await node.start();
|
|
93
148
|
|
|
94
149
|
// Memory (shared only with cognitively aligned peers)
|
|
@@ -108,8 +163,8 @@ node.on('mood-rejected', ({ from, mood, drift }) => {
|
|
|
108
163
|
node.send(message);
|
|
109
164
|
node.on('message', (from, content) => {});
|
|
110
165
|
|
|
111
|
-
// Monitoring
|
|
112
|
-
node.peers(); // [{ name, coupling: 'aligned', drift: 0.12 }, ...]
|
|
166
|
+
// Monitoring
|
|
167
|
+
node.peers(); // [{ name, coupling: 'aligned', drift: 0.12, source: 'relay' }, ...]
|
|
113
168
|
node.coherence(); // Overall mesh coherence
|
|
114
169
|
node.status(); // Full node status
|
|
115
170
|
|
|
@@ -122,48 +177,122 @@ node.on('memory-received', ({ from, entry, decision }) => {});
|
|
|
122
177
|
await node.stop();
|
|
123
178
|
```
|
|
124
179
|
|
|
180
|
+
## Transport
|
|
181
|
+
|
|
182
|
+
SYM supports multiple transport layers that can run simultaneously:
|
|
183
|
+
|
|
184
|
+
### Bonjour (LAN)
|
|
185
|
+
|
|
186
|
+
Zero-configuration discovery on the local network. Peers find each other automatically via `_sym._tcp` mDNS. Direct TCP connections with length-prefixed JSON framing. No setup required.
|
|
187
|
+
|
|
188
|
+
### WebSocket Relay (Internet)
|
|
189
|
+
|
|
190
|
+
For mesh cognition across the internet. A lightweight relay server forwards frames between authenticated nodes. The relay is a **peer, not infrastructure** — it participates in the mesh with its own identity but makes no coupling decisions on behalf of other nodes.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Deploy your own relay
|
|
194
|
+
cd sym-relay
|
|
195
|
+
npm install
|
|
196
|
+
SYM_RELAY_TOKEN=your-secret node server.js
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
```javascript
|
|
200
|
+
// Connect a node to the relay
|
|
201
|
+
const node = new SymNode({
|
|
202
|
+
name: 'my-agent',
|
|
203
|
+
relay: 'wss://your-relay.example.com',
|
|
204
|
+
relayToken: 'your-secret',
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Hybrid mode** (default): nodes discover local peers via Bonjour AND connect to the relay for remote peers. Same node, same coupling engine, two transport layers.
|
|
209
|
+
|
|
210
|
+
The relay server provides:
|
|
211
|
+
- Token-based authentication
|
|
212
|
+
- Health endpoint (`GET /health`)
|
|
213
|
+
- 30-second heartbeat (keeps connections alive on cloud platforms)
|
|
214
|
+
- Peer join/leave notifications
|
|
215
|
+
- Targeted or broadcast frame forwarding
|
|
216
|
+
|
|
217
|
+
### Peer Gossip
|
|
218
|
+
|
|
219
|
+
Wake channels propagate through the relay via **SWIM-style gossip**. When a node announces a wake channel (e.g., APNs device token), the relay gossips this to all connected peers. Peers cache wake routes so they can reach sleeping nodes without centralized routing tables. The relay participates in gossip as a peer — it doesn't manage routing, it just propagates what it hears.
|
|
220
|
+
|
|
221
|
+
### Wake Transport (APNs)
|
|
222
|
+
|
|
223
|
+
For nodes that sleep — like MeloTune on a backgrounded iPhone. When an iOS app is suspended, it can't maintain a WebSocket connection. SYM solves this with **push notification wake**.
|
|
224
|
+
|
|
225
|
+
When Claude Code broadcasts a mood and MeloTune's iPhone is sleeping:
|
|
226
|
+
1. Claude Code sends the mood frame to the relay
|
|
227
|
+
2. The relay knows MeloTune's APNs device token (via gossip)
|
|
228
|
+
3. The relay sends a push notification to wake MeloTune
|
|
229
|
+
4. MeloTune wakes, reconnects to the relay, receives the mood frame
|
|
230
|
+
5. The coupling engine evaluates drift — MeloTune decides whether to act
|
|
231
|
+
|
|
232
|
+
The mesh reaches every node, even sleeping ones. No polling. No battery drain. The push is a wake signal only — payload evaluation happens on-device after wake.
|
|
233
|
+
|
|
125
234
|
## Integrations
|
|
126
235
|
|
|
127
236
|
### Claude Code
|
|
128
237
|
|
|
129
|
-
SYM bridges Claude Code's memory system to the mesh. No extra commands needed.
|
|
130
|
-
|
|
131
238
|
```bash
|
|
132
|
-
|
|
133
|
-
cd sym
|
|
239
|
+
npm install @sym-bot/sym
|
|
240
|
+
cd node_modules/@sym-bot/sym
|
|
134
241
|
./bin/setup-claude.sh /path/to/your/project
|
|
135
242
|
```
|
|
136
243
|
|
|
137
244
|
One command. Adds MCP server, auto-approves `sym_mood` (no permission prompts), and installs CLAUDE.md instructions for autonomous mood detection. Restart Claude Code and it just works.
|
|
138
245
|
|
|
246
|
+
With sym-daemon running, Claude Code connects as a virtual node via IPC — no direct relay connection needed.
|
|
247
|
+
|
|
139
248
|
**Outbound:** Claude Code saves a memory → SYM detects it → encodes cognitive state → shares with aligned peers only.
|
|
140
249
|
|
|
141
250
|
**Inbound:** Peer memory arrives → coupling engine accepts it → SYM writes it to your Claude Code memory directory → Claude Code reads it in the next conversation.
|
|
142
251
|
|
|
143
|
-
Explicit tools are also available for direct mesh interaction:
|
|
144
|
-
|
|
145
252
|
| Tool | What it does |
|
|
146
253
|
|------|-------------|
|
|
254
|
+
| `sym_mood` | Proactively broadcasts detected mood to the mesh |
|
|
147
255
|
| `sym_remember` | Store a memory directly to the mesh |
|
|
148
256
|
| `sym_recall` | Search memories across the mesh |
|
|
257
|
+
| `sym_send` | Send a message to all peers |
|
|
149
258
|
| `sym_peers` | Show connected peers with coupling state and drift |
|
|
150
259
|
| `sym_status` | Full node status — identity, peers, memory count, coherence |
|
|
151
260
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
Start agents on different machines on the same network. Bonjour discovers peers automatically. No configuration.
|
|
261
|
+
To connect Claude Code to the relay, set environment variables:
|
|
155
262
|
|
|
263
|
+
```bash
|
|
264
|
+
export SYM_RELAY_URL=wss://your-relay.example.com
|
|
265
|
+
export SYM_RELAY_TOKEN=your-secret
|
|
156
266
|
```
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
267
|
+
|
|
268
|
+
### Telegram
|
|
269
|
+
|
|
270
|
+
A multi-tenant Telegram bot — each user gets their own isolated SYM mesh node with separate identity, memory, and coupling state.
|
|
271
|
+
|
|
272
|
+
**Public bot:** Message [@sym_mesh_bot](https://t.me/sym_mesh_bot) on Telegram and send `/start` to connect.
|
|
273
|
+
|
|
274
|
+
**Self-hosted:**
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
TELEGRAM_BOT_TOKEN=your-bot-token \
|
|
278
|
+
SYM_RELAY_TOKEN=your-secret \
|
|
279
|
+
node integrations/telegram/bot.js
|
|
160
280
|
```
|
|
161
281
|
|
|
162
|
-
|
|
282
|
+
Commands:
|
|
283
|
+
- `/start` — connect to the SYM mesh
|
|
284
|
+
- `/peers` — connected mesh peers
|
|
285
|
+
- `/mood <text>` — broadcast mood to mesh
|
|
286
|
+
- `/remember <text>` — store memory in mesh
|
|
287
|
+
- `/recall <query>` — search mesh memories
|
|
288
|
+
- `/stop` — disconnect from mesh
|
|
289
|
+
- Any plain text — broadcast as a mood signal
|
|
290
|
+
|
|
291
|
+
Mesh events (peer joins, messages, mood signals, coupling decisions) are forwarded to your chat. Sessions auto-disconnect after 30 minutes of inactivity.
|
|
163
292
|
|
|
164
293
|
## Demo: Autonomous Mood Detection
|
|
165
294
|
|
|
166
|
-
You're coding with Claude Code for hours. You say "I'm exhausted." You didn't ask for music. But Claude Code detected your fatigue, broadcast your mood to the mesh, and MeloTune on your iPhone started playing
|
|
295
|
+
You're coding with Claude Code for hours. You say "I'm exhausted." You didn't ask for music. But Claude Code detected your fatigue, broadcast your mood to the mesh, and MeloTune on your iPhone started playing spa music. Autonomously.
|
|
167
296
|
|
|
168
297
|
```
|
|
169
298
|
You (in Claude Code): "I'm exhausted"
|
|
@@ -171,14 +300,14 @@ You (in Claude Code): "I'm exhausted"
|
|
|
171
300
|
Claude Code: detects fatigue → calls sym_mood silently
|
|
172
301
|
→ broadcasts "exhausted, persistently fatigued, urgently needs rest"
|
|
173
302
|
│
|
|
174
|
-
SYM mesh (
|
|
303
|
+
SYM mesh (daemon → Relay → APNs wake → MeloTune)
|
|
175
304
|
│
|
|
176
305
|
MeloTune (iPhone): SymNode receives mood frame
|
|
177
|
-
→ SDK coupling engine evaluates drift: 0.
|
|
306
|
+
→ SDK coupling engine evaluates drift: 0.62
|
|
178
307
|
→ cognitiveProfile includes "tired, exhausted, rest"
|
|
179
|
-
→ drift 0.
|
|
308
|
+
→ drift 0.62 ≤ moodThreshold 1.2 → ACCEPTED
|
|
180
309
|
→ rule-based parser: recovery, rest → Healing
|
|
181
|
-
→ Apple Music:
|
|
310
|
+
→ Apple Music: spa playlist
|
|
182
311
|
→ zero LLM tokens
|
|
183
312
|
→ you didn't ask — the agents decided
|
|
184
313
|
```
|
|
@@ -187,40 +316,78 @@ MeloTune (iPhone): SymNode receives mood frame
|
|
|
187
316
|
|
|
188
317
|
| Evaluation | Drift | Threshold | Decision |
|
|
189
318
|
|-----------|-------|-----------|----------|
|
|
190
|
-
| Memory coupling | 1.
|
|
191
|
-
| Mood coupling | 0.
|
|
319
|
+
| Memory coupling | 1.06 | 0.50 | Rejected — coding memories don't leak into music context |
|
|
320
|
+
| Mood coupling | 0.62 | 1.20 | Accepted — "exhausted" aligns with MeloTune's cognitiveProfile |
|
|
192
321
|
|
|
193
322
|
The SDK's `SemanticCoupler` makes every decision. The agent's `cognitiveProfile` declares what it understands. The `moodThreshold` controls how permissive the agent is to mood signals. No routing tables. No capability registration. The engine decides.
|
|
194
323
|
|
|
195
|
-
Also works
|
|
324
|
+
Also works via Telegram:
|
|
196
325
|
|
|
197
326
|
```
|
|
198
|
-
|
|
199
|
-
→
|
|
327
|
+
You (in Telegram): @sym_mesh_bot → "Play classic music"
|
|
328
|
+
→ MeloTune plays Modern Classical via Apple Music
|
|
200
329
|
```
|
|
201
330
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
-
|
|
331
|
+
## Verified in Production
|
|
332
|
+
|
|
333
|
+
- Mac Claude Code → iPhone MeloTune — autonomous mood-based playback via SYM mesh (APNs wake for backgrounded iOS)
|
|
334
|
+
- Telegram [@sym_mesh_bot](https://t.me/sym_mesh_bot) → Relay → MeloTune — internet-scale mood relay (multi-tenant)
|
|
335
|
+
- Mac Claude Code ↔ Windows Claude Code — P2P memory sharing via Bonjour
|
|
336
|
+
- Node.js ↔ Swift — cross-platform mesh via Bonjour and WebSocket relay
|
|
337
|
+
- sym-daemon → Claude Code + MeloTune Mac — persistent mesh via IPC, survives app restarts
|
|
338
|
+
|
|
339
|
+
## Semantic vs Neural Coupling
|
|
205
340
|
|
|
206
|
-
|
|
341
|
+
The SDK supports two coupling modes through the same API. The mode is selected automatically based on whether per-neuron time constants (τ) are provided.
|
|
207
342
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
343
|
+
### Semantic Coupling
|
|
344
|
+
|
|
345
|
+
For AI agents sharing memory. Uniform coupling across all hidden state dimensions. No trained model needed. Used by Claude Code, Telegram, LangChain, and multi-agent coordination.
|
|
346
|
+
|
|
347
|
+
```
|
|
348
|
+
Claude Code ↔ Claude Code: drift 0.38 → guarded → share memories with reduced confidence
|
|
349
|
+
Claude Code ↔ Food Blogger: drift 1.19 → rejected → no sharing
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Neural Coupling
|
|
353
|
+
|
|
354
|
+
For trained CfC neural networks with per-neuron time constants. Fast-τ neurons (emotion, ~1s) sync quickly between devices. Slow-τ neurons (context/memory, ~5s) stay independent. Real Kuramoto phase coherence r(t).
|
|
355
|
+
|
|
356
|
+
**In practice — two MeloTune devices on the same mesh:**
|
|
357
|
+
|
|
358
|
+
| What | Behaviour |
|
|
359
|
+
|------|-----------|
|
|
360
|
+
| **Fast neurons** (low τ) | Sync quickly — both devices converge on emotional trajectory |
|
|
361
|
+
| **Slow neurons** (high τ) | Stay independent — each device retains its own listening context |
|
|
362
|
+
| **Genre selection** | Per-device — iPhone plays Ambient, Mac plays Lo-Fi |
|
|
363
|
+
| **Track selection** | Per-device — never the same tracks |
|
|
364
|
+
| **Mood trajectory** | Shared — iPhone at E:45 N:25, Mac drifts toward E:46 N:36 |
|
|
365
|
+
| **Coherence** | r(t) = 0.94 — high alignment, strong mutual influence |
|
|
366
|
+
|
|
367
|
+
The coupling engine blends peer state into the local trajectory at each inference step. Influence strength scales with coherence — highly aligned peers have more effect. If you shift one device to high energy, the other gradually follows (fast neurons). But each device's genre, history, and track selection remain sovereign.
|
|
211
368
|
|
|
212
369
|
## Privacy
|
|
213
370
|
|
|
214
|
-
- All
|
|
215
|
-
-
|
|
371
|
+
- All coupling decisions stay on-device
|
|
372
|
+
- The relay is a peer — it never inspects frame payloads
|
|
373
|
+
- The daemon runs locally — no cloud dependency
|
|
216
374
|
- Memories stored locally — delete the directory, everything is gone
|
|
217
375
|
- Bonjour discovery only on local network
|
|
376
|
+
- Relay connections authenticated via shared token
|
|
218
377
|
- Rejected peers never receive your memories
|
|
378
|
+
- APNs wake is a signal only — no payload leaves the device until the coupling engine approves
|
|
379
|
+
- No cloud AI. No account. No telemetry.
|
|
380
|
+
|
|
381
|
+
## Platforms
|
|
382
|
+
|
|
383
|
+
- [@sym-bot/sym](https://www.npmjs.com/package/@sym-bot/sym) — Node.js (npm)
|
|
384
|
+
- [sym-swift](https://github.com/sym-bot/sym-swift) — Swift (SPM) for iOS/macOS
|
|
219
385
|
|
|
220
386
|
## Built On
|
|
221
387
|
|
|
222
|
-
SYM is
|
|
388
|
+
SYM is the reference implementation of the [Mesh Memory Protocol (MMP)](https://sym.bot/protocol). MMP is the protocol for collective intelligence. SYM implements it.
|
|
223
389
|
|
|
390
|
+
- [MMP Protocol Spec](https://sym.bot/protocol) — the protocol specification (v0.2.0)
|
|
224
391
|
- [Whitepaper](https://sym.bot/research/mesh-cognition) — the science behind cognitive coupling
|
|
225
392
|
- [Mesh Cognition SDK](https://github.com/sym-bot/mesh-cognition-sdk) — the coupling engine (TypeScript, Python, Swift)
|
|
226
393
|
|