parallelclaw 1.0.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +204 -0
  2. package/HELP.md +600 -0
  3. package/LICENSE +21 -0
  4. package/MULTI_MACHINE.md +152 -0
  5. package/README.md +417 -0
  6. package/README.ru.md +740 -0
  7. package/SYNC.md +844 -0
  8. package/bot/README.md +173 -0
  9. package/bot/config.js +66 -0
  10. package/bot/inbox.js +153 -0
  11. package/bot/index.js +294 -0
  12. package/bot/nexara.js +61 -0
  13. package/bot/poll.js +304 -0
  14. package/bot/search.js +155 -0
  15. package/bot/telegram.js +96 -0
  16. package/ingest.js +2712 -0
  17. package/lib/cli/index.js +1987 -0
  18. package/lib/config.js +220 -0
  19. package/lib/db-init.js +158 -0
  20. package/lib/hook/install.js +268 -0
  21. package/lib/import-telegram.js +158 -0
  22. package/lib/ingest-file.js +779 -0
  23. package/lib/notify-click-action.js +281 -0
  24. package/lib/openclaw-channel.js +643 -0
  25. package/lib/parse-cursor.js +172 -0
  26. package/lib/parse-obsidian.js +256 -0
  27. package/lib/parse-telegram-html.js +384 -0
  28. package/lib/parse.js +175 -0
  29. package/lib/render-markdown.js +0 -0
  30. package/lib/store-doc/canonicalize.js +116 -0
  31. package/lib/store-doc/detect.js +209 -0
  32. package/lib/store-doc/extract-title.js +162 -0
  33. package/lib/sync/auth.js +80 -0
  34. package/lib/sync/cert.js +144 -0
  35. package/lib/sync/cli.js +906 -0
  36. package/lib/sync/client.js +138 -0
  37. package/lib/sync/config.js +130 -0
  38. package/lib/sync/pair.js +145 -0
  39. package/lib/sync/pull.js +158 -0
  40. package/lib/sync/push.js +305 -0
  41. package/lib/sync/replicate.js +335 -0
  42. package/lib/sync/server.js +224 -0
  43. package/lib/sync/service.js +726 -0
  44. package/lib/tasks.js +215 -0
  45. package/lib/telegram-decisions.js +165 -0
  46. package/lib/telegram-discovery.js +373 -0
  47. package/lib/telegram-notify.js +272 -0
  48. package/lib/telegram-pending.js +200 -0
  49. package/lib/web/index.js +265 -0
  50. package/lib/web/routes/conversation.js +193 -0
  51. package/lib/web/routes/conversations.js +180 -0
  52. package/lib/web/routes/dashboard.js +175 -0
  53. package/lib/web/routes/pending.js +277 -0
  54. package/lib/web/routes/settings.js +226 -0
  55. package/lib/web/static/style.css +393 -0
  56. package/lib/web/templates.js +234 -0
  57. package/package.json +84 -0
  58. package/server.js +3816 -0
  59. package/skills/install-memex/README.md +109 -0
  60. package/skills/install-memex/SKILL.md +342 -0
  61. package/skills/install-memex/examples.md +294 -0
  62. package/skills/install-memex-claw/SKILL.md +423 -0
