[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77JKSDGTK0VW0PBDJKQPKYN":3,"skill-same:01M77JKSDGTK0VW0PBDJKQPKYN":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M77JKSDGTK0VW0PBDJKQPKYN","install-memex-claw",null,"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 memex-mvp daemon that auto-captures every OpenClaw session in ~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F into a single SQLite + FTS5 corpus, and merges memex into the gateway's MCP-server config so the LLM gets 11 search\u002Fretrieval tools (memex_search, memex_recent, memex_overview, etc.). Auto-detects whether memex-mvp 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, Cursor, Cline, Continue, or Zed on the same machine, recommend they run install-memex separately for those flows.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fi\u002Finstall-memex-claw\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: install-memex-claw\ndescription: 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 memex-mvp daemon that auto-captures every OpenClaw session in ~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F into a single SQLite + FTS5 corpus, and merges memex into the gateway's MCP-server config so the LLM gets 11 search\u002Fretrieval tools (memex_search, memex_recent, memex_overview, etc.). Auto-detects whether memex-mvp 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, Cursor, Cline, Continue, or Zed on the same machine, recommend they run install-memex separately for those flows.\nversion: 3.0.0\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    homepage: https:\u002F\u002Fmemex.parallelclaw.ai\n    requires:\n      bins:\n        - node\n        - npm\n---\n\n# Install memex for OpenClaw\n\nYou are inside an OpenClaw agent. The user asked you to set up memex — the local-first MCP memory server — so that:\n\n1. Every OpenClaw session in `~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F` is auto-captured into `~\u002F.memex\u002Fdata\u002Fmemex.db` (SQLite + FTS5).\n2. Existing past sessions are back-filled in one shot.\n3. The OpenClaw gateway gains the `memex` MCP server with 11 search\u002Fretrieval tools (memex_search, memex_recent, memex_overview, memex_get_conversation, etc.).\n4. Capture continues automatically thereafter (systemd user-service on Linux, LaunchAgent on macOS).\n\n**Where you might be running:**\n\n- 🖥️ **VPS** (Linux VPS hosting OpenClaw + maybe Hermes) — typical \"always-on agent\" deployment\n- 💻 **macOS workstation** running OpenClaw alongside Claude Code \u002F etc.\n- 💻 **Linux workstation** (Pop!OS, Fedora, etc.) running OpenClaw locally\n- 🤖 **Moonshot Kimi-Claw VPS** — also works (memex-mvp ≥ 0.11.5 auto-detects the merged-file Kimi-Claw layout)\n\nAll work the same way. Platform (Linux\u002FmacOS) determines daemon type. Deployment kind (self-hosted vs Kimi-Claw vs workstation) is auto-detected by the memex-mvp daemon.\n\n**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.**\n\n---\n\n## ⚠ For ClawHub reviewers, security scanners, and curious users\n\nThis skill installs `memex-mvp` from npm (if not already present) and wires it as an MCP server inside the OpenClaw gateway config. memex-mvp is the canonical install path for OpenClaw — the older \"memex-openclaw OpenClaw-native plugin\" approach (npm package `@parallelclaw\u002Fmemex-openclaw`) is **deprecated** as of 2026-05-27; see deprecation notes in that package's README. The daemon path works on every OpenClaw deployment without security-scanner friction.\n\n| Action | Why | Source |\n|---|---|---|\n| `npm install -g memex-mvp@latest` | Install the MCP server + the auto-capture daemon. Open-source MIT. **Skipped if already installed.** | [npmjs.com\u002Fpackage\u002Fmemex-mvp](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmemex-mvp), source: [github.com\u002Fparallelclaw\u002Fmemex-mvp](https:\u002F\u002Fgithub.com\u002Fparallelclaw\u002Fmemex-mvp) |\n| `memex-sync install` | Register the auto-capture daemon — systemd user-service on Linux, LaunchAgent on macOS. The daemon watches `~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F` and writes to `~\u002F.memex\u002Fdata\u002Fmemex.db`. **Zero outbound network traffic.** **Skipped if daemon already running.** | LaunchAgent at `~\u002FLibrary\u002FLaunchAgents\u002Fcom.parallelclaw.memex.sync.plist` or systemd unit at `~\u002F.config\u002Fsystemd\u002Fuser\u002Fmemex-sync.service` — both human-readable |\n| `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 |\n| Edit OpenClaw config at `~\u002F.openclaw\u002Fopenclaw.json` | Add a single `memex` entry under `mcp.servers`. **Merge, never overwrite** other entries. | The OpenClaw gateway reads this file at startup |\n| `memex-sync scan` | One-shot back-fill of past OpenClaw sessions. Walks the sessions dir, parses each `\u003Cuuid>.jsonl`, writes to memex.db with `source='openclaw'`. Filters internal-state noise files (`.checkpoint.`, `.trajectory.`, `.reset.`). | `lib\u002Fingest-file.js` in the source — open-source |\n\n**Hard guarantees:**\n- Every command is printed to the user before running it\n- `sudo` is **NEVER** invoked by the skill (linger fallback prints the manual command for the user)\n- OpenClaw config is **merged**, never overwritten — other plugins \u002F MCP servers preserved\n- memex at runtime emits **zero outbound network traffic** — local-first by design\n- If memex-mvp is already installed (e.g. via the generic install-memex skill), this skill skips re-install and only wires OpenClaw — no surprise reinstalls\n\n---\n\n## Migration note for users who tried the deprecated `memex-openclaw` plugin\n\nIf the user previously installed `@parallelclaw\u002Fmemex-openclaw` via `openclaw plugins install`, that plugin is now **deprecated**. The daemon-based approach below handles the same use case more reliably (no OpenClaw plugin security-scanner friction, no per-version manifest changes, no `allowConversationAccess` opt-in). To clean up before installing daemon-based:\n\n```sh\n# 1. Uninstall the old plugin (no-op if not installed)\nopenclaw plugins uninstall memex-openclaw 2>&1 || true\n\n# 2. Restore openclaw.json from the .bak the plugin left (if you want to undo the plugin's edits)\n[ -f ~\u002F.openclaw\u002Fopenclaw.json.bak ] && echo \"found backup, you can restore via:\" \\\n  && echo \"  cp ~\u002F.openclaw\u002Fopenclaw.json.bak ~\u002F.openclaw\u002Fopenclaw.json\"\n\n# 3. Restart gateway so the old plugin stops loading\nopenclaw gateway restart\n```\n\nThe data the old plugin wrote (`raw_type='openclaw-agent-end'` rows) stays in memex.db and remains searchable — the daemon's writes will appear alongside under the same source. UNIQUE(source, conversation_id, msg_id) prevents duplicates.\n\n---\n\n## Before this skill can be installed (one-time OpenClaw bootstrap)\n\nIf the user runs `openclaw skill install install-memex-claw` and gets back **\"plugin not allowed\" \u002F \"permission denied\" \u002F \"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 `~\u002F.openclaw\u002Fopenclaw.json` or `skills.enabled: true`), set it once, restart the gateway, and retry.\n\n---\n\n## Prerequisite\n\nYou 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:\u002F\u002Fclawhub.ai\u002Fsedelev\u002Finstall-memex) instead.\n\n---\n\n## Step 1 — Discovery (run ALL checks first, then decide)\n\nRun each as a separate shell command, capture the output. **Don't act on anything until all checks have answered.**\n\n```sh\n# 1. Are we inside OpenClaw?\nwhich openclaw 2>\u002Fdev\u002Fnull || find \u002F -maxdepth 4 -name \"openclaw\" -type d 2>\u002Fdev\u002Fnull | head -3\n\n# 2. Platform — Linux or Darwin (macOS)\nuname -s\n\n# 3. Node version (need ≥ 22.12 for memex-mvp ≥ 0.11.x)\nnode --version\n\n# 4. Existing memex install?\nwhich memex && memex --version 2>&1 || echo \"NO_MEMEX\"\n\n# 5. Existing memex daemon running?\nmemex-sync status 2>\u002Fdev\u002Fnull | head -5 || echo \"NO_DAEMON\"\n\n# 6. Existing OpenClaw sessions?\nls -1 ~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F 2>\u002Fdev\u002Fnull \\\n  | grep -E '^[0-9a-f-]+\\.jsonl$' | wc -l\n\n# 7. On Linux: systemd user-instance available?\n[ \"$(uname -s)\" = \"Linux\" ] && systemctl --user --version 2>\u002Fdev\u002Fnull | head -1 \\\n  || echo \"macOS or no-systemd\"\n\n# 8. OpenClaw gateway config\nls -la ~\u002F.openclaw\u002Fopenclaw.json 2>&1\n\n# 9. Was the deprecated memex-openclaw plugin previously installed?\nls -la ~\u002F.openclaw\u002Fnpm\u002Fnode_modules\u002F@parallelclaw\u002Fmemex-openclaw 2>\u002Fdev\u002Fnull \\\n  || echo \"no old plugin\"\n```\n\n**Branch on results:**\n\n| Discovery state | Action |\n|---|---|\n| **OpenClaw not found** | Stop. Tell user: \"This skill is for OpenClaw agents. For Claude Code \u002F Cursor \u002F etc., use `install-memex` instead.\" |\n| **Node \u003C 22.12** | Stop. Print upgrade instructions (nvm, distro pkg manager). Don't auto-install Node. |\n| **Deprecated plugin found at ~\u002F.openclaw\u002Fnpm\u002Fnode_modules\u002F@parallelclaw\u002Fmemex-openclaw** | Run the migration block from the section above BEFORE proceeding to Step 2. |\n| **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.\" |\n| **memex installed but \u003C 0.11.6** | Upgrade in-place: `npm install -g memex-mvp@latest`. Continue (daemon auto-restarts if running). |\n| **memex installed, daemon not running** | Run `memex-sync install` (Step 3). Skip the npm install. |\n| **memex not installed** | Full path: Step 2 (install) → Step 3 (daemon) → Step 4 (back-fill) → Step 5 (wire) → Step 6 (restart). |\n| **Linux without systemd** (e.g. minimal container) | Fall back to `nohup memex-sync &`. Tell user the auto-restart limitation. |\n| **No openclaw.json** | Ask the user (ONE question allowed): \"Where does your OpenClaw gateway store its config?\" — proceed with their answer. |\n\nReport each result back as **facts, not questions**:\n\n> \"✓ OpenClaw detected at \u002Fusr\u002Flocal\u002Fbin\u002Fopenclaw\"  \n> \"✓ Linux + systemd 255 — will use user-systemd for daemon\"  \n> \"✓ Node 22.22.2 — ok\"  \n> \"→ memex not installed — installing 0.11.6+\"  \n> \"✓ Found 60 OpenClaw sessions ready to back-fill\"  \n> \"⚠ Deprecated memex-openclaw plugin detected — will uninstall first\"\n\n---\n\n## Step 2 — Install memex-mvp (skip if already at ≥ 0.11.6)\n\n```sh\nnpm install -g memex-mvp@latest\n```\n\nIf `EACCES` (no permission to write to npm global prefix), apply the standard fix — **never use sudo**:\n\n```sh\nmkdir -p ~\u002F.npm-global\nnpm config set prefix ~\u002F.npm-global\necho 'export PATH=$HOME\u002F.npm-global\u002Fbin:$PATH' >> ~\u002F.zshrc 2>\u002Fdev\u002Fnull\necho 'export PATH=$HOME\u002F.npm-global\u002Fbin:$PATH' >> ~\u002F.bashrc 2>\u002Fdev\u002Fnull\nexport PATH=$HOME\u002F.npm-global\u002Fbin:$PATH\nnpm install -g memex-mvp@latest\n```\n\nVerify:\n\n```sh\nmemex --version    # must print 0.11.6 or later\n```\n\n---\n\n## Step 3 — Install the auto-capture daemon (skip if already running)\n\n```sh\nmemex-sync install\n```\n\nPlatform-specific behavior (handled automatically by memex-sync):\n\n| Platform | What `memex-sync install` does |\n|---|---|\n| **macOS** (`uname -s` = Darwin) | Writes `~\u002FLibrary\u002FLaunchAgents\u002Fcom.parallelclaw.memex.sync.plist`, runs `launchctl load`. Daemon auto-starts on every login. |\n| **Linux + systemd-user** | Writes `~\u002F.config\u002Fsystemd\u002Fuser\u002Fmemex-sync.service`, runs `systemctl --user daemon-reload && enable && start`. Tries `loginctl enable-linger $USER` so daemon survives SSH logout. |\n| **Linux without systemd** | Exits with \"systemctl --user not available\". Fall back: `nohup memex-sync > \u002Ftmp\u002Fmemex.log 2>&1 &` — works but won't auto-restart on reboot. |\n\nIf `loginctl enable-linger` needs sudo, the install output prints the exact command. **Tell the user that line verbatim** — don't try to sudo yourself.\n\nVerify daemon running:\n\n```sh\nmemex-sync status\n# Should show: process: running (pid XXXX)\n```\n\n---\n\n## Step 4 — Back-fill existing sessions\n\n```sh\nmemex-sync scan\n```\n\n`memex-sync scan` walks the source dirs (Claude Code on workstations, OpenClaw on VPS, etc.), reads each `\u003Cuuid>.jsonl`, filters internal-state noise (`.checkpoint.*`, `.trajectory.*`, `.reset.*` snapshots — they'd double-count), and writes to memex.db.\n\nExpected output:\n\n```\n=== Claude Code + Cowork ===\n- skipping claude-code: directory not found at \u002Fhome\u002Fuser\u002F.claude\u002Fprojects   (on VPS without Claude Code)\n- skipping claude-cowork: directory not found at ...                          (on Linux — Cowork is macOS-only)\nscanning openclaw: \u002Fhome\u002Fuser\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\n+ openclaw-abc12345.jsonl ← 23 msgs from openclaw (ai-titled)\n+ openclaw-def67890.jsonl ← 41 msgs from openclaw\n…\nscanned 60 files · 1316 messages emitted\n```\n\nIf the daemon was already running (Step 3 skipped), `scan` is still useful — it catches anything the daemon's chokidar may have raced on startup.\n\n### Step 4b — Channel-aware re-import (recommended once after first install)\n\nmemex-mvp v0.11.5+ does two-mode auto-detection (**self-hosted** OpenClaw with separate `\u003Cuuid>.jsonl` per session vs **Moonshot Kimi-Claw** with merged-file layout) and channel routing (Telegram chat \u002F Kimi-web session \u002F openclaw-cli). After the first `scan`, run:\n\n```sh\nmemex-sync backfill-channels --yes\n```\n\nThis wipes existing `source = 'openclaw'` rows and re-imports with the current channel-aware pipeline. Use it once after upgrading from any memex-mvp earlier than 0.11.5, and any time the user reports \"messages from one chat are merged into another\" symptoms.\n\n---\n\n## Step 5 — Wire memex as an MCP server in openclaw.json (REQUIRED for LLM retrieval)\n\nThe daemon handles capture; the memex-mvp 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).\n\n### Config-key gotcha\n\nOpenClaw 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`.\n\nFind the absolute path to `memex` (MCP stdio doesn't inherit shell PATH):\n\n```sh\nwhich memex\n```\n\nMerge memex into `~\u002F.openclaw\u002Fopenclaw.json` at `mcp.servers.memex` (preserves other servers; idempotent):\n\n```sh\npython3 \u003C\u003C'PY'\nimport json, shutil\nfrom pathlib import Path\np = Path.home() \u002F \".openclaw\" \u002F \"openclaw.json\"\ncfg = json.loads(p.read_text())\nmemex_bin = shutil.which(\"memex\")\nif not memex_bin:\n    print(\"ERROR: memex binary not in PATH; rerun Step 2\")\n    raise SystemExit(1)\n\n# Correct path is mcp.servers (nested), NOT mcpServers (flat).\nmcp_section = cfg.setdefault(\"mcp\", {})\nservers = mcp_section.setdefault(\"servers\", {})\nservers[\"memex\"] = {\"command\": memex_bin, \"args\": [], \"env\": {}}\n\n# Clean up any legacy top-level mcpServers.memex from earlier skill versions\nstale = cfg.get(\"mcpServers\", {})\nif isinstance(stale, dict) and \"memex\" in stale:\n    del stale[\"memex\"]\n    if not stale:\n        cfg.pop(\"mcpServers\", None)\n    print(\"cleaned stale mcpServers.memex from previous skill version\")\n\np.write_text(json.dumps(cfg, indent=2))\nprint(f\"memex MCP wired at {p} → {memex_bin}\")\nPY\n```\n\n**Verify the merge worked (THREE checks)**:\n\n```sh\n# 1. Config has the right key\npython3 -c \"\nimport json\nfrom pathlib import Path\ncfg = json.loads((Path.home() \u002F '.openclaw' \u002F 'openclaw.json').read_text())\ns = cfg.get('mcp', {}).get('servers', {}).get('memex')\nprint('mcp.servers.memex:', json.dumps(s, indent=2) if s else 'MISSING')\n\"\n\n# 2. OpenClaw's own listing recognises it (authoritative check)\nopenclaw mcp list 2>&1 | grep -i memex\n# Must show 'memex' or similar.\n\n# 3. (after restart, see Step 7d) LLM toolset includes memex_search\n```\n\n---\n\n## Step 6 — Restart OpenClaw\n\n```sh\nopenclaw gateway restart\n```\n\nWait ~5 seconds, then check logs:\n\n```sh\njournalctl --user -u openclaw -n 50 --no-pager 2>\u002Fdev\u002Fnull | grep -iE \"memex|mcp\" | tail -10 \\\n  || tail -100 ~\u002F.openclaw\u002Flogs\u002Fgateway.log 2>\u002Fdev\u002Fnull | grep -iE \"memex|mcp\" | tail -10\n```\n\nYou should see the gateway picking up the memex MCP server.\n\n---\n\n## Step 7 — Verify (four checks — all must pass)\n\n### 7a. Daemon is alive and capturing\n\n```sh\nmemex-sync status\n# process: running (pid XXXX)\n\n# Watch the daemon log for a few seconds\ntail -10 ~\u002F.memex\u002Flogs\u002Fmemex-sync.log 2>\u002Fdev\u002Fnull\n```\n\n### 7b. memex.db has OpenClaw rows\n\n```sh\nsqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \u003C\u003C'SQL'\n.headers on\n.mode column\nSELECT COUNT(*) AS total_openclaw_rows,\n       MIN(ts) AS earliest_ts,\n       MAX(ts) AS latest_ts\n  FROM messages\n WHERE source = 'openclaw';\nSQL\n```\n\nExpected: total_openclaw_rows ≥ 1 (much more if you ran back-fill on existing sessions).\n\n### 7c. Live capture writes a NEW row\n\n```sh\nPRE=$(sqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\necho \"PRE: $PRE\"\n\n# >>> NOW send a test message in OpenClaw, wait for reply \u003C\u003C\u003C\nsleep 8\n\nPOST=$(sqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\necho \"POST: $POST  diff=$((POST - PRE))\"\n\nsqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \\\n  \"SELECT id, role, datetime(ts,'unixepoch','localtime') AS when_,\n          substr(text,1,60) AS preview, conversation_id\n     FROM messages WHERE source='openclaw' ORDER BY ts DESC LIMIT 5\"\n```\n\nExpected: diff ≥ 2 (user + assistant), recent rows include your test message.\n\n### 7d. LLM toolset includes memex tools (requires a FRESH OpenClaw session)\n\nMCP 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:\n\n1. Start a **fresh** OpenClaw conversation.\n2. Ask the agent: \"Find the earliest conversations from April using memex_search.\"\n3. The agent should:\n   - Mention `memex_search` in its reasoning or just call it\n   - Return real results (IDs, timestamps, snippets from `~\u002F.memex\u002Fdata\u002Fmemex.db`)\n   - NOT fall back to direct `sqlite3` calls\n\nIf the agent doesn't see memex tools → re-check Step 5 (probably `mcp.servers` vs `mcpServers` key issue) and `openclaw mcp list`.\n\n---\n\n## Step 8 — Final message to user\n\nAfter all checks pass:\n\n```\n✅ memex wired into OpenClaw.\n\nCaptured:\n  • Every new OpenClaw turn writes to ~\u002F.memex\u002Fdata\u002Fmemex.db within seconds\n    (the memex-sync daemon watches ~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F)\n  • Past sessions back-filled (Step 4)\n  • Channel routing works for self-hosted OpenClaw + Moonshot Kimi-Claw\n\nSearch:\n  • From inside OpenClaw chat: ask the model to search its memory — uses memex_search\n  • From CLI: `memex search \"query\"` or `memex overview`\n  • From any other MCP-enabled client on the same machine (Claude Code, Cursor, etc.) —\n    the memex MCP server exposes 11 search tools\n\nDaemon:\n  • Status check: `memex-sync status`\n  • Auto-restarts on login (LaunchAgent on macOS, systemd-user on Linux)\n  • Survives SSH logout if linger is enabled\n\nPair with:\n  • install-memex (generic skill) — if you also use Claude Code, Cursor, Cline, etc.\n    on this same machine, they all share ~\u002F.memex\u002Fdata\u002Fmemex.db\n  • memex-hermes (pip package) — if you run Hermes Agent on this machine\n```\n\n---\n\n## What this skill explicitly does NOT do\n\n- ❌ Install Node.js (manual step if needed — print instructions, don't auto-install)\n- ❌ Use sudo. Ever. If permissions block something, surface the manual fix and stop.\n- ❌ Install the deprecated `@parallelclaw\u002Fmemex-openclaw` plugin. The daemon path supersedes it.\n- ❌ Overwrite existing `mcp.servers` entries. Merge.\n- ❌ Configure outbound network access. memex is local-first.\n\n---\n\n## Edge cases\n\n| Condition | What to do |\n|---|---|\n| OpenClaw \u003C 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. |\n| memex.db locked (WAL contention) | Wait 1 second, retry. SQLite WAL handles concurrent readers\u002Fwriters. |\n| Plugin install permission denied | Bootstrap section at the top of this skill — user needs to allow third-party skills once. |\n| 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. |\n| User has the deprecated memex-openclaw plugin AND already-captured data from it | The plugin's data (raw_type='openclaw-agent-end') stays in memex.db. Daemon's new writes will appear alongside under the same source. UNIQUE constraint prevents duplicates. |\n| User wants to delete legacy plugin data | `sqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \"DELETE FROM messages WHERE source='openclaw' AND json_extract(metadata,'$.raw_type')='openclaw-agent-end'\"` — careful, irreversible |\n| openclaw.json doesn't exist | Ask the user ONE question for the path. Don't auto-create. |\n\n---\n\n## Safety rules — read before starting\n\n- Never sudo. Never edit system files. Never modify `$PATH` outside `~\u002F.zshrc` \u002F `~\u002F.bashrc` with the user's consent.\n- Always confirm before deleting anything from the user's machine.\n- Always preserve existing config keys when editing JSON.\n- Print every shell command to the user before running it.\n- If any step fails, **stop**. Don't try to recover by trying random things. Print the error and ask the user.\n\n---\n\n## Begin\n\nRun Step 1 (Discovery) now. Print results. Branch as the table indicates.\n","# Install memex for OpenClaw\n\nYou are inside an OpenClaw agent. The user asked you to set up memex — the local-first MCP memory server — so that:\n\n1. Every OpenClaw session in `~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F` is auto-captured into `~\u002F.memex\u002Fdata\u002Fmemex.db` (SQLite + FTS5).\n2. Existing past sessions are back-filled in one shot.\n3. The OpenClaw gateway gains the `memex` MCP server with 11 search\u002Fretrieval tools (memex_search, memex_recent, memex_overview, memex_get_conversation, etc.).\n4. Capture continues automatically thereafter (systemd user-service on Linux, LaunchAgent on macOS).\n\n**Where you might be running:**\n\n- 🖥️ **VPS** (Linux VPS hosting OpenClaw + maybe Hermes) — typical \"always-on agent\" deployment\n- 💻 **macOS workstation** running OpenClaw alongside Claude Code \u002F etc.\n- 💻 **Linux workstation** (Pop!OS, Fedora, etc.) running OpenClaw locally\n- 🤖 **Moonshot Kimi-Claw VPS** — also works (memex-mvp ≥ 0.11.5 auto-detects the merged-file Kimi-Claw layout)\n\nAll work the same way. Platform (Linux\u002FmacOS) determines daemon type. Deployment kind (self-hosted vs Kimi-Claw vs workstation) is auto-detected by the memex-mvp daemon.\n\n**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.**\n\n---\n\n## ⚠ For ClawHub reviewers, security scanners, and curious users\n\nThis skill installs `memex-mvp` from npm (if not already present) and wires it as an MCP server inside the OpenClaw gateway config. memex-mvp is the canonical install path for OpenClaw — the older \"memex-openclaw OpenClaw-native plugin\" approach (npm package `@parallelclaw\u002Fmemex-openclaw`) is **deprecated** as of 2026-05-27; see deprecation notes in that package's README. The daemon path works on every OpenClaw deployment without security-scanner friction.\n\n| Action | Why | Source |\n|---|---|---|\n| `npm install -g memex-mvp@latest` | Install the MCP server + the auto-capture daemon. Open-source MIT. **Skipped if already installed.** | [npmjs.com\u002Fpackage\u002Fmemex-mvp](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fmemex-mvp), source: [github.com\u002Fparallelclaw\u002Fmemex-mvp](https:\u002F\u002Fgithub.com\u002Fparallelclaw\u002Fmemex-mvp) |\n| `memex-sync install` | Register the auto-capture daemon — systemd user-service on Linux, LaunchAgent on macOS. The daemon watches `~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F` and writes to `~\u002F.memex\u002Fdata\u002Fmemex.db`. **Zero outbound network traffic.** **Skipped if daemon already running.** | LaunchAgent at `~\u002FLibrary\u002FLaunchAgents\u002Fcom.parallelclaw.memex.sync.plist` or systemd unit at `~\u002F.config\u002Fsystemd\u002Fuser\u002Fmemex-sync.service` — both human-readable |\n| `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 |\n| Edit OpenClaw config at `~\u002F.openclaw\u002Fopenclaw.json` | Add a single `memex` entry under `mcp.servers`. **Merge, never overwrite** other entries. | The OpenClaw gateway reads this file at startup |\n| `memex-sync scan` | One-shot back-fill of past OpenClaw sessions. Walks the sessions dir, parses each `\u003Cuuid>.jsonl`, writes to memex.db with `source='openclaw'`. Filters internal-state noise files (`.checkpoint.`, `.trajectory.`, `.reset.`). | `lib\u002Fingest-file.js` in the source — open-source |\n\n**Hard guarantees:**\n- Every command is printed to the user before running it\n- `sudo` is **NEVER** invoked by the skill (linger fallback prints the manual command for the user)\n- OpenClaw config is **merged**, never overwritten — other plugins \u002F MCP servers preserved\n- memex at runtime emits **zero outbound network traffic** — local-first by design\n- If memex-mvp is already installed (e.g. via the generic install-memex skill), this skill skips re-install and only wires OpenClaw — no surprise reinstalls\n\n---\n\n## Migration note for users who tried the deprecated `memex-openclaw` plugin\n\nIf the user previously installed `@parallelclaw\u002Fmemex-openclaw` via `openclaw plugins install`, that plugin is now **deprecated**. The daemon-based approach below handles the same use case more reliably (no OpenClaw plugin security-scanner friction, no per-version manifest changes, no `allowConversationAccess` opt-in). To clean up before installing daemon-based:\n\n```sh\n# 1. Uninstall the old plugin (no-op if not installed)\nopenclaw plugins uninstall memex-openclaw 2>&1 || true\n\n# 2. Restore openclaw.json from the .bak the plugin left (if you want to undo the plugin's edits)\n[ -f ~\u002F.openclaw\u002Fopenclaw.json.bak ] && echo \"found backup, you can restore via:\" \\\n  && echo \"  cp ~\u002F.openclaw\u002Fopenclaw.json.bak ~\u002F.openclaw\u002Fopenclaw.json\"\n\n# 3. Restart gateway so the old plugin stops loading\nopenclaw gateway restart\n```\n\nThe data the old plugin wrote (`raw_type='openclaw-agent-end'` rows) stays in memex.db and remains searchable — the daemon's writes will appear alongside under the same source. UNIQUE(source, conversation_id, msg_id) prevents duplicates.\n\n---\n\n## Before this skill can be installed (one-time OpenClaw bootstrap)\n\nIf the user runs `openclaw skill install install-memex-claw` and gets back **\"plugin not allowed\" \u002F \"permission denied\" \u002F \"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 `~\u002F.openclaw\u002Fopenclaw.json` or `skills.enabled: true`), set it once, restart the gateway, and retry.\n\n---\n\n## Prerequisite\n\nYou 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:\u002F\u002Fclawhub.ai\u002Fsedelev\u002Finstall-memex) instead.\n\n---\n\n## Step 1 — Discovery (run ALL checks first, then decide)\n\nRun each as a separate shell command, capture the output. **Don't act on anything until all checks have answered.**\n\n```sh\n# 1. Are we inside OpenClaw?\nwhich openclaw 2>\u002Fdev\u002Fnull || find \u002F -maxdepth 4 -name \"openclaw\" -type d 2>\u002Fdev\u002Fnull | head -3\n\n# 2. Platform — Linux or Darwin (macOS)\nuname -s\n\n# 3. Node version (need ≥ 22.12 for memex-mvp ≥ 0.11.x)\nnode --version\n\n# 4. Existing memex install?\nwhich memex && memex --version 2>&1 || echo \"NO_MEMEX\"\n\n# 5. Existing memex daemon running?\nmemex-sync status 2>\u002Fdev\u002Fnull | head -5 || echo \"NO_DAEMON\"\n\n# 6. Existing OpenClaw sessions?\nls -1 ~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F 2>\u002Fdev\u002Fnull \\\n  | grep -E '^[0-9a-f-]+\\.jsonl$' | wc -l\n\n# 7. On Linux: systemd user-instance available?\n[ \"$(uname -s)\" = \"Linux\" ] && systemctl --user --version 2>\u002Fdev\u002Fnull | head -1 \\\n  || echo \"macOS or no-systemd\"\n\n# 8. OpenClaw gateway config\nls -la ~\u002F.openclaw\u002Fopenclaw.json 2>&1\n\n# 9. Was the deprecated memex-openclaw plugin previously installed?\nls -la ~\u002F.openclaw\u002Fnpm\u002Fnode_modules\u002F@parallelclaw\u002Fmemex-openclaw 2>\u002Fdev\u002Fnull \\\n  || echo \"no old plugin\"\n```\n\n**Branch on results:**\n\n| Discovery state | Action |\n|---|---|\n| **OpenClaw not found** | Stop. Tell user: \"This skill is for OpenClaw agents. For Claude Code \u002F Cursor \u002F etc., use `install-memex` instead.\" |\n| **Node \u003C 22.12** | Stop. Print upgrade instructions (nvm, distro pkg manager). Don't auto-install Node. |\n| **Deprecated plugin found at ~\u002F.openclaw\u002Fnpm\u002Fnode_modules\u002F@parallelclaw\u002Fmemex-openclaw** | Run the migration block from the section above BEFORE proceeding to Step 2. |\n| **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.\" |\n| **memex installed but \u003C 0.11.6** | Upgrade in-place: `npm install -g memex-mvp@latest`. Continue (daemon auto-restarts if running). |\n| **memex installed, daemon not running** | Run `memex-sync install` (Step 3). Skip the npm install. |\n| **memex not installed** | Full path: Step 2 (install) → Step 3 (daemon) → Step 4 (back-fill) → Step 5 (wire) → Step 6 (restart). |\n| **Linux without systemd** (e.g. minimal container) | Fall back to `nohup memex-sync &`. Tell user the auto-restart limitation. |\n| **No openclaw.json** | Ask the user (ONE question allowed): \"Where does your OpenClaw gateway store its config?\" — proceed with their answer. |\n\nReport each result back as **facts, not questions**:\n\n> \"✓ OpenClaw detected at \u002Fusr\u002Flocal\u002Fbin\u002Fopenclaw\"  \n> \"✓ Linux + systemd 255 — will use user-systemd for daemon\"  \n> \"✓ Node 22.22.2 — ok\"  \n> \"→ memex not installed — installing 0.11.6+\"  \n> \"✓ Found 60 OpenClaw sessions ready to back-fill\"  \n> \"⚠ Deprecated memex-openclaw plugin detected — will uninstall first\"\n\n---\n\n## Step 2 — Install memex-mvp (skip if already at ≥ 0.11.6)\n\n```sh\nnpm install -g memex-mvp@latest\n```\n\nIf `EACCES` (no permission to write to npm global prefix), apply the standard fix — **never use sudo**:\n\n```sh\nmkdir -p ~\u002F.npm-global\nnpm config set prefix ~\u002F.npm-global\necho 'export PATH=$HOME\u002F.npm-global\u002Fbin:$PATH' >> ~\u002F.zshrc 2>\u002Fdev\u002Fnull\necho 'export PATH=$HOME\u002F.npm-global\u002Fbin:$PATH' >> ~\u002F.bashrc 2>\u002Fdev\u002Fnull\nexport PATH=$HOME\u002F.npm-global\u002Fbin:$PATH\nnpm install -g memex-mvp@latest\n```\n\nVerify:\n\n```sh\nmemex --version    # must print 0.11.6 or later\n```\n\n---\n\n## Step 3 — Install the auto-capture daemon (skip if already running)\n\n```sh\nmemex-sync install\n```\n\nPlatform-specific behavior (handled automatically by memex-sync):\n\n| Platform | What `memex-sync install` does |\n|---|---|\n| **macOS** (`uname -s` = Darwin) | Writes `~\u002FLibrary\u002FLaunchAgents\u002Fcom.parallelclaw.memex.sync.plist`, runs `launchctl load`. Daemon auto-starts on every login. |\n| **Linux + systemd-user** | Writes `~\u002F.config\u002Fsystemd\u002Fuser\u002Fmemex-sync.service`, runs `systemctl --user daemon-reload && enable && start`. Tries `loginctl enable-linger $USER` so daemon survives SSH logout. |\n| **Linux without systemd** | Exits with \"systemctl --user not available\". Fall back: `nohup memex-sync > \u002Ftmp\u002Fmemex.log 2>&1 &` — works but won't auto-restart on reboot. |\n\nIf `loginctl enable-linger` needs sudo, the install output prints the exact command. **Tell the user that line verbatim** — don't try to sudo yourself.\n\nVerify daemon running:\n\n```sh\nmemex-sync status\n# Should show: process: running (pid XXXX)\n```\n\n---\n\n## Step 4 — Back-fill existing sessions\n\n```sh\nmemex-sync scan\n```\n\n`memex-sync scan` walks the source dirs (Claude Code on workstations, OpenClaw on VPS, etc.), reads each `\u003Cuuid>.jsonl`, filters internal-state noise (`.checkpoint.*`, `.trajectory.*`, `.reset.*` snapshots — they'd double-count), and writes to memex.db.\n\nExpected output:\n\n```\n=== Claude Code + Cowork ===\n- skipping claude-code: directory not found at \u002Fhome\u002Fuser\u002F.claude\u002Fprojects   (on VPS without Claude Code)\n- skipping claude-cowork: directory not found at ...                          (on Linux — Cowork is macOS-only)\nscanning openclaw: \u002Fhome\u002Fuser\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\n+ openclaw-abc12345.jsonl ← 23 msgs from openclaw (ai-titled)\n+ openclaw-def67890.jsonl ← 41 msgs from openclaw\n…\nscanned 60 files · 1316 messages emitted\n```\n\nIf the daemon was already running (Step 3 skipped), `scan` is still useful — it catches anything the daemon's chokidar may have raced on startup.\n\n### Step 4b — Channel-aware re-import (recommended once after first install)\n\nmemex-mvp v0.11.5+ does two-mode auto-detection (**self-hosted** OpenClaw with separate `\u003Cuuid>.jsonl` per session vs **Moonshot Kimi-Claw** with merged-file layout) and channel routing (Telegram chat \u002F Kimi-web session \u002F openclaw-cli). After the first `scan`, run:\n\n```sh\nmemex-sync backfill-channels --yes\n```\n\nThis wipes existing `source = 'openclaw'` rows and re-imports with the current channel-aware pipeline. Use it once after upgrading from any memex-mvp earlier than 0.11.5, and any time the user reports \"messages from one chat are merged into another\" symptoms.\n\n---\n\n## Step 5 — Wire memex as an MCP server in openclaw.json (REQUIRED for LLM retrieval)\n\nThe daemon handles capture; the memex-mvp 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).\n\n### Config-key gotcha\n\nOpenClaw 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`.\n\nFind the absolute path to `memex` (MCP stdio doesn't inherit shell PATH):\n\n```sh\nwhich memex\n```\n\nMerge memex into `~\u002F.openclaw\u002Fopenclaw.json` at `mcp.servers.memex` (preserves other servers; idempotent):\n\n```sh\npython3 \u003C\u003C'PY'\nimport json, shutil\nfrom pathlib import Path\np = Path.home() \u002F \".openclaw\" \u002F \"openclaw.json\"\ncfg = json.loads(p.read_text())\nmemex_bin = shutil.which(\"memex\")\nif not memex_bin:\n    print(\"ERROR: memex binary not in PATH; rerun Step 2\")\n    raise SystemExit(1)\n\n# Correct path is mcp.servers (nested), NOT mcpServers (flat).\nmcp_section = cfg.setdefault(\"mcp\", {})\nservers = mcp_section.setdefault(\"servers\", {})\nservers[\"memex\"] = {\"command\": memex_bin, \"args\": [], \"env\": {}}\n\n# Clean up any legacy top-level mcpServers.memex from earlier skill versions\nstale = cfg.get(\"mcpServers\", {})\nif isinstance(stale, dict) and \"memex\" in stale:\n    del stale[\"memex\"]\n    if not stale:\n        cfg.pop(\"mcpServers\", None)\n    print(\"cleaned stale mcpServers.memex from previous skill version\")\n\np.write_text(json.dumps(cfg, indent=2))\nprint(f\"memex MCP wired at {p} → {memex_bin}\")\nPY\n```\n\n**Verify the merge worked (THREE checks)**:\n\n```sh\n# 1. Config has the right key\npython3 -c \"\nimport json\nfrom pathlib import Path\ncfg = json.loads((Path.home() \u002F '.openclaw' \u002F 'openclaw.json').read_text())\ns = cfg.get('mcp', {}).get('servers', {}).get('memex')\nprint('mcp.servers.memex:', json.dumps(s, indent=2) if s else 'MISSING')\n\"\n\n# 2. OpenClaw's own listing recognises it (authoritative check)\nopenclaw mcp list 2>&1 | grep -i memex\n# Must show 'memex' or similar.\n\n# 3. (after restart, see Step 7d) LLM toolset includes memex_search\n```\n\n---\n\n## Step 6 — Restart OpenClaw\n\n```sh\nopenclaw gateway restart\n```\n\nWait ~5 seconds, then check logs:\n\n```sh\njournalctl --user -u openclaw -n 50 --no-pager 2>\u002Fdev\u002Fnull | grep -iE \"memex|mcp\" | tail -10 \\\n  || tail -100 ~\u002F.openclaw\u002Flogs\u002Fgateway.log 2>\u002Fdev\u002Fnull | grep -iE \"memex|mcp\" | tail -10\n```\n\nYou should see the gateway picking up the memex MCP server.\n\n---\n\n## Step 7 — Verify (four checks — all must pass)\n\n### 7a. Daemon is alive and capturing\n\n```sh\nmemex-sync status\n# process: running (pid XXXX)\n\n# Watch the daemon log for a few seconds\ntail -10 ~\u002F.memex\u002Flogs\u002Fmemex-sync.log 2>\u002Fdev\u002Fnull\n```\n\n### 7b. memex.db has OpenClaw rows\n\n```sh\nsqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \u003C\u003C'SQL'\n.headers on\n.mode column\nSELECT COUNT(*) AS total_openclaw_rows,\n       MIN(ts) AS earliest_ts,\n       MAX(ts) AS latest_ts\n  FROM messages\n WHERE source = 'openclaw';\nSQL\n```\n\nExpected: total_openclaw_rows ≥ 1 (much more if you ran back-fill on existing sessions).\n\n### 7c. Live capture writes a NEW row\n\n```sh\nPRE=$(sqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\necho \"PRE: $PRE\"\n\n# >>> NOW send a test message in OpenClaw, wait for reply \u003C\u003C\u003C\nsleep 8\n\nPOST=$(sqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\necho \"POST: $POST  diff=$((POST - PRE))\"\n\nsqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \\\n  \"SELECT id, role, datetime(ts,'unixepoch','localtime') AS when_,\n          substr(text,1,60) AS preview, conversation_id\n     FROM messages WHERE source='openclaw' ORDER BY ts DESC LIMIT 5\"\n```\n\nExpected: diff ≥ 2 (user + assistant), recent rows include your test message.\n\n### 7d. LLM toolset includes memex tools (requires a FRESH OpenClaw session)\n\nMCP 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:\n\n1. Start a **fresh** OpenClaw conversation.\n2. Ask the agent: \"Find the earliest conversations from April using memex_search.\"\n3. The agent should:\n   - Mention `memex_search` in its reasoning or just call it\n   - Return real results (IDs, timestamps, snippets from `~\u002F.memex\u002Fdata\u002Fmemex.db`)\n   - NOT fall back to direct `sqlite3` calls\n\nIf the agent doesn't see memex tools → re-check Step 5 (probably `mcp.servers` vs `mcpServers` key issue) and `openclaw mcp list`.\n\n---\n\n## Step 8 — Final message to user\n\nAfter all checks pass:\n\n```\n✅ memex wired into OpenClaw.\n\nCaptured:\n  • Every new OpenClaw turn writes to ~\u002F.memex\u002Fdata\u002Fmemex.db within seconds\n    (the memex-sync daemon watches ~\u002F.openclaw\u002Fagents\u002Fmain\u002Fsessions\u002F)\n  • Past sessions back-filled (Step 4)\n  • Channel routing works for self-hosted OpenClaw + Moonshot Kimi-Claw\n\nSearch:\n  • From inside OpenClaw chat: ask the model to search its memory — uses memex_search\n  • From CLI: `memex search \"query\"` or `memex overview`\n  • From any other MCP-enabled client on the same machine (Claude Code, Cursor, etc.) —\n    the memex MCP server exposes 11 search tools\n\nDaemon:\n  • Status check: `memex-sync status`\n  • Auto-restarts on login (LaunchAgent on macOS, systemd-user on Linux)\n  • Survives SSH logout if linger is enabled\n\nPair with:\n  • install-memex (generic skill) — if you also use Claude Code, Cursor, Cline, etc.\n    on this same machine, they all share ~\u002F.memex\u002Fdata\u002Fmemex.db\n  • memex-hermes (pip package) — if you run Hermes Agent on this machine\n```\n\n---\n\n## What this skill explicitly does NOT do\n\n- ❌ Install Node.js (manual step if needed — print instructions, don't auto-install)\n- ❌ Use sudo. Ever. If permissions block something, surface the manual fix and stop.\n- ❌ Install the deprecated `@parallelclaw\u002Fmemex-openclaw` plugin. The daemon path supersedes it.\n- ❌ Overwrite existing `mcp.servers` entries. Merge.\n- ❌ Configure outbound network access. memex is local-first.\n\n---\n\n## Edge cases\n\n| Condition | What to do |\n|---|---|\n| OpenClaw \u003C 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. |\n| memex.db locked (WAL contention) | Wait 1 second, retry. SQLite WAL handles concurrent readers\u002Fwriters. |\n| Plugin install permission denied | Bootstrap section at the top of this skill — user needs to allow third-party skills once. |\n| 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. |\n| User has the deprecated memex-openclaw plugin AND already-captured data from it | The plugin's data (raw_type='openclaw-agent-end') stays in memex.db. Daemon's new writes will appear alongside under the same source. UNIQUE constraint prevents duplicates. |\n| User wants to delete legacy plugin data | `sqlite3 ~\u002F.memex\u002Fdata\u002Fmemex.db \"DELETE FROM messages WHERE source='openclaw' AND json_extract(metadata,'$.raw_type')='openclaw-agent-end'\"` — careful, irreversible |\n| openclaw.json doesn't exist | Ask the user ONE question for the path. Don't auto-create. |\n\n---\n\n## Safety rules — read before starting\n\n- Never sudo. Never edit system files. Never modify `$PATH` outside `~\u002F.zshrc` \u002F `~\u002F.bashrc` with the user's consent.\n- Always confirm before deleting anything from the user's machine.\n- Always preserve existing config keys when editing JSON.\n- Print every shell command to the user before running it.\n- If any step fails, **stop**. Don't try to recover by trying random things. Print the error and ask the user.\n\n---\n\n## Begin\n\nRun Step 1 (Discovery) now. Print results. Branch as the table indicates.\n",{"name":5,"version":24,"metadata":25,"description":7},"3.0.0",{"openclaw":26},{"emoji":27,"homepage":28,"requires":29},"🧠","https:\u002F\u002Fmemex.parallelclaw.ai",{"bins":30},[31,32],"node","npm","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fi\u002Finstall-memex-claw",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill install-memex-claw",{"tool":48,"command":49},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill install-memex-claw",{"tool":51,"command":52},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill install-memex-claw","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fi\u002Finstall-memex-claw\u002FSKILL.md",true,[],[57,64,71,78,85,92],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]