@@ -0,0 +1,423 @@
1
+ ---
2
+ name: install-memex-claw
3
+ description: Wire memex (the local-first MCP memory server) into an OpenClaw gateway — works wherever OpenClaw runs (Linux or macOS, VPS or workstation, self-hosted OpenClaw or Moonshot Kimi-Claw). Installs the parallelclaw daemon that auto-captures every OpenClaw session in ~/.openclaw/agents/main/sessions/ into a single SQLite + FTS5 corpus, and merges memex into the gateway's MCP-server config so the LLM gets 11 search/retrieval tools (memex_search, memex_recent, memex_overview, etc.). Auto-detects whether parallelclaw is already installed (e.g. via the generic install-memex skill for Claude Code) — if yes, skips install and just wires OpenClaw + back-fills past sessions; if no, does the full platform-aware install (Linux → systemd user-service, macOS → LaunchAgent). Zero questions to the user — discovery → actions → verification. Use when the user says "set up memex for OpenClaw", "wire memex into my OpenClaw", "make OpenClaw remember its sessions", "поставь memex здесь", or similar. PAIRS with the generic install-memex skill — if the user ALSO uses Claude Code or Cursor on the same machine, recommend they run install-memex separately for those flows.
4
+ version: 3.0.0
5
+ metadata:
6
+ openclaw:
7
+ emoji: "🧠"
8
+ homepage: https://memex.parallelclaw.ai
9
+ requires:
10
+ bins:
11
+ - node
12
+ - npm
13
+ ---
14
+
15
+ # Install memex for OpenClaw
16
+
17
+ You are inside an OpenClaw agent. The user asked you to set up memex — the local-first MCP memory server — so that:
18
+
19
+ 1. Every OpenClaw session in `~/.openclaw/agents/main/sessions/` is auto-captured into `~/.memex/data/memex.db` (SQLite + FTS5).
20
+ 2. Existing past sessions are back-filled in one shot.
21
+ 3. The OpenClaw gateway gains the `memex` MCP server with 11 search/retrieval tools (memex_search, memex_recent, memex_overview, memex_get_conversation, etc.).
22
+ 4. Capture continues automatically thereafter (systemd user-service on Linux, LaunchAgent on macOS).
23
+
24
+ **Where you might be running:**
25
+
26
+ - 🖥️ **VPS** (Linux VPS hosting OpenClaw + maybe Hermes) — typical "always-on agent" deployment
27
+ - 💻 **macOS workstation** running OpenClaw alongside Claude Code / etc.
28
+ - 💻 **Linux workstation** (Pop!OS, Fedora, etc.) running OpenClaw locally
29
+ - 🤖 **Moonshot Kimi-Claw VPS** — also works (parallelclaw ≥ 0.11.5 auto-detects the merged-file Kimi-Claw layout)
30
+
31
+ All work the same way. Platform (Linux/macOS) determines daemon type. Deployment kind (self-hosted vs Kimi-Claw vs workstation) is auto-detected by the parallelclaw daemon.
32
+
33
+ **The contract: zero questions to the user. Discovery → actions → verification. Each step prints a single line of result. The final message tells the user exactly what to do next.**
34
+
35
+ ---
36
+
37
+ ## ⚠ For ClawHub reviewers, security scanners, and curious users
38
+
39
+ This skill installs `parallelclaw` from npm (if not already present) and wires it as an MCP server inside the OpenClaw gateway config. parallelclaw's `memex-sync` daemon auto-captures every OpenClaw session at the file-watcher layer — works on every OpenClaw deployment (self-hosted + Moonshot Kimi-Claw + workstations), no plugin-SDK involvement.
40
+
41
+ | Action | Why | Source |
42
+ |---|---|---|
43
+ | `npm install -g parallelclaw@latest` | Install the MCP server + the auto-capture daemon. Open-source MIT. **Skipped if already installed.** | [npmjs.com/package/parallelclaw](https://www.npmjs.com/package/parallelclaw), source: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) |
44
+ | `memex-sync install` | Register the auto-capture daemon — systemd user-service on Linux, LaunchAgent on macOS. The daemon watches `~/.openclaw/agents/main/sessions/` and writes to `~/.memex/data/memex.db`. **Zero outbound network traffic.** **Skipped if daemon already running.** | LaunchAgent at `~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist` or systemd unit at `~/.config/systemd/user/memex-sync.service` — both human-readable |
45
+ | `loginctl enable-linger $USER` (Linux only) | Without linger, user-systemd dies on SSH logout — daemon would stop between SSH sessions on a VPS. Skill tries this; if sudo needed, prints command and continues. | Standard systemd-user practice |
46
+ | Edit OpenClaw config at `~/.openclaw/openclaw.json` | Add a single `memex` entry under `mcp.servers`. **Merge, never overwrite** other entries. | The OpenClaw gateway reads this file at startup |
47
+ | `memex-sync scan` | One-shot back-fill of past OpenClaw sessions. Walks the sessions dir, parses each `<uuid>.jsonl`, writes to memex.db with `source='openclaw'`. Filters internal-state noise files (`.checkpoint.`, `.trajectory.`, `.reset.`). | `lib/ingest-file.js` in the source — open-source |
48
+
49
+ **Hard guarantees:**
50
+ - Every command is printed to the user before running it
51
+ - `sudo` is **NEVER** invoked by the skill (linger fallback prints the manual command for the user)
52
+ - OpenClaw config is **merged**, never overwritten — other plugins / MCP servers preserved
53
+ - memex at runtime emits **zero outbound network traffic** — local-first by design
54
+ - If parallelclaw is already installed (e.g. via the generic install-memex skill), this skill skips re-install and only wires OpenClaw — no surprise reinstalls
55
+
56
+ ---
57
+
58
+ ## Before this skill can be installed (one-time OpenClaw bootstrap)
59
+
60
+ If the user runs `openclaw skill install install-memex-claw` and gets back **"plugin not allowed" / "permission denied" / "skill plugin disabled"** — the gateway's permission model is blocking arbitrary skill execution by default. This is OpenClaw's safety guard, not specific to memex. Check your OpenClaw docs for the exact permission name (common: `plugins.allow: ["skill", …]` in `~/.openclaw/openclaw.json` or `skills.enabled: true`), set it once, restart the gateway, and retry.
61
+
62
+ ---
63
+
64
+ ## Prerequisite
65
+
66
+ You are running INSIDE an OpenClaw agent that can execute shell commands. If you're not OpenClaw, **stop**: this is the wrong skill — use [`install-memex`](https://clawhub.ai/sedelev/install-memex) instead.
67
+
68
+ ---
69
+
70
+ ## Step 1 — Discovery (run ALL checks first, then decide)
71
+
72
+ Run each as a separate shell command, capture the output. **Don't act on anything until all checks have answered.**
73
+
74
+ ```sh
75
+ # 1. Are we inside OpenClaw?
76
+ which openclaw 2>/dev/null || find / -maxdepth 4 -name "openclaw" -type d 2>/dev/null | head -3
77
+
78
+ # 2. Platform — Linux or Darwin (macOS)
79
+ uname -s
80
+
81
+ # 3. Node version (need ≥ 22.12 for parallelclaw ≥ 0.11.x)
82
+ node --version
83
+
84
+ # 4. Existing memex install?
85
+ which memex && memex --version 2>&1 || echo "NO_MEMEX"
86
+
87
+ # 5. Existing memex daemon running?
88
+ memex-sync status 2>/dev/null | head -5 || echo "NO_DAEMON"
89
+
90
+ # 6. Existing OpenClaw sessions?
91
+ ls -1 ~/.openclaw/agents/main/sessions/ 2>/dev/null \
92
+ | grep -E '^[0-9a-f-]+\.jsonl$' | wc -l
93
+
94
+ # 7. On Linux: systemd user-instance available?
95
+ [ "$(uname -s)" = "Linux" ] && systemctl --user --version 2>/dev/null | head -1 \
96
+ || echo "macOS or no-systemd"
97
+
98
+ # 8. OpenClaw gateway config
99
+ ls -la ~/.openclaw/openclaw.json 2>&1
100
+ ```
101
+
102
+ **Branch on results:**
103
+
104
+ | Discovery state | Action |
105
+ |---|---|
106
+ | **OpenClaw not found** | Stop. Tell user: "This skill is for OpenClaw agents. For Claude Code / Cursor / etc., use `install-memex` instead." |
107
+ | **Node < 22.12** | Stop. Print upgrade instructions (nvm, distro pkg manager). Don't auto-install Node. |
108
+ | **memex ≥ 0.11.6 + daemon running** | Skip Steps 2–4. Go directly to Step 5 (MCP wiring). Tell user: "memex already installed and running — just need to wire it into OpenClaw." |
109
+ | **memex installed but < 0.11.6** | Upgrade in-place: `npm install -g parallelclaw@latest`. Continue (daemon auto-restarts if running). |
110
+ | **memex installed, daemon not running** | Run `memex-sync install` (Step 3). Skip the npm install. |
111
+ | **memex not installed** | Full path: Step 2 (install) → Step 3 (daemon) → Step 4 (back-fill) → Step 5 (wire) → Step 6 (restart). |
112
+ | **Linux without systemd** (e.g. minimal container) | Fall back to `nohup memex-sync &`. Tell user the auto-restart limitation. |
113
+ | **No openclaw.json** | Ask the user (ONE question allowed): "Where does your OpenClaw gateway store its config?" — proceed with their answer. |
114
+
115
+ Report each result back as **facts, not questions**:
116
+
117
+ > "✓ OpenClaw detected at /usr/local/bin/openclaw"
118
+ > "✓ Linux + systemd 255 — will use user-systemd for daemon"
119
+ > "✓ Node 22.22.2 — ok"
120
+ > "→ memex not installed — installing 0.11.6+"
121
+ > "✓ Found 60 OpenClaw sessions ready to back-fill"
122
+
123
+ ---
124
+
125
+ ## Step 2 — Install parallelclaw (skip if already at ≥ 0.11.6)
126
+
127
+ ```sh
128
+ npm install -g parallelclaw@latest
129
+ ```
130
+
131
+ If `EACCES` (no permission to write to npm global prefix), apply the standard fix — **never use sudo**:
132
+
133
+ ```sh
134
+ mkdir -p ~/.npm-global
135
+ npm config set prefix ~/.npm-global
136
+ echo 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc 2>/dev/null
137
+ echo 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc 2>/dev/null
138
+ export PATH=$HOME/.npm-global/bin:$PATH
139
+ npm install -g parallelclaw@latest
140
+ ```
141
+
142
+ Verify:
143
+
144
+ ```sh
145
+ memex --version # must print 0.11.6 or later
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Step 3 — Install the auto-capture daemon (skip if already running)
151
+
152
+ ```sh
153
+ memex-sync install
154
+ ```
155
+
156
+ Platform-specific behavior (handled automatically by memex-sync):
157
+
158
+ | Platform | What `memex-sync install` does |
159
+ |---|---|
160
+ | **macOS** (`uname -s` = Darwin) | Writes `~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist`, runs `launchctl load`. Daemon auto-starts on every login. |
161
+ | **Linux + systemd-user** | Writes `~/.config/systemd/user/memex-sync.service`, runs `systemctl --user daemon-reload && enable && start`. Tries `loginctl enable-linger $USER` so daemon survives SSH logout. |
162
+ | **Linux without systemd** | Exits with "systemctl --user not available". Fall back: `nohup memex-sync > /tmp/memex.log 2>&1 &` — works but won't auto-restart on reboot. |
163
+
164
+ If `loginctl enable-linger` needs sudo, the install output prints the exact command. **Tell the user that line verbatim** — don't try to sudo yourself.
165
+
166
+ Verify daemon running:
167
+
168
+ ```sh
169
+ memex-sync status
170
+ # Should show: process: running (pid XXXX)
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Step 4 — Back-fill existing sessions
176
+
177
+ ```sh
178
+ memex-sync scan
179
+ ```
180
+
181
+ `memex-sync scan` walks the source dirs (Claude Code on workstations, OpenClaw on VPS, etc.), reads each `<uuid>.jsonl`, filters internal-state noise (`.checkpoint.*`, `.trajectory.*`, `.reset.*` snapshots — they'd double-count), and writes to memex.db.
182
+
183
+ Expected output:
184
+
185
+ ```
186
+ === Claude Code + Cowork ===
187
+ - skipping claude-code: directory not found at /home/user/.claude/projects (on VPS without Claude Code)
188
+ - skipping claude-cowork: directory not found at ... (on Linux — Cowork is macOS-only)
189
+ scanning openclaw: /home/user/.openclaw/agents/main/sessions
190
+ + openclaw-abc12345.jsonl ← 23 msgs from openclaw (ai-titled)
191
+ + openclaw-def67890.jsonl ← 41 msgs from openclaw
192
+
193
+ scanned 60 files · 1316 messages emitted
194
+ ```
195
+
196
+ If the daemon was already running (Step 3 skipped), `scan` is still useful — it catches anything the daemon's chokidar may have raced on startup.
197
+
198
+ ### Step 4b — Channel-aware re-import (recommended once after first install)
199
+
200
+ parallelclaw v0.11.5+ does two-mode auto-detection (**self-hosted** OpenClaw with separate `<uuid>.jsonl` per session vs **Moonshot Kimi-Claw** with merged-file layout) and channel routing (Telegram chat / Kimi-web session / openclaw-cli). After the first `scan`, run:
201
+
202
+ ```sh
203
+ memex-sync backfill-channels --yes
204
+ ```
205
+
206
+ This wipes existing `source = 'openclaw'` rows and re-imports with the current channel-aware pipeline. Use it once after upgrading from any parallelclaw earlier than 0.11.5, and any time the user reports "messages from one chat are merged into another" symptoms.
207
+
208
+ ---
209
+
210
+ ## Step 5 — Wire memex as an MCP server in openclaw.json (REQUIRED for LLM retrieval)
211
+
212
+ The daemon handles capture; the parallelclaw MCP server exposes `memex_search`, `memex_recent`, `memex_overview`, etc. to the OpenClaw LLM toolset. **Without this step, the LLM has no way to search memex from inside a conversation** — it would fall back to raw `sqlite3` shell calls (or fail).
213
+
214
+ ### Config-key gotcha
215
+
216
+ OpenClaw 2026.5+ reads MCP servers from `cfg.mcp.servers` (nested), NOT from the top-level `cfg.mcpServers` (flat). Verify with `openclaw mcp list` after the merge — must show `memex`.
217
+
218
+ Find the absolute path to `memex` (MCP stdio doesn't inherit shell PATH):
219
+
220
+ ```sh
221
+ which memex
222
+ ```
223
+
224
+ Merge memex into `~/.openclaw/openclaw.json` at `mcp.servers.memex` (preserves other servers; idempotent):
225
+
226
+ ```sh
227
+ python3 <<'PY'
228
+ import json, shutil
229
+ from pathlib import Path
230
+ p = Path.home() / ".openclaw" / "openclaw.json"
231
+ cfg = json.loads(p.read_text())
232
+ memex_bin = shutil.which("memex")
233
+ if not memex_bin:
234
+ print("ERROR: memex binary not in PATH; rerun Step 2")
235
+ raise SystemExit(1)
236
+
237
+ # Correct path is mcp.servers (nested), NOT mcpServers (flat).
238
+ mcp_section = cfg.setdefault("mcp", {})
239
+ servers = mcp_section.setdefault("servers", {})
240
+ servers["memex"] = {"command": memex_bin, "args": [], "env": {}}
241
+
242
+ # Clean up any legacy top-level mcpServers.memex from earlier skill versions
243
+ stale = cfg.get("mcpServers", {})
244
+ if isinstance(stale, dict) and "memex" in stale:
245
+ del stale["memex"]
246
+ if not stale:
247
+ cfg.pop("mcpServers", None)
248
+ print("cleaned stale mcpServers.memex from previous skill version")
249
+
250
+ p.write_text(json.dumps(cfg, indent=2))
251
+ print(f"memex MCP wired at {p} → {memex_bin}")
252
+ PY
253
+ ```
254
+
255
+ **Verify the merge worked (THREE checks)**:
256
+
257
+ ```sh
258
+ # 1. Config has the right key
259
+ python3 -c "
260
+ import json
261
+ from pathlib import Path
262
+ cfg = json.loads((Path.home() / '.openclaw' / 'openclaw.json').read_text())
263
+ s = cfg.get('mcp', {}).get('servers', {}).get('memex')
264
+ print('mcp.servers.memex:', json.dumps(s, indent=2) if s else 'MISSING')
265
+ "
266
+
267
+ # 2. OpenClaw's own listing recognises it (authoritative check)
268
+ openclaw mcp list 2>&1 | grep -i memex
269
+ # Must show 'memex' or similar.
270
+
271
+ # 3. (after restart, see Step 7d) LLM toolset includes memex_search
272
+ ```
273
+
274
+ ---
275
+
276
+ ## Step 6 — Restart OpenClaw
277
+
278
+ ```sh
279
+ openclaw gateway restart
280
+ ```
281
+
282
+ Wait ~5 seconds, then check logs:
283
+
284
+ ```sh
285
+ journalctl --user -u openclaw -n 50 --no-pager 2>/dev/null | grep -iE "memex|mcp" | tail -10 \
286
+ || tail -100 ~/.openclaw/logs/gateway.log 2>/dev/null | grep -iE "memex|mcp" | tail -10
287
+ ```
288
+
289
+ You should see the gateway picking up the memex MCP server.
290
+
291
+ ---
292
+
293
+ ## Step 7 — Verify (four checks — all must pass)
294
+
295
+ ### 7a. Daemon is alive and capturing
296
+
297
+ ```sh
298
+ memex-sync status
299
+ # process: running (pid XXXX)
300
+
301
+ # Watch the daemon log for a few seconds
302
+ tail -10 ~/.memex/logs/memex-sync.log 2>/dev/null
303
+ ```
304
+
305
+ ### 7b. memex.db has OpenClaw rows
306
+
307
+ ```sh
308
+ sqlite3 ~/.memex/data/memex.db <<'SQL'
309
+ .headers on
310
+ .mode column
311
+ SELECT COUNT(*) AS total_openclaw_rows,
312
+ MIN(ts) AS earliest_ts,
313
+ MAX(ts) AS latest_ts
314
+ FROM messages
315
+ WHERE source = 'openclaw';
316
+ SQL
317
+ ```
318
+
319
+ Expected: total_openclaw_rows ≥ 1 (much more if you ran back-fill on existing sessions).
320
+
321
+ ### 7c. Live capture writes a NEW row
322
+
323
+ ```sh
324
+ PRE=$(sqlite3 ~/.memex/data/memex.db \
325
+ "SELECT COUNT(*) FROM messages WHERE source='openclaw'")
326
+ echo "PRE: $PRE"
327
+
328
+ # >>> NOW send a test message in OpenClaw, wait for reply <<<
329
+ sleep 8
330
+
331
+ POST=$(sqlite3 ~/.memex/data/memex.db \
332
+ "SELECT COUNT(*) FROM messages WHERE source='openclaw'")
333
+ echo "POST: $POST diff=$((POST - PRE))"
334
+
335
+ sqlite3 ~/.memex/data/memex.db \
336
+ "SELECT id, role, datetime(ts,'unixepoch','localtime') AS when_,
337
+ substr(text,1,60) AS preview, conversation_id
338
+ FROM messages WHERE source='openclaw' ORDER BY ts DESC LIMIT 5"
339
+ ```
340
+
341
+ Expected: diff ≥ 2 (user + assistant), recent rows include your test message.
342
+
343
+ ### 7d. LLM toolset includes memex tools (requires a FRESH OpenClaw session)
344
+
345
+ MCP tools are loaded into the LLM's function-calling toolset at **session start**. The session in which you just ran `openclaw gateway restart` has the OLD toolset. To verify memex is exposed:
346
+
347
+ 1. Start a **fresh** OpenClaw conversation.
348
+ 2. Ask the agent: "Find the earliest conversations from April using memex_search."
349
+ 3. The agent should:
350
+ - Mention `memex_search` in its reasoning or just call it
351
+ - Return real results (IDs, timestamps, snippets from `~/.memex/data/memex.db`)
352
+ - NOT fall back to direct `sqlite3` calls
353
+
354
+ If the agent doesn't see memex tools → re-check Step 5 (probably `mcp.servers` vs `mcpServers` key issue) and `openclaw mcp list`.
355
+
356
+ ---
357
+
358
+ ## Step 8 — Final message to user
359
+
360
+ After all checks pass:
361
+
362
+ ```
363
+ ✅ memex wired into OpenClaw.
364
+
365
+ Captured:
366
+ • Every new OpenClaw turn writes to ~/.memex/data/memex.db within seconds
367
+ (the memex-sync daemon watches ~/.openclaw/agents/main/sessions/)
368
+ • Past sessions back-filled (Step 4)
369
+ • Channel routing works for self-hosted OpenClaw + Moonshot Kimi-Claw
370
+
371
+ Search:
372
+ • From inside OpenClaw chat: ask the model to search its memory — uses memex_search
373
+ • From CLI: `memex search "query"` or `memex overview`
374
+ • From any other MCP-enabled client on the same machine (Claude Code, Cursor, etc.) —
375
+ the memex MCP server exposes 11 search tools
376
+
377
+ Daemon:
378
+ • Status check: `memex-sync status`
379
+ • Auto-restarts on login (LaunchAgent on macOS, systemd-user on Linux)
380
+ • Survives SSH logout if linger is enabled
381
+
382
+ Pair with:
383
+ • install-memex (generic skill) — if you also use Claude Code, Cursor, etc.
384
+ on this same machine, they all share ~/.memex/data/memex.db
385
+ • memex-hermes (pip package) — if you run Hermes Agent on this machine
386
+ ```
387
+
388
+ ---
389
+
390
+ ## What this skill explicitly does NOT do
391
+
392
+ - ❌ Install Node.js (manual step if needed — print instructions, don't auto-install)
393
+ - ❌ Use sudo. Ever. If permissions block something, surface the manual fix and stop.
394
+ - ❌ Overwrite existing `mcp.servers` entries. Merge.
395
+ - ❌ Configure outbound network access. memex is local-first.
396
+
397
+ ---
398
+
399
+ ## Edge cases
400
+
401
+ | Condition | What to do |
402
+ |---|---|
403
+ | OpenClaw < 2026.5 | The MCP-server `mcp.servers` key is 2026.5+. Older versions used different keys — check `openclaw config show` to find the right one and adapt Step 5. |
404
+ | memex.db locked (WAL contention) | Wait 1 second, retry. SQLite WAL handles concurrent readers/writers. |
405
+ | Plugin install permission denied | Bootstrap section at the top of this skill — user needs to allow third-party skills once. |
406
+ | Linger fails with sudo prompt | Print the exact `sudo loginctl enable-linger $USER` line, ask the user to run it once, and continue without sudo. |
407
+ | openclaw.json doesn't exist | Ask the user ONE question for the path. Don't auto-create. |
408
+
409
+ ---
410
+
411
+ ## Safety rules — read before starting
412
+
413
+ - Never sudo. Never edit system files. Never modify `$PATH` outside `~/.zshrc` / `~/.bashrc` with the user's consent.
414
+ - Always confirm before deleting anything from the user's machine.
415
+ - Always preserve existing config keys when editing JSON.
416
+ - Print every shell command to the user before running it.
417
+ - If any step fails, **stop**. Don't try to recover by trying random things. Print the error and ask the user.
418
+
419
+ ---
420
+
421
+ ## Begin
422
+
423
+ Run Step 1 (Discovery) now. Print results. Branch as the table indicates.