{"id":"8ee31bed-63fe-480a-abf9-bcc4a3f0cded","entityType":"agent","slug":"clawhub-sedelev-install-memex-claw","name":"Install memex for OpenClaw","canonicalUrl":"https://www.xpersona.co/agent/clawhub-sedelev-install-memex-claw","canonicalPath":"/agent/clawhub-sedelev-install-memex-claw","generatedAt":"2026-10-11T01:46:35.192Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T23:07:09.239Z","emptyReason":null},"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 OpenC...","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s171srkkzs7tq0b2sb81x0ahk985wd1y:install-memex-claw","sourceUrl":"https://clawhub.ai/sedelev/install-memex-claw","homepage":"https://clawhub.ai/sedelev/skills/install-memex-claw","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/sedelev/install-memex-claw","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/sedelev/skills/install-memex-claw","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Install memex for OpenClaw technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T23:07:09.239Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T23:07:09.239Z","emptyReason":null},"stars":null,"forks":null,"downloads":1234,"packageName":null,"latestVersion":"3.0.0","tractionLabel":"1.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T23:07:09.173Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T23:07:09.239Z","lastCrawledAt":"2026-10-10T23:07:09.173Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T23:07:09.173Z","lastVerifiedAt":null,"highlights":[{"version":"3.0.0","createdAt":"2026-05-25T19:34:23.847Z","changelog":"v3.0.0 — REVERT to daemon-based install. The 2.0.x plugin-based path (npm package @parallelclaw/memex-openclaw) is officially DEPRECATED after running into a series of OpenClaw plugin-SDK frictions: security scanner blocks any child_process in tarball (even in bin/), no api.registerCli use in bundled extensions (might be buggy per issue #80621), api.registerTool doesn't expose to LLM toolset (need MCP wiring anyway), allowConversationAccess required as user-side opt-in, better-sqlite3 native binary rebuild needed per install, plus conv_id formula divergence from the file-watcher would create duplicate-namespace data for existing users. None of that is worth fighting through when memex-mvp's daemon-based approach was already production-proven on every deployment (self-hosted OpenClaw + Moonshot Kimi-Claw + macOS workstations). v3.0.0 restores the v1.0.3 daemon flow updated for memex-mvp 0.11.6+: install daemon, run scan + backfill-channels, wire memex into cfg.mcp.servers (correct nested key), restart gateway. Added explicit migration section at the top for users who tried the deprecated plugin — uninstall block, .bak restore hint, note that captured plugin data stays in memex.db (UNIQUE prevents duplicates with daemon-source rows). Step 5 retains the v2.0.2 nested-key fix (cfg.mcp.servers vs cfg.mcpServers — the latter was silently ignored by OpenClaw 2026.5+ MCP runtime adapter). Step 7d retains the LLM-toolset verification (open fresh session, ask agent to invoke memex_search, ensure it doesn't fall back to raw sqlite). The plugin-based v2.0.x history is preserved on ClawHub for archaeology; users on v2.0.x can migrate to v3.0.0 via the migration block. v2.0.2 — Step 5 (MCP wiring) is now MANDATORY, and the config key bug is fixed. Pre-v2.0.2 the script wrote MCP server config to cfg.mcpServers (top-level, camelCase), but OpenClaw 2026.5+ actually reads from cfg.mcp.servers (nested under 'mcp'). The flat key was silently ignored — meaning every install via v2.0.0/v2.0.1 had broken retrieval: capture worked (Bug 6 fixed correctly) but the LLM never saw memex_search in its toolset because the MCP runtime adapter couldn't find any 'memex' server registration. Field-validated 2026-05-25: after correcting to cfg.mcp.servers.memex + restart + fresh session, the LLM agent correctly invoked memex_search and returned real April-2026 conversation results from memex.db. Architectural clarification added at top of Step 5: api.registerTool() from a non-bundled plugin creates RPC tools in OpenClaw's gateway registry (callable via direct tool.call) but does NOT inject them into the LLM's function-calling toolset — only cfg.mcp.servers does that, at session start. New Step 7d verification — the LLM toolset check — guides the user through opening a fresh session and asking the agent to use memex_search; if the agent falls back to raw sqlite, the MCP wiring is wrong. Cleanup logic deletes any stale cfg.mcpServers.memex entry left by earlier skill versions. Step 5 demoted 'optional but recommended' label removed — without MCP wiring, the agent cannot retrieve from memex inside conversations; this is no longer a nice-to-have. Pairs with memex-openclaw v0.1.5+. v2.0.1 — Bug 6 fix: Step 4 now explicitly grants hooks.allowConversationAccess=true alongside enabled=true. Without this, OpenClaw 2026.5+ silently BLOCKS the agent_end hook for non-bundled (npm-installed) plugins as a security default — the plugin would register and tools would work, but no new conversations would actually be captured. Field-validated on a self-hosted VPS: BEFORE fix, 9006 rows from legacy file-watcher only; AFTER fix, +3 rows after test message with raw_type='openclaw-agent-end' (plugin marker, not legacy). Skill Step 7 verification expanded into 7a/7b/7c: 7a checks gateway log has no 'BLOCKED' messages for agent_end; 7b snapshots row count before+after a test message and asserts diff ≥ 2 with raw_type='openclaw-agent-end' so the plugin path is proven, not just the legacy fallback; 7c keeps the original conversation_id shape check. Documentation up front explains WHY allowConversationAccess is a manual user-opt-in (OpenClaw security model — non-bundled plugins cannot self-declare; analogous to Android runtime permissions). Pairs with memex-openclaw v0.1.5+. v2.0.0 — MAJOR REWRITE: skill now installs the new memex-openclaw plugin (npm: @parallelclaw/memex-openclaw) instead of the v0.11.x memex-sync file-watcher daemon. Plugin runs INSIDE OpenClaw via the native OpenClaw 2026.5+ plugin SDK — subscribes to 'agent_end' hook for per-turn capture, 'before_compaction' for preserving messages about to drop from context, registers as a MemoryCorpusSupplement so memex content shows up in built-in memory_search tool. Channel detection is FREE — comes from ctx.messageProvider/channelId, no regex parsing of message text needed. Eliminates ~1000 lines of brittle parser code from memex-mvp (channel markers, sessions.json reader, .reset/.checkpoint file recognition, channel auto-discovery — all unnecessary because OpenClaw hands the plugin structured event data directly). Conv-id scheme: 'openclaw-<platform>-<channelId>' for per-user threads (telegram/discord), 'openclaw-<platform>-<session8>' for cli/cron fallback. Skill flow simplified: Discovery → install memex-mvp (≥ 0.12 needed) → stop+disable old daemon if present → install plugin → enable in openclaw.json → wire memex MCP server → restart. Multi-plugin coexistence: Mem0/Memoria/memex can all be active simultaneously, the corpus supplement merges results in built-in memory_search. Honest positioning added at top: memex-openclaw is most useful as a BRIDGE — pair with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. Single-OpenClaw users with built-in memory-core may not need this. Requires OpenClaw 2026.5+ (plugin SDK). v1.0.3 — paired with memex-mvp v0.11.5 file-watcher era (now superseded by v2.0.0). (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.","fileCount":3,"zipByteSize":10335},{"version":"2.0.2","createdAt":"2026-05-24T19:41:04.982Z","changelog":"v2.0.2 — Step 5 (MCP wiring) is now MANDATORY, and the config key bug is fixed. Pre-v2.0.2 the script wrote MCP server config to cfg.mcpServers (top-level, camelCase), but OpenClaw 2026.5+ actually reads from cfg.mcp.servers (nested under 'mcp'). The flat key was silently ignored — meaning every install via v2.0.0/v2.0.1 had broken retrieval: capture worked (Bug 6 fixed correctly) but the LLM never saw memex_search in its toolset because the MCP runtime adapter couldn't find any 'memex' server registration. Field-validated 2026-05-25: after correcting to cfg.mcp.servers.memex + restart + fresh session, the LLM agent correctly invoked memex_search and returned real April-2026 conversation results from memex.db. Architectural clarification added at top of Step 5: api.registerTool() from a non-bundled plugin creates RPC tools in OpenClaw's gateway registry (callable via direct tool.call) but does NOT inject them into the LLM's function-calling toolset — only cfg.mcp.servers does that, at session start. New Step 7d verification — the LLM toolset check — guides the user through opening a fresh session and asking the agent to use memex_search; if the agent falls back to raw sqlite, the MCP wiring is wrong. Cleanup logic deletes any stale cfg.mcpServers.memex entry left by earlier skill versions. Step 5 demoted 'optional but recommended' label removed — without MCP wiring, the agent cannot retrieve from memex inside conversations; this is no longer a nice-to-have. Pairs with memex-openclaw v0.1.5+. v2.0.1 — Bug 6 fix: Step 4 now explicitly grants hooks.allowConversationAccess=true alongside enabled=true. Without this, OpenClaw 2026.5+ silently BLOCKS the agent_end hook for non-bundled (npm-installed) plugins as a security default — the plugin would register and tools would work, but no new conversations would actually be captured. Field-validated on a self-hosted VPS: BEFORE fix, 9006 rows from legacy file-watcher only; AFTER fix, +3 rows after test message with raw_type='openclaw-agent-end' (plugin marker, not legacy). Skill Step 7 verification expanded into 7a/7b/7c: 7a checks gateway log has no 'BLOCKED' messages for agent_end; 7b snapshots row count before+after a test message and asserts diff ≥ 2 with raw_type='openclaw-agent-end' so the plugin path is proven, not just the legacy fallback; 7c keeps the original conversation_id shape check. Documentation up front explains WHY allowConversationAccess is a manual user-opt-in (OpenClaw security model — non-bundled plugins cannot self-declare; analogous to Android runtime permissions). Pairs with memex-openclaw v0.1.5+. v2.0.0 — MAJOR REWRITE: skill now installs the new memex-openclaw plugin (npm: @parallelclaw/memex-openclaw) instead of the v0.11.x memex-sync file-watcher daemon. Plugin runs INSIDE OpenClaw via the native OpenClaw 2026.5+ plugin SDK — subscribes to 'agent_end' hook for per-turn capture, 'before_compaction' for preserving messages about to drop from context, registers as a MemoryCorpusSupplement so memex content shows up in built-in memory_search tool. Channel detection is FREE — comes from ctx.messageProvider/channelId, no regex parsing of message text needed. Eliminates ~1000 lines of brittle parser code from memex-mvp (channel markers, sessions.json reader, .reset/.checkpoint file recognition, channel auto-discovery — all unnecessary because OpenClaw hands the plugin structured event data directly). Conv-id scheme: 'openclaw-<platform>-<channelId>' for per-user threads (telegram/discord), 'openclaw-<platform>-<session8>' for cli/cron fallback. Skill flow simplified: Discovery → install memex-mvp (≥ 0.12 needed) → stop+disable old daemon if present → install plugin → enable in openclaw.json → wire memex MCP server → restart. Multi-plugin coexistence: Mem0/Memoria/memex can all be active simultaneously, the corpus supplement merges results in built-in memory_search. Honest positioning added at top: memex-openclaw is most useful as a BRIDGE — pair with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. Single-OpenClaw users with built-in memory-core may not need this. Requires OpenClaw 2026.5+ (plugin SDK). v1.0.3 — paired with memex-mvp v0.11.5 file-watcher era (now superseded by v2.0.0). (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.","fileCount":2,"zipByteSize":8593},{"version":"2.0.1","createdAt":"2026-05-24T18:35:29.226Z","changelog":"v2.0.1 — Bug 6 fix: Step 4 now explicitly grants hooks.allowConversationAccess=true alongside enabled=true. Without this, OpenClaw 2026.5+ silently BLOCKS the agent_end hook for non-bundled (npm-installed) plugins as a security default — the plugin would register and tools would work, but no new conversations would actually be captured. Field-validated on a self-hosted VPS: BEFORE fix, 9006 rows from legacy file-watcher only; AFTER fix, +3 rows after test message with raw_type='openclaw-agent-end' (plugin marker, not legacy). Skill Step 7 verification expanded into 7a/7b/7c: 7a checks gateway log has no 'BLOCKED' messages for agent_end; 7b snapshots row count before+after a test message and asserts diff ≥ 2 with raw_type='openclaw-agent-end' so the plugin path is proven, not just the legacy fallback; 7c keeps the original conversation_id shape check. Documentation up front explains WHY allowConversationAccess is a manual user-opt-in (OpenClaw security model — non-bundled plugins cannot self-declare; analogous to Android runtime permissions). Pairs with memex-openclaw v0.1.5+. v2.0.0 — MAJOR REWRITE: skill now installs the new memex-openclaw plugin (npm: @parallelclaw/memex-openclaw) instead of the v0.11.x memex-sync file-watcher daemon. Plugin runs INSIDE OpenClaw via the native OpenClaw 2026.5+ plugin SDK — subscribes to 'agent_end' hook for per-turn capture, 'before_compaction' for preserving messages about to drop from context, registers as a MemoryCorpusSupplement so memex content shows up in built-in memory_search tool. Channel detection is FREE — comes from ctx.messageProvider/channelId, no regex parsing of message text needed. Eliminates ~1000 lines of brittle parser code from memex-mvp (channel markers, sessions.json reader, .reset/.checkpoint file recognition, channel auto-discovery — all unnecessary because OpenClaw hands the plugin structured event data directly). Conv-id scheme: 'openclaw-<platform>-<channelId>' for per-user threads (telegram/discord), 'openclaw-<platform>-<session8>' for cli/cron fallback. Skill flow simplified: Discovery → install memex-mvp (≥ 0.12 needed) → stop+disable old daemon if present → install plugin → enable in openclaw.json → wire memex MCP server → restart. Multi-plugin coexistence: Mem0/Memoria/memex can all be active simultaneously, the corpus supplement merges results in built-in memory_search. Honest positioning added at top: memex-openclaw is most useful as a BRIDGE — pair with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. Single-OpenClaw users with built-in memory-core may not need this. Requires OpenClaw 2026.5+ (plugin SDK). v1.0.3 — paired with memex-mvp v0.11.5 file-watcher era (now superseded by v2.0.0). (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.","fileCount":2,"zipByteSize":7543},{"version":"2.0.0","createdAt":"2026-05-21T20:57:10.198Z","changelog":"v2.0.0 — MAJOR REWRITE: skill now installs the new memex-openclaw plugin (npm: @parallelclaw/memex-openclaw) instead of the v0.11.x memex-sync file-watcher daemon. Plugin runs INSIDE OpenClaw via the native OpenClaw 2026.5+ plugin SDK — subscribes to 'agent_end' hook for per-turn capture, 'before_compaction' for preserving messages about to drop from context, registers as a MemoryCorpusSupplement so memex content shows up in built-in memory_search tool. Channel detection is FREE — comes from ctx.messageProvider/channelId, no regex parsing of message text needed. Eliminates ~1000 lines of brittle parser code from memex-mvp (channel markers, sessions.json reader, .reset/.checkpoint file recognition, channel auto-discovery — all unnecessary because OpenClaw hands the plugin structured event data directly). Conv-id scheme: 'openclaw-<platform>-<channelId>' for per-user threads (telegram/discord), 'openclaw-<platform>-<session8>' for cli/cron fallback. Skill flow simplified: Discovery → install memex-mvp (≥ 0.12 needed) → stop+disable old daemon if present → install plugin → enable in openclaw.json → wire memex MCP server → restart. Multi-plugin coexistence: Mem0/Memoria/memex can all be active simultaneously, the corpus supplement merges results in built-in memory_search. Honest positioning added at top: memex-openclaw is most useful as a BRIDGE — pair with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. Single-OpenClaw users with built-in memory-core may not need this. Requires OpenClaw 2026.5+ (plugin SDK). v1.0.3 — paired with memex-mvp v0.11.5 file-watcher era (now superseded by v2.0.0). (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.","fileCount":2,"zipByteSize":6399},{"version":"1.0.3","createdAt":"2026-05-19T22:41:52.292Z","changelog":"v1.0.3 — pairs with memex-mvp v0.11.5 (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.","fileCount":2,"zipByteSize":9949},{"version":"1.0.2","createdAt":"2026-05-19T18:11:00.951Z","changelog":"v1.0.2 — fixes two real friction points found by a tester: (1) Step 6 (Verify) used to instruct the agent to run `memex overview` and `memex search` immediately after install — but the staged inbox files only get processed into memex.db when the MCP server first runs, which is AFTER the gateway restart. So verify-before-restart always confused tester ('memex.db not found' or '0 messages'). Step 6 now checks only what's deterministically available pre-restart (daemon status + inbox file count). Full data verification moved to new Step 8, run after the user restarts the gateway. (2) The plugins.allow bootstrap troubleshooting in v1.0.1 was version-specific — at least one OpenClaw build doesn't use 'skill' as the permission name. Generalised the troubleshooting to 'check your OpenClaw docs for the exact permission name' without prescribing one. Pairs with memex-mvp v0.10.15 which pre-creates memex.db (with full schema) inside `memex-sync install` so post-install CLI commands no longer error with 'DB not found' — they correctly report 'no data yet' until the MCP server processes the inbox after gateway restart. v1.0.1 — adds a 'Before this skill can be installed' bootstrap section at the top of SKILL.md. On a fresh OpenClaw VPS, the default config doesn't allow the 'skill' plugin in plugins.allow, so 'openclaw skill install' returns 'plugin not allowed'. We can't fix this inside our skill (chicken-and-egg — the skill needs to be installable to run), but we document the one-time fix (edit ~/.openclaw/openclaw.json plugins.allow, restart gateway) so users hitting it for the first time see the right next step. No behavior change inside the skill itself — Discovery + install + back-fill + MCP wiring all unchanged. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill on the same machine for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). Back-fills past OpenClaw sessions via memex-sync scan, filtering internal-state files (.checkpoint., .trajectory., .reset., trajectory-path*, usage-cost-cache). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end with memex-sync status + memex overview + a smoke memex search before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic. Requires memex-mvp v0.10.14+ which added native Linux + systemd-user + OpenClaw source support.","fileCount":2,"zipByteSize":8392},{"version":"1.0.1","createdAt":"2026-05-19T17:53:16.715Z","changelog":"v1.0.1 — adds a 'Before this skill can be installed' bootstrap section at the top of SKILL.md. On a fresh OpenClaw VPS, the default config doesn't allow the 'skill' plugin in plugins.allow, so 'openclaw skill install' returns 'plugin not allowed'. We can't fix this inside our skill (chicken-and-egg — the skill needs to be installable to run), but we document the one-time fix (edit ~/.openclaw/openclaw.json plugins.allow, restart gateway) so users hitting it for the first time see the right next step. No behavior change inside the skill itself — Discovery + install + back-fill + MCP wiring all unchanged. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill on the same machine for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). Back-fills past OpenClaw sessions via memex-sync scan, filtering internal-state files (.checkpoint., .trajectory., .reset., trajectory-path*, usage-cost-cache). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end with memex-sync status + memex overview + a smoke memex search before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic. Requires memex-mvp v0.10.14+ which added native Linux + systemd-user + OpenClaw source support.","fileCount":2,"zipByteSize":7660},{"version":"1.0.0","createdAt":"2026-05-19T17:39:24.013Z","changelog":"v1.0.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill on the same machine for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). Back-fills past OpenClaw sessions via memex-sync scan, filtering internal-state files (.checkpoint., .trajectory., .reset., trajectory-path*, usage-cost-cache). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end with memex-sync status + memex overview + a smoke memex search before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic. Requires memex-mvp v0.10.14+ which added native Linux + systemd-user + OpenClaw source support.","fileCount":2,"zipByteSize":7286}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s171srkkzs7tq0b2sb81x0ahk985wd1y:install-memex-claw","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s171srkkzs7tq0b2sb81x0ahk985wd1y:install-memex-claw` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/sedelev/install-memex-claw before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T01:46:35.184Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sedelev-install-memex-claw/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T23:07:09.239Z","emptyReason":null},"readme":"Skill: Install memex for OpenClaw\n\nOwner: sedelev\n\nSummary: Wire memex (the local-first MCP memory server) into an OpenClaw gateway — works wherever OpenClaw runs (Linux or macOS, VPS or workstation, self-hosted OpenC...\n\nTags: ai-memory:3.0.0, cross-platform:3.0.0, fts5:3.0.0, gateway:3.0.0, install:3.0.0, latest:3.0.0, launchagent:3.0.0, linux:3.0.0, local-first:3.0.0, macos:3.0.0, mcp:3.0.0, mcp-server:3.0.0, memex:3.0.0, memory:3.0.0, openclaw:3.0.0, parallelclaw:3.0.0, server-side-agent:3.0.0, session-capture:3.0.0, setup:3.0.0, sqlite:3.0.0, systemd:3.0.0, verbatim:3.0.0, vps:3.0.0, workstation:3.0.0\n\nVersion history:\n\nv3.0.0 | 2026-05-25T19:34:23.847Z | user\n\nv3.0.0 — REVERT to daemon-based install. The 2.0.x plugin-based path (npm package @parallelclaw/memex-openclaw) is officially DEPRECATED after running into a series of OpenClaw plugin-SDK frictions: security scanner blocks any child_process in tarball (even in bin/), no api.registerCli use in bundled extensions (might be buggy per issue #80621), api.registerTool doesn't expose to LLM toolset (need MCP wiring anyway), allowConversationAccess required as user-side opt-in, better-sqlite3 native binary rebuild needed per install, plus conv_id formula divergence from the file-watcher would create duplicate-namespace data for existing users. None of that is worth fighting through when memex-mvp's daemon-based approach was already production-proven on every deployment (self-hosted OpenClaw + Moonshot Kimi-Claw + macOS workstations). v3.0.0 restores the v1.0.3 daemon flow updated for memex-mvp 0.11.6+: install daemon, run scan + backfill-channels, wire memex into cfg.mcp.servers (correct nested key), restart gateway. Added explicit migration section at the top for users who tried the deprecated plugin — uninstall block, .bak restore hint, note that captured plugin data stays in memex.db (UNIQUE prevents duplicates with daemon-source rows). Step 5 retains the v2.0.2 nested-key fix (cfg.mcp.servers vs cfg.mcpServers — the latter was silently ignored by OpenClaw 2026.5+ MCP runtime adapter). Step 7d retains the LLM-toolset verification (open fresh session, ask agent to invoke memex_search, ensure it doesn't fall back to raw sqlite). The plugin-based v2.0.x history is preserved on ClawHub for archaeology; users on v2.0.x can migrate to v3.0.0 via the migration block. v2.0.2 — Step 5 (MCP wiring) is now MANDATORY, and the config key bug is fixed. Pre-v2.0.2 the script wrote MCP server config to cfg.mcpServers (top-level, camelCase), but OpenClaw 2026.5+ actually reads from cfg.mcp.servers (nested under 'mcp'). The flat key was silently ignored — meaning every install via v2.0.0/v2.0.1 had broken retrieval: capture worked (Bug 6 fixed correctly) but the LLM never saw memex_search in its toolset because the MCP runtime adapter couldn't find any 'memex' server registration. Field-validated 2026-05-25: after correcting to cfg.mcp.servers.memex + restart + fresh session, the LLM agent correctly invoked memex_search and returned real April-2026 conversation results from memex.db. Architectural clarification added at top of Step 5: api.registerTool() from a non-bundled plugin creates RPC tools in OpenClaw's gateway registry (callable via direct tool.call) but does NOT inject them into the LLM's function-calling toolset — only cfg.mcp.servers does that, at session start. New Step 7d verification — the LLM toolset check — guides the user through opening a fresh session and asking the agent to use memex_search; if the agent falls back to raw sqlite, the MCP wiring is wrong. Cleanup logic deletes any stale cfg.mcpServers.memex entry left by earlier skill versions. Step 5 demoted 'optional but recommended' label removed — without MCP wiring, the agent cannot retrieve from memex inside conversations; this is no longer a nice-to-have. Pairs with memex-openclaw v0.1.5+. v2.0.1 — Bug 6 fix: Step 4 now explicitly grants hooks.allowConversationAccess=true alongside enabled=true. Without this, OpenClaw 2026.5+ silently BLOCKS the agent_end hook for non-bundled (npm-installed) plugins as a security default — the plugin would register and tools would work, but no new conversations would actually be captured. Field-validated on a self-hosted VPS: BEFORE fix, 9006 rows from legacy file-watcher only; AFTER fix, +3 rows after test message with raw_type='openclaw-agent-end' (plugin marker, not legacy). Skill Step 7 verification expanded into 7a/7b/7c: 7a checks gateway log has no 'BLOCKED' messages for agent_end; 7b snapshots row count before+after a test message and asserts diff ≥ 2 with raw_type='openclaw-agent-end' so the plugin path is proven, not just the legacy fallback; 7c keeps the original conversation_id shape check. Documentation up front explains WHY allowConversationAccess is a manual user-opt-in (OpenClaw security model — non-bundled plugins cannot self-declare; analogous to Android runtime permissions). Pairs with memex-openclaw v0.1.5+. v2.0.0 — MAJOR REWRITE: skill now installs the new memex-openclaw plugin (npm: @parallelclaw/memex-openclaw) instead of the v0.11.x memex-sync file-watcher daemon. Plugin runs INSIDE OpenClaw via the native OpenClaw 2026.5+ plugin SDK — subscribes to 'agent_end' hook for per-turn capture, 'before_compaction' for preserving messages about to drop from context, registers as a MemoryCorpusSupplement so memex content shows up in built-in memory_search tool. Channel detection is FREE — comes from ctx.messageProvider/channelId, no regex parsing of message text needed. Eliminates ~1000 lines of brittle parser code from memex-mvp (channel markers, sessions.json reader, .reset/.checkpoint file recognition, channel auto-discovery — all unnecessary because OpenClaw hands the plugin structured event data directly). Conv-id scheme: 'openclaw-<platform>-<channelId>' for per-user threads (telegram/discord), 'openclaw-<platform>-<session8>' for cli/cron fallback. Skill flow simplified: Discovery → install memex-mvp (≥ 0.12 needed) → stop+disable old daemon if present → install plugin → enable in openclaw.json → wire memex MCP server → restart. Multi-plugin coexistence: Mem0/Memoria/memex can all be active simultaneously, the corpus supplement merges results in built-in memory_search. Honest positioning added at top: memex-openclaw is most useful as a BRIDGE — pair with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. Single-OpenClaw users with built-in memory-core may not need this. Requires OpenClaw 2026.5+ (plugin SDK). v1.0.3 — paired with memex-mvp v0.11.5 file-watcher era (now superseded by v2.0.0). (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.\n\nv2.0.2 | 2026-05-24T19:41:04.982Z | user\n\nv2.0.2 — Step 5 (MCP wiring) is now MANDATORY, and the config key bug is fixed. Pre-v2.0.2 the script wrote MCP server config to cfg.mcpServers (top-level, camelCase), but OpenClaw 2026.5+ actually reads from cfg.mcp.servers (nested under 'mcp'). The flat key was silently ignored — meaning every install via v2.0.0/v2.0.1 had broken retrieval: capture worked (Bug 6 fixed correctly) but the LLM never saw memex_search in its toolset because the MCP runtime adapter couldn't find any 'memex' server registration. Field-validated 2026-05-25: after correcting to cfg.mcp.servers.memex + restart + fresh session, the LLM agent correctly invoked memex_search and returned real April-2026 conversation results from memex.db. Architectural clarification added at top of Step 5: api.registerTool() from a non-bundled plugin creates RPC tools in OpenClaw's gateway registry (callable via direct tool.call) but does NOT inject them into the LLM's function-calling toolset — only cfg.mcp.servers does that, at session start. New Step 7d verification — the LLM toolset check — guides the user through opening a fresh session and asking the agent to use memex_search; if the agent falls back to raw sqlite, the MCP wiring is wrong. Cleanup logic deletes any stale cfg.mcpServers.memex entry left by earlier skill versions. Step 5 demoted 'optional but recommended' label removed — without MCP wiring, the agent cannot retrieve from memex inside conversations; this is no longer a nice-to-have. Pairs with memex-openclaw v0.1.5+. v2.0.1 — Bug 6 fix: Step 4 now explicitly grants hooks.allowConversationAccess=true alongside enabled=true. Without this, OpenClaw 2026.5+ silently BLOCKS the agent_end hook for non-bundled (npm-installed) plugins as a security default — the plugin would register and tools would work, but no new conversations would actually be captured. Field-validated on a self-hosted VPS: BEFORE fix, 9006 rows from legacy file-watcher only; AFTER fix, +3 rows after test message with raw_type='openclaw-agent-end' (plugin marker, not legacy). Skill Step 7 verification expanded into 7a/7b/7c: 7a checks gateway log has no 'BLOCKED' messages for agent_end; 7b snapshots row count before+after a test message and asserts diff ≥ 2 with raw_type='openclaw-agent-end' so the plugin path is proven, not just the legacy fallback; 7c keeps the original conversation_id shape check. Documentation up front explains WHY allowConversationAccess is a manual user-opt-in (OpenClaw security model — non-bundled plugins cannot self-declare; analogous to Android runtime permissions). Pairs with memex-openclaw v0.1.5+. v2.0.0 — MAJOR REWRITE: skill now installs the new memex-openclaw plugin (npm: @parallelclaw/memex-openclaw) instead of the v0.11.x memex-sync file-watcher daemon. Plugin runs INSIDE OpenClaw via the native OpenClaw 2026.5+ plugin SDK — subscribes to 'agent_end' hook for per-turn capture, 'before_compaction' for preserving messages about to drop from context, registers as a MemoryCorpusSupplement so memex content shows up in built-in memory_search tool. Channel detection is FREE — comes from ctx.messageProvider/channelId, no regex parsing of message text needed. Eliminates ~1000 lines of brittle parser code from memex-mvp (channel markers, sessions.json reader, .reset/.checkpoint file recognition, channel auto-discovery — all unnecessary because OpenClaw hands the plugin structured event data directly). Conv-id scheme: 'openclaw-<platform>-<channelId>' for per-user threads (telegram/discord), 'openclaw-<platform>-<session8>' for cli/cron fallback. Skill flow simplified: Discovery → install memex-mvp (≥ 0.12 needed) → stop+disable old daemon if present → install plugin → enable in openclaw.json → wire memex MCP server → restart. Multi-plugin coexistence: Mem0/Memoria/memex can all be active simultaneously, the corpus supplement merges results in built-in memory_search. Honest positioning added at top: memex-openclaw is most useful as a BRIDGE — pair with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. Single-OpenClaw users with built-in memory-core may not need this. Requires OpenClaw 2026.5+ (plugin SDK). v1.0.3 — paired with memex-mvp v0.11.5 file-watcher era (now superseded by v2.0.0). (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.\n\nv2.0.1 | 2026-05-24T18:35:29.226Z | user\n\nv2.0.1 — Bug 6 fix: Step 4 now explicitly grants hooks.allowConversationAccess=true alongside enabled=true. Without this, OpenClaw 2026.5+ silently BLOCKS the agent_end hook for non-bundled (npm-installed) plugins as a security default — the plugin would register and tools would work, but no new conversations would actually be captured. Field-validated on a self-hosted VPS: BEFORE fix, 9006 rows from legacy file-watcher only; AFTER fix, +3 rows after test message with raw_type='openclaw-agent-end' (plugin marker, not legacy). Skill Step 7 verification expanded into 7a/7b/7c: 7a checks gateway log has no 'BLOCKED' messages for agent_end; 7b snapshots row count before+after a test message and asserts diff ≥ 2 with raw_type='openclaw-agent-end' so the plugin path is proven, not just the legacy fallback; 7c keeps the original conversation_id shape check. Documentation up front explains WHY allowConversationAccess is a manual user-opt-in (OpenClaw security model — non-bundled plugins cannot self-declare; analogous to Android runtime permissions). Pairs with memex-openclaw v0.1.5+. v2.0.0 — MAJOR REWRITE: skill now installs the new memex-openclaw plugin (npm: @parallelclaw/memex-openclaw) instead of the v0.11.x memex-sync file-watcher daemon. Plugin runs INSIDE OpenClaw via the native OpenClaw 2026.5+ plugin SDK — subscribes to 'agent_end' hook for per-turn capture, 'before_compaction' for preserving messages about to drop from context, registers as a MemoryCorpusSupplement so memex content shows up in built-in memory_search tool. Channel detection is FREE — comes from ctx.messageProvider/channelId, no regex parsing of message text needed. Eliminates ~1000 lines of brittle parser code from memex-mvp (channel markers, sessions.json reader, .reset/.checkpoint file recognition, channel auto-discovery — all unnecessary because OpenClaw hands the plugin structured event data directly). Conv-id scheme: 'openclaw-<platform>-<channelId>' for per-user threads (telegram/discord), 'openclaw-<platform>-<session8>' for cli/cron fallback. Skill flow simplified: Discovery → install memex-mvp (≥ 0.12 needed) → stop+disable old daemon if present → install plugin → enable in openclaw.json → wire memex MCP server → restart. Multi-plugin coexistence: Mem0/Memoria/memex can all be active simultaneously, the corpus supplement merges results in built-in memory_search. Honest positioning added at top: memex-openclaw is most useful as a BRIDGE — pair with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. Single-OpenClaw users with built-in memory-core may not need this. Requires OpenClaw 2026.5+ (plugin SDK). v1.0.3 — paired with memex-mvp v0.11.5 file-watcher era (now superseded by v2.0.0). (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.\n\nv2.0.0 | 2026-05-21T20:57:10.198Z | user\n\nv2.0.0 — MAJOR REWRITE: skill now installs the new memex-openclaw plugin (npm: @parallelclaw/memex-openclaw) instead of the v0.11.x memex-sync file-watcher daemon. Plugin runs INSIDE OpenClaw via the native OpenClaw 2026.5+ plugin SDK — subscribes to 'agent_end' hook for per-turn capture, 'before_compaction' for preserving messages about to drop from context, registers as a MemoryCorpusSupplement so memex content shows up in built-in memory_search tool. Channel detection is FREE — comes from ctx.messageProvider/channelId, no regex parsing of message text needed. Eliminates ~1000 lines of brittle parser code from memex-mvp (channel markers, sessions.json reader, .reset/.checkpoint file recognition, channel auto-discovery — all unnecessary because OpenClaw hands the plugin structured event data directly). Conv-id scheme: 'openclaw-<platform>-<channelId>' for per-user threads (telegram/discord), 'openclaw-<platform>-<session8>' for cli/cron fallback. Skill flow simplified: Discovery → install memex-mvp (≥ 0.12 needed) → stop+disable old daemon if present → install plugin → enable in openclaw.json → wire memex MCP server → restart. Multi-plugin coexistence: Mem0/Memoria/memex can all be active simultaneously, the corpus supplement merges results in built-in memory_search. Honest positioning added at top: memex-openclaw is most useful as a BRIDGE — pair with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. Single-OpenClaw users with built-in memory-core may not need this. Requires OpenClaw 2026.5+ (plugin SDK). v1.0.3 — paired with memex-mvp v0.11.5 file-watcher era (now superseded by v2.0.0). (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.\n\nv1.0.3 | 2026-05-19T22:41:52.292Z | user\n\nv1.0.3 — pairs with memex-mvp v0.11.5 (the first release where OpenClaw ingestion can be trusted end-to-end on BOTH self-hosted OpenClaw and Moonshot Kimi-Claw). Bumps version checks throughout (≥ 0.11.5 now required, was ≥ 0.10.14). Rewrites Step 4b around the matured v0.11.x channel-aware pipeline: documents two-mode routing (auto-detected kimi-claw vs self-hosted), the --mode override flag, the new backfill banner with separate counts for main / checkpoint / reset files. Adds a 'What you get out of v0.11.5 vs older' table summarising every fix between v0.11.0 and v0.11.5 so users upgrading from any prior version know what changes. Key wins for self-hosted OpenClaw (the dominant case — ~90% of installs per maintainer feedback): (a) checkpoint snapshots are auto-skipped to avoid 30-40x row duplication; (b) .reset.* full session archives are now picked up (v0.11.4 added it, v0.11.5 made shouldIngest actually allow them through — the real reset filename ends in '.833Z' not '.jsonl' so v0.11.4's logic was dead code); (c) content-based session-type detection survives main-session rotation when sessions.json has dropped the entry. Key wins for Kimi-Claw users: (a) Kimi-web header strips correctly without optional [Time:] block; (b) tool-results inherit the parent conversation instead of orphaning into a fallback bucket. Adds documentation of .reset.* archive ingestion in Step 4 — self-hosted users typically gain 3-7K messages of long-term Telegram history (~140 MB) that were invisible to memex before. No behavior change in install / daemon / MCP wiring — Discovery + Steps 1-3 + 5-8 unchanged. v1.0.2 — fixes two friction points: Step 6 (Verify) moved DB-content checks to new Step 8 (post-restart) since inbox isn't drained until first MCP server start. plugins.allow troubleshooting generalised. Pairs with memex-mvp v0.10.15. v1.0.1 — adds 'Before this skill can be installed' bootstrap section documenting the one-time plugins.allow edit on fresh OpenClaw VPS. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic.\n\nv1.0.2 | 2026-05-19T18:11:00.951Z | user\n\nv1.0.2 — fixes two real friction points found by a tester: (1) Step 6 (Verify) used to instruct the agent to run `memex overview` and `memex search` immediately after install — but the staged inbox files only get processed into memex.db when the MCP server first runs, which is AFTER the gateway restart. So verify-before-restart always confused tester ('memex.db not found' or '0 messages'). Step 6 now checks only what's deterministically available pre-restart (daemon status + inbox file count). Full data verification moved to new Step 8, run after the user restarts the gateway. (2) The plugins.allow bootstrap troubleshooting in v1.0.1 was version-specific — at least one OpenClaw build doesn't use 'skill' as the permission name. Generalised the troubleshooting to 'check your OpenClaw docs for the exact permission name' without prescribing one. Pairs with memex-mvp v0.10.15 which pre-creates memex.db (with full schema) inside `memex-sync install` so post-install CLI commands no longer error with 'DB not found' — they correctly report 'no data yet' until the MCP server processes the inbox after gateway restart. v1.0.1 — adds a 'Before this skill can be installed' bootstrap section at the top of SKILL.md. On a fresh OpenClaw VPS, the default config doesn't allow the 'skill' plugin in plugins.allow, so 'openclaw skill install' returns 'plugin not allowed'. We can't fix this inside our skill (chicken-and-egg — the skill needs to be installable to run), but we document the one-time fix (edit ~/.openclaw/openclaw.json plugins.allow, restart gateway) so users hitting it for the first time see the right next step. No behavior change inside the skill itself — Discovery + install + back-fill + MCP wiring all unchanged. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill on the same machine for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). Back-fills past OpenClaw sessions via memex-sync scan, filtering internal-state files (.checkpoint., .trajectory., .reset., trajectory-path*, usage-cost-cache). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end with memex-sync status + memex overview + a smoke memex search before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic. Requires memex-mvp v0.10.14+ which added native Linux + systemd-user + OpenClaw source support.\n\nv1.0.1 | 2026-05-19T17:53:16.715Z | user\n\nv1.0.1 — adds a 'Before this skill can be installed' bootstrap section at the top of SKILL.md. On a fresh OpenClaw VPS, the default config doesn't allow the 'skill' plugin in plugins.allow, so 'openclaw skill install' returns 'plugin not allowed'. We can't fix this inside our skill (chicken-and-egg — the skill needs to be installable to run), but we document the one-time fix (edit ~/.openclaw/openclaw.json plugins.allow, restart gateway) so users hitting it for the first time see the right next step. No behavior change inside the skill itself — Discovery + install + back-fill + MCP wiring all unchanged. v1.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill on the same machine for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). Back-fills past OpenClaw sessions via memex-sync scan, filtering internal-state files (.checkpoint., .trajectory., .reset., trajectory-path*, usage-cost-cache). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end with memex-sync status + memex overview + a smoke memex search before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic. Requires memex-mvp v0.10.14+ which added native Linux + systemd-user + OpenClaw source support.\n\nv1.0.0 | 2026-05-19T17:39:24.013Z | user\n\nv1.0.0 — first release. Wires memex into an OpenClaw gateway WHEREVER OpenClaw runs: Linux VPS, Linux workstation, macOS workstation, macOS server — all four equally first-class. Discovery checks OpenClaw / Node ≥ 20 / existing memex install / existing daemon / sessions count / systemd-user (Linux only) / gateway config location. Branches intelligently: if memex is already installed (e.g. via the generic install-memex skill on the same machine for Claude Code), skips install+daemon and just merges memex into the OpenClaw gateway's MCP-server config. Otherwise full platform-aware install: Linux → ~/.config/systemd/user/memex-sync.service with loginctl enable-linger attempt; macOS → ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist. EACCES handled via ~/.npm-global prefix fix (no sudo). Back-fills past OpenClaw sessions via memex-sync scan, filtering internal-state files (.checkpoint., .trajectory., .reset., trajectory-path*, usage-cost-cache). MCP wiring uses absolute path from `which memex` (MCP-stdio doesn't inherit shell PATH), merges into the OpenClaw config without overwriting other MCP servers. Verifies end-to-end with memex-sync status + memex overview + a smoke memex search before declaring done. Zero questions to the user — discovery → actions → verification. Adds 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to OpenClaw after gateway restart. Pairs nicely with install-memex (generic skill) when the same machine ALSO runs Claude Code / Cursor / Telegram capture — both skills share ~/.memex/data/memex.db so the corpus is unified. Memex runtime emits zero outbound network traffic. Requires memex-mvp v0.10.14+ which added native Linux + systemd-user + OpenClaw source support.\n\nArchive index:\n\nArchive v3.0.0: 3 files, 10335 bytes\n\nFiles: skill-card.md (2780b), SKILL.md (21351b), _meta.json (137b)\n\nFile v3.0.0:SKILL.md\n\n---\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 ~/.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 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://memex.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 `~/.openclaw/agents/main/sessions/` is auto-captured into `~/.memex/data/memex.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/retrieval 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 / 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/macOS) 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/memex-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/package/memex-mvp](https://www.npmjs.com/package/memex-mvp), source: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) |\n| `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 |\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 `~/.openclaw/openclaw.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 `<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 |\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 / 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/memex-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 ~/.openclaw/openclaw.json.bak ] && echo \"found backup, you can restore via:\" \\\n  && echo \"  cp ~/.openclaw/openclaw.json.bak ~/.openclaw/openclaw.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\" / \"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.\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://clawhub.ai/sedelev/install-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>/dev/null || find / -maxdepth 4 -name \"openclaw\" -type d 2>/dev/null | 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>/dev/null | head -5 || echo \"NO_DAEMON\"\n\n# 6. Existing OpenClaw sessions?\nls -1 ~/.openclaw/agents/main/sessions/ 2>/dev/null \\\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>/dev/null | head -1 \\\n  || echo \"macOS or no-systemd\"\n\n# 8. OpenClaw gateway config\nls -la ~/.openclaw/openclaw.json 2>&1\n\n# 9. Was the deprecated memex-openclaw plugin previously installed?\nls -la ~/.openclaw/npm/node_modules/@parallelclaw/memex-openclaw 2>/dev/null \\\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 / Cursor / etc., use `install-memex` instead.\" |\n| **Node < 22.12** | Stop. Print upgrade instructions (nvm, distro pkg manager). Don't auto-install Node. |\n| **Deprecated plugin found at ~/.openclaw/npm/node_modules/@parallelclaw/memex-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 < 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 /usr/local/bin/openclaw\"  \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 ~/.npm-global\nnpm config set prefix ~/.npm-global\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc 2>/dev/null\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc 2>/dev/null\nexport PATH=$HOME/.npm-global/bin:$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 `~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist`, runs `launchctl load`. Daemon auto-starts on every login. |\n| **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. |\n| **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. |\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 `<uuid>.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 /home/user/.claude/projects   (on VPS without Claude Code)\n- skipping claude-cowork: directory not found at ...                          (on Linux — Cowork is macOS-only)\nscanning openclaw: /home/user/.openclaw/agents/main/sessions\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 `<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:\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 `~/.openclaw/openclaw.json` at `mcp.servers.memex` (preserves other servers; idempotent):\n\n```sh\npython3 <<'PY'\nimport json, shutil\nfrom pathlib import Path\np = Path.home() / \".openclaw\" / \"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() / '.openclaw' / '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>/dev/null | grep -iE \"memex|mcp\" | tail -10 \\\n  || tail -100 ~/.openclaw/logs/gateway.log 2>/dev/null | 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 ~/.memex/logs/memex-sync.log 2>/dev/null\n```\n\n### 7b. memex.db has OpenClaw rows\n\n```sh\nsqlite3 ~/.memex/data/memex.db <<'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 ~/.memex/data/memex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\necho \"PRE: $PRE\"\n\n# >>> NOW send a test message in OpenClaw, wait for reply <<<\nsleep 8\n\nPOST=$(sqlite3 ~/.memex/data/memex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\necho \"POST: $POST  diff=$((POST - PRE))\"\n\nsqlite3 ~/.memex/data/memex.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 `~/.memex/data/memex.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 ~/.memex/data/memex.db within seconds\n    (the memex-sync daemon watches ~/.openclaw/agents/main/sessions/)\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 ~/.memex/data/memex.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/memex-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 < 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/writers. |\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 ~/.memex/data/memex.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 `~/.zshrc` / `~/.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\nFile v3.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7073ez7kp7shjm06s5vr7thd85wezr\",\n  \"slug\": \"install-memex-claw\",\n  \"version\": \"3.0.0\",\n  \"publishedAt\": 1779737663847\n}\n\nFile v3.0.0:skill-card.md\n\n## Description:\n\nWires the local-first memex MCP memory server into an OpenClaw gateway, installs or reuses the memex-mvp daemon, back-fills OpenClaw sessions into a local SQLite and FTS5 corpus, and exposes memex search and retrieval tools to the OpenClaw LLM toolset.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sedelev](https://clawhub.ai/user/sedelev)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and operators running OpenClaw use this skill to add persistent local memory: captured sessions, back-filled history, and MCP search tools backed by memex. It is intended for Linux or macOS OpenClaw deployments, including workstations, VPS hosts, self-hosted OpenClaw, and Moonshot Kimi-Claw.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: A persistent user-level service continuously indexes OpenClaw conversations into a local memex database.\n\nMitigation: Install only when continuous local session capture is intended; review the generated systemd user service or LaunchAgent before enabling it, and document disable, uninstall, and data-deletion steps.\n\nRisk: The skill installs memex-mvp from npm using a mutable latest package reference when memex is not already present or needs upgrade.\n\nMitigation: Prefer a pinned, verified memex-mvp version for controlled deployments and review the package source and checksum before installation.\n\nRisk: PATH changes and OpenClaw MCP configuration edits could affect future shell sessions or gateway behavior.\n\nMitigation: Confirm shell rc changes before relying on them, verify that OpenClaw configuration is merged rather than overwritten, and run the skill's MCP listing and fresh-session checks after restart.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/sedelev/skills/install-memex-claw)\n- [memex homepage](https://memex.parallelclaw.ai)\n- [memex-mvp npm package](https://www.npmjs.com/package/memex-mvp)\n- [Related install-memex skill](https://clawhub.ai/sedelev/install-memex)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, guidance, shell commands, configuration]\n\n**Output Format:** [Markdown with inline shell commands and JSON configuration guidance]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [The skill asks the agent to run discovery, installation, configuration, migration, and verification steps with concise human-facing status output.]\n\n## Skill Version(s):\n\n3.0.0 (source: frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v2.0.2: 2 files, 8593 bytes\n\nFiles: SKILL.md (21207b), _meta.json (137b)\n\nFile v2.0.2:SKILL.md\n\n---\nname: install-memex-claw\ndescription: Install the memex-openclaw plugin so OpenClaw captures every turn verbatim into a local memex.db, plus wire the memex MCP server for search tools. Plugin-based capture (OpenClaw 2026.5+) — no daemon, no file watching. Auto-detects whether memex-mvp is already installed on this machine (e.g. for Claude Code via the generic install-memex skill); if yes, just adds the OpenClaw plugin + MCP wiring; if no, full install. 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. memex-openclaw is most useful as a BRIDGE — pairs with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. If user only uses OpenClaw with built-in memory-core / Memoria / Mem0 — say so, that may be enough on its own.\nversion: 2.0.2\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    homepage: https://memex.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 verbatim memory system — for OpenClaw.\n\n**This installs two pieces:**\n\n1. **memex-openclaw plugin** — captures every turn verbatim into a local SQLite corpus via OpenClaw's `agent_end` hook. No daemon, no file watching, no JSON parsing.\n2. **memex-mvp MCP server** — exposes `memex_search`, `memex_recent`, `memex_overview` etc. as tools to the model.\n\nBoth write to the same `~/.memex/data/memex.db`. Schema is shared with [memex-hermes](https://pypi.org/project/memex-hermes/) (Python plugin for Hermes Agent) and any other future captures, so all your AI history lives in one searchable file.\n\n**Where you might be running:**\n\n- 🖥️ **VPS** (Linux VPS) — typical always-on agent deployment\n- 💻 **macOS workstation** running OpenClaw alongside Claude Code / etc.\n- 💻 **Linux workstation** (Pop!OS, Fedora, etc.)\n\n**Honest positioning:**\n\nmemex-openclaw is most useful as a **bridge** — joining OpenClaw turns into the unified memex corpus where memex-mvp also captures Claude Code, Hermes, Telegram exports, etc. If the user only uses OpenClaw and is happy with built-in memory-core / Memoria / Mem0, **say so up front** — they may not need this. memex-openclaw earns its place when the user wants cross-client unified search.\n\n**The contract:** zero questions to the user. Discovery → actions → verification. Each step prints one 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 two open-source MIT packages:\n\n| Action | Why | Source |\n|---|---|---|\n| `npm install -g memex-mvp` | memex CLI + MCP server | [npmjs.com/package/memex-mvp](https://www.npmjs.com/package/memex-mvp), source: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) |\n| `openclaw plugins install @parallelclaw/memex-openclaw` | OpenClaw plugin for verbatim capture | [npmjs.com/package/@parallelclaw/memex-openclaw](https://www.npmjs.com/package/@parallelclaw/memex-openclaw) |\n| Edit `~/.openclaw/openclaw.json` | enable plugin + add memex MCP | OpenClaw's own config |\n| `openclaw gateway restart` | apply plugin + MCP changes | OpenClaw's own command |\n\n**Zero outbound network traffic at runtime** — memex stores locally in `~/.memex/data/memex.db`. The skill never uploads conversations anywhere.\n\n---\n\n## Before this skill can be installed (one-time OpenClaw bootstrap)\n\nOn a **fresh** OpenClaw VPS, the default config may not allow installing third-party plugins. Symptom: `openclaw plugins install ...` errors with \"plugin not allowed\" or similar.\n\nIf you hit this — open `~/.openclaw/openclaw.json`, find the `plugins.allow` or equivalent permission key (the exact name varies by OpenClaw version — check `openclaw config --help` or your OpenClaw docs), add the permission for third-party plugin installation, restart the gateway with `openclaw gateway restart`. Then re-run this skill.\n\nThe skill does **not** edit permissions itself — that's a one-time trust decision the user makes manually.\n\n---\n\n## Prerequisite\n\nOpenClaw **2026.5.0 or later** (plugin SDK with `definePluginEntry` + memory corpus supplements). Older versions used a different plugin model and are not supported by memex-openclaw v0.1.\n\n---\n\n## Step 1 — Discovery (run ALL checks first, then decide)\n\n```sh\n# 1. OpenClaw present? Plugin SDK available?\nopenclaw --version 2>&1 | head -3 || echo \"openclaw not in PATH\"\n\n# 2. Node ≥ 22.12 (required by OpenClaw + plugin)\nnode --version\n\n# 3. Is memex already installed (e.g. via generic install-memex skill)?\nnode -e \"console.log(require('memex-mvp/package.json').version)\" 2>&1 || echo \"memex-mvp not installed\"\n\n# 4. Is memex-openclaw plugin already installed?\nls ~/.openclaw/plugins/installs.json 2>/dev/null && \\\n  grep -l 'memex-openclaw' ~/.openclaw/plugins/installs.json 2>/dev/null\n\n# 5. Is the OLD v0.11.x memex-sync daemon running? (must be stopped if so)\nsystemctl --user status memex-sync 2>&1 | head -5 || \\\n  launchctl list | grep memex 2>&1 || \\\n  echo \"no old daemon\"\n\n# 6. Existing memex.db?\nls -la ~/.memex/data/memex.db 2>&1 | head -2\n\n# 7. OpenClaw config location\nls -la ~/.openclaw/openclaw.json 2>&1\n```\n\n**Branch on results:**\n\n| State | Action |\n|---|---|\n| OpenClaw not found | Stop. Tell user this skill is for OpenClaw agents only. |\n| Node < 22.12 | Stop. Print upgrade instructions. Don't auto-install Node. |\n| memex-mvp ≥ 0.12 + plugin installed + no old daemon | Skip Steps 2–4. Go to Step 5 (MCP wiring). |\n| memex-mvp < 0.12 or missing | Run Step 2 (install/upgrade memex-mvp) |\n| Old memex-sync daemon running | Step 3a — stop and disable it (it conflicts with the plugin's capture path) |\n| Plugin not installed | Run Step 3b (install plugin) |\n| No openclaw.json found | Ask the user ONE question: where is your gateway config? |\n\nReport each result back to the user as **facts**:\n\n> \"✓ OpenClaw 2026.5.4 detected\"  \n> \"✓ Node 22.22.2 — ok\"  \n> \"→ memex-mvp not installed — will install 0.12.0+\"  \n> \"→ memex-openclaw plugin not installed — will install 0.1.0+\"  \n> \"✓ No old daemon to disable\"\n\n---\n\n## Step 2 — Install memex-mvp (skip if already at ≥ 0.12)\n\nmemex-mvp provides the `memex` CLI + the MCP server with search tools. The OpenClaw plugin writes to the same DB independently.\n\n```sh\nnpm install -g memex-mvp@latest\nmemex --version    # must be 0.12.0 or later\n```\n\nIf `EACCES` (no permission to write to npm global prefix), apply the standard fix — **never use sudo**:\n\n```sh\nmkdir -p ~/.npm-global\nnpm config set prefix ~/.npm-global\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc 2>/dev/null\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc 2>/dev/null\nexport PATH=$HOME/.npm-global/bin:$PATH\nnpm install -g memex-mvp@latest\n```\n\n---\n\n## Step 3a — Stop the old daemon (skip if not running)\n\nmemex-mvp v0.11.x shipped a `memex-sync` daemon that polled OpenClaw session files. v0.12 + the plugin replace that path. If the old daemon is still running, **stop and disable it** — otherwise both paths will write to memex.db using different `conv_id` schemes and you'll get duplicated conversations.\n\n```sh\n# Linux (systemd user)\nsystemctl --user disable --now memex-sync 2>&1 || true\n\n# macOS (LaunchAgent)\nlaunchctl unload ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist 2>&1 || true\nrm -f ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist 2>&1 || true\n```\n\nVerify nothing is left running:\n\n```sh\nps aux | grep -i memex-sync | grep -v grep\n```\n\nShould print nothing.\n\n---\n\n## Step 3b — Install the memex-openclaw plugin\n\n```sh\nopenclaw plugins install @parallelclaw/memex-openclaw\n```\n\nAlternatives if `npm` install through OpenClaw isn't available:\n\n```sh\n# Direct local install (if you have the source)\ngit clone https://github.com/parallelclaw/memex-mvp.git /tmp/memex-mvp\ncd /tmp/memex-mvp/plugins/memex-openclaw\nnpm install\nopenclaw plugins install --link \"$(pwd)\"\n```\n\nVerify registration:\n\n```sh\nls ~/.openclaw/plugins/installs.json && cat ~/.openclaw/plugins/installs.json | grep memex-openclaw\n```\n\nShould show `\"memex-openclaw\"` in the registry.\n\n---\n\n## Step 4 — Enable plugin in openclaw.json (BOTH `enabled` AND `allowConversationAccess` required)\n\nOpenClaw 2026.5+ runs **non-bundled** (npm-installed) plugins in a sandboxed mode by default. The `agent_end` / `before_compaction` / `session_end` hooks — which memex-openclaw uses to capture turns — are **blocked** unless the user explicitly grants `hooks.allowConversationAccess: true` in the plugin's config entry. Without this, the plugin registers, tools work, but **no new conversations get captured**.\n\n> **Why this is a manual step:** OpenClaw's security model says non-bundled plugins cannot self-declare conversation-access via their own manifest. The user (or this skill on the user's behalf) must explicitly opt-in. This is by design — same model as Android runtime permissions.\n\nEdit `~/.openclaw/openclaw.json` and add the plugin entry. Use `jq` or a careful manual edit — preserve existing keys, **merge don't overwrite**:\n\n```sh\n# Show current plugins entries:\ncat ~/.openclaw/openclaw.json | python3 -c \"\nimport json, sys\ncfg = json.load(sys.stdin)\nprint(json.dumps(cfg.get('plugins', {}).get('entries', {}), indent=2))\n\"\n```\n\nAdd (or update) the `plugins.entries.memex-openclaw` block — note the **two** required keys:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"memex-openclaw\": {\n        \"enabled\": true,\n        \"hooks\": {\n          \"allowConversationAccess\": true\n        }\n      }\n    }\n  }\n}\n```\n\nSafe merge via Python (preserves existing config keys, idempotent on re-runs):\n\n```sh\npython3 <<'PY'\nimport json\nfrom pathlib import Path\np = Path.home() / \".openclaw\" / \"openclaw.json\"\ncfg = json.loads(p.read_text())\nentry = cfg.setdefault(\"plugins\", {}).setdefault(\"entries\", {}).setdefault(\"memex-openclaw\", {})\nentry[\"enabled\"] = True\n# CRITICAL — without this, agent_end hook is BLOCKED by OpenClaw gateway\n# and no new conversations get captured. Bug 6 in skill changelog.\nentry.setdefault(\"hooks\", {})[\"allowConversationAccess\"] = True\np.write_text(json.dumps(cfg, indent=2))\nprint(\"memex-openclaw enabled with allowConversationAccess in\", p)\nPY\n```\n\n**Verify the merge worked**:\n\n```sh\npython3 -c \"\nimport json\nfrom pathlib import Path\ncfg = json.loads((Path.home() / '.openclaw' / 'openclaw.json').read_text())\ne = cfg.get('plugins', {}).get('entries', {}).get('memex-openclaw', {})\nprint('enabled:', e.get('enabled'))\nprint('allowConversationAccess:', e.get('hooks', {}).get('allowConversationAccess'))\n\"\n# Both must be True\n```\n\n---\n\n## Step 5 — Wire memex as an MCP server (REQUIRED for LLM retrieval)\n\n> **Before v2.0.2 this step was marked optional. It is not optional.** Without it, the LLM agent has no way to *search* memex from inside an OpenClaw conversation. The plugin handles **capture** (write path); the MCP server handles **retrieval** (read path). Both are needed.\n>\n> Specifically: the plugin's `api.registerTool('memex_search', ...)` registrations create RPC tools in OpenClaw's gateway registry — they're callable via direct `tool.call(...)` but **do not appear in the LLM's function-calling toolset**. The LLM's toolset is populated from `mcp.servers` config at session start by the MCP runtime adapter. So if memex isn't in `mcp.servers`, the agent will fall back to raw `sqlite3` calls (or fail) when asked to search.\n\n> **Config-key gotcha** — OpenClaw 2026.5+ reads MCP servers from `cfg.mcp.servers` (nested), NOT from the top-level `cfg.mcpServers` (flat). Pre-v2.0.2 of this skill wrote to the flat key, which OpenClaw silently ignored. Verify with `openclaw mcp list` after the merge — it must show `memex`.\n\nFind the absolute path to `memex` binary (MCP stdio doesn't inherit shell PATH):\n\n```sh\nwhich memex\n```\n\nMerge memex into `~/.openclaw/openclaw.json` at the correct path `mcp.servers.memex` (preserves other servers; idempotent on re-runs):\n\n```sh\npython3 <<'PY'\nimport json, shutil\nfrom pathlib import Path\np = Path.home() / \".openclaw\" / \"openclaw.json\"\ncfg = json.loads(p.read_text())\n\nmemex_bin = shutil.which(\"memex\")\nif not memex_bin:\n    print(\"ERROR: memex binary not in PATH; rerun Step 2 to install memex-mvp\")\n    raise SystemExit(1)\n\n# Correct path is mcp.servers (nested), NOT mcpServers (flat).\n# Both keys exist in different OpenClaw documentation versions; only\n# mcp.servers is actually loaded by the MCP runtime adapter in 2026.5+.\nmcp_section = cfg.setdefault(\"mcp\", {})\nservers = mcp_section.setdefault(\"servers\", {})\nservers[\"memex\"] = {\n    \"command\": memex_bin,\n    \"args\": [],\n    \"env\": {}\n}\n\n# If a stale mcpServers.memex from old skill version exists, clean it up\n# so users aren't confused by two \"memex\" entries showing up in tooling.\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. The config has the right key:\npython3 -c \"\nimport json\nfrom pathlib import Path\ncfg = json.loads((Path.home() / '.openclaw' / '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 (this is the authoritative check):\nopenclaw mcp list 2>&1 | grep -i memex\n# Must show 'memex' or similar.\n\n# 3. After the next restart (Step 6), the LLM toolset includes memex_search.\n# That's verified in Step 7d below.\n```\n\n---\n\n## Step 6 — Restart OpenClaw\n\n```sh\nopenclaw gateway restart\n```\n\nWait ~5 seconds, then check logs for plugin activation:\n\n```sh\ntail -30 ~/.openclaw/logs/gateway.log 2>/dev/null | grep -iE \"memex\" | tail -10\n```\n\nYou should see something like:\n\n```\nmemex-openclaw: opened ~/.memex/data/memex.db (current rows: N)\nmemex-openclaw: registered as memory corpus supplement\nmemex-openclaw: plugin activated\n```\n\n---\n\n## Step 7 — Verify (three checks — all must pass)\n\n### 7a. No `BLOCKED` messages in gateway log\n\nIf Step 4 wasn't done right, the gateway log will say something like `typed hook \"agent_end\" BLOCKED because non-bundled plugins must set ... allowConversationAccess=true`. After Step 4 + Step 6 restart, this message should NOT appear for any new restarts:\n\n```sh\njournalctl --user -u openclaw -n 200 --no-pager 2>/dev/null \\\n  | grep -iE 'memex-openclaw|BLOCKED|allowConversationAccess' | tail -10 \\\n  || tail -300 ~/.openclaw/logs/gateway.log 2>/dev/null \\\n  | grep -iE 'memex-openclaw|BLOCKED|allowConversationAccess' | tail -10\n```\n\nIf `BLOCKED` still appears → re-do Step 4, then `openclaw gateway restart` again.\n\n### 7b. Capture pipeline writes a NEW row\n\nSnapshot the DB, send a test message in OpenClaw, snapshot again. Diff must be ≥ 2 (user + assistant) AND the new rows must have `raw_type='openclaw-agent-end'` — that's the marker that the **plugin** wrote them, not legacy file-watcher.\n\n```sh\nPRE=$(sqlite3 ~/.memex/data/memex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\nPRE_TS=$(sqlite3 ~/.memex/data/memex.db \\\n  \"SELECT MAX(ts) FROM messages WHERE source='openclaw'\")\necho \"PRE: rows=$PRE  latest_ts=$PRE_TS\"\n\n# >>> NOW send a test message in OpenClaw and wait for the reply <<<\nsleep 5\n\nPOST=$(sqlite3 ~/.memex/data/memex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\necho \"POST: rows=$POST  diff=$((POST - PRE))\"\n\n# The plugin tags its writes with raw_type='openclaw-agent-end'.\n# Legacy file-watcher writes have raw_type='openclaw-jsonl' — those DON'T\n# count as plugin-driven capture.\nsqlite3 ~/.memex/data/memex.db \\\n  \"SELECT id, role, ts, substr(text, 1, 60) AS preview,\n          json_extract(metadata, '$.raw_type') AS raw_type\n     FROM messages\n    WHERE source='openclaw' AND ts > $PRE_TS\n    ORDER BY ts DESC LIMIT 5\"\n```\n\nExpected: 2+ new rows, all with `raw_type='openclaw-agent-end'`.\n\n### 7c. Sample messages have the right conversation_id shape\n\n```sh\nsqlite3 ~/.memex/data/memex.db <<'SQL'\n.headers on\n.mode column\nSELECT id, role, channel,\n       datetime(ts, 'unixepoch', 'localtime') AS when_,\n       substr(text, 1, 60) AS preview,\n       conversation_id\n  FROM messages\n WHERE source='openclaw'\n ORDER BY ts DESC LIMIT 5;\nSQL\n```\n\nYou should see your recent turns captured with `conversation_id` like `openclaw-telegram-<chat_id>` or `openclaw-cli-<session8>` depending on the channel.\n\n### 7d. LLM toolset includes memex tools (requires a FRESH 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` was already running before the restart, so it has the OLD toolset (no memex). To verify memex is exposed:\n\n1. Start a **fresh** OpenClaw conversation (`/new` or open a new session — depends on how the user interacts with OpenClaw: webchat / Telegram / CLI).\n2. Ask the agent something that should trigger memex usage:\n   > \"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 `~/.memex/data/memex.db`)\n   - NOT fall back to direct `sqlite3` calls\n\nIf the agent says it 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 steps:\n\n```\n✅ memex-openclaw plugin installed and activated.\n\nCaptured:\n  • Every new OpenClaw turn is now written verbatim to ~/.memex/data/memex.db\n  • Channel comes from OpenClaw context directly (no parsing)\n  • Plugin sees turns via agent_end hook + preserves before_compaction\n  • Built-in memory_search tool now surfaces memex content as \"memex\" corpus\n\nSearch:\n  • `memex search \"query\"` — CLI\n  • `memex overview` — corpus snapshot\n  • From inside OpenClaw chat: ask the model to search its memory\n  • From any MCP-enabled client (Claude Code, Cursor, etc.) — the memex MCP\n    server exposes 11 search tools\n\nWhat this does NOT do:\n  • Backfill old OpenClaw sessions. Plugin captures from this point\n    forward. If you want historical capture, that's a separate one-shot\n    tool (`memex-sync import-openclaw <dir>` — coming in 0.12.x).\n  • Replace OpenClaw's built-in memory-core. Memex is a corpus supplement.\n\nPair this with:\n  • install-memex (generic skill) — for capturing Claude Code, Cursor,\n    Telegram on the same machine into the same memex.db\n  • memex-hermes (pip) — for Hermes Agent on the same machine\n```\n\n---\n\n## What this skill explicitly does NOT do\n\n- ❌ Install Node.js or upgrade your system Node (manual step if needed)\n- ❌ Use sudo. Ever. If permissions block something, surface the manual fix and stop.\n- ❌ Configure outbound network access. memex is local-first.\n- ❌ Overwrite existing `mcpServers` entries. Merge.\n- ❌ Backfill old OpenClaw history. Plugin captures forward only.\n- ❌ Run if no openclaw.json is found. Asks the user once.\n\n---\n\n## Edge cases\n\n| Condition | What to do |\n|---|---|\n| OpenClaw < 2026.5 | Stop. memex-openclaw requires the new plugin SDK. Tell the user to upgrade OpenClaw. |\n| memex.db locked (WAL contention) | Wait 1 second, retry. SQLite WAL handles concurrent readers/writers. |\n| Plugin install fails with \"permission denied\" | Bootstrap section at the top of this skill — user needs to allow third-party plugins one-time. |\n| User already has Mem0 or Memoria as memory provider | No conflict. memex-openclaw registers as a SUPPLEMENT, not as the exclusive memory provider. Both coexist. |\n| User has the OLD v0.11.x daemon AND wants to keep historical conv-ids | Don't migrate. Document that the new plugin uses a different `conv_id` scheme; old data stays in DB under old scheme as historical record. |\n| Plugin not picked up after restart | Check `~/.openclaw/plugins/installs.json` registry, check `plugins.entries.memex-openclaw.enabled=true` in openclaw.json, restart again. |\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 the user's PATH outside `~/.zshrc` / `~/.bashrc` with their 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 (so they can spot anything unexpected).\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\nFile v2.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7073ez7kp7shjm06s5vr7thd85wezr\",\n  \"slug\": \"install-memex-claw\",\n  \"version\": \"2.0.2\",\n  \"publishedAt\": 1779651664982\n}\n\nArchive v2.0.1: 2 files, 7543 bytes\n\nFiles: SKILL.md (18512b), _meta.json (137b)\n\nFile v2.0.1:SKILL.md\n\n---\nname: install-memex-claw\ndescription: Install the memex-openclaw plugin so OpenClaw captures every turn verbatim into a local memex.db, plus wire the memex MCP server for search tools. Plugin-based capture (OpenClaw 2026.5+) — no daemon, no file watching. Auto-detects whether memex-mvp is already installed on this machine (e.g. for Claude Code via the generic install-memex skill); if yes, just adds the OpenClaw plugin + MCP wiring; if no, full install. 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. memex-openclaw is most useful as a BRIDGE — pairs with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. If user only uses OpenClaw with built-in memory-core / Memoria / Mem0 — say so, that may be enough on its own.\nversion: 2.0.1\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    homepage: https://memex.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 verbatim memory system — for OpenClaw.\n\n**This installs two pieces:**\n\n1. **memex-openclaw plugin** — captures every turn verbatim into a local SQLite corpus via OpenClaw's `agent_end` hook. No daemon, no file watching, no JSON parsing.\n2. **memex-mvp MCP server** — exposes `memex_search`, `memex_recent`, `memex_overview` etc. as tools to the model.\n\nBoth write to the same `~/.memex/data/memex.db`. Schema is shared with [memex-hermes](https://pypi.org/project/memex-hermes/) (Python plugin for Hermes Agent) and any other future captures, so all your AI history lives in one searchable file.\n\n**Where you might be running:**\n\n- 🖥️ **VPS** (Linux VPS) — typical always-on agent deployment\n- 💻 **macOS workstation** running OpenClaw alongside Claude Code / etc.\n- 💻 **Linux workstation** (Pop!OS, Fedora, etc.)\n\n**Honest positioning:**\n\nmemex-openclaw is most useful as a **bridge** — joining OpenClaw turns into the unified memex corpus where memex-mvp also captures Claude Code, Hermes, Telegram exports, etc. If the user only uses OpenClaw and is happy with built-in memory-core / Memoria / Mem0, **say so up front** — they may not need this. memex-openclaw earns its place when the user wants cross-client unified search.\n\n**The contract:** zero questions to the user. Discovery → actions → verification. Each step prints one 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 two open-source MIT packages:\n\n| Action | Why | Source |\n|---|---|---|\n| `npm install -g memex-mvp` | memex CLI + MCP server | [npmjs.com/package/memex-mvp](https://www.npmjs.com/package/memex-mvp), source: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) |\n| `openclaw plugins install @parallelclaw/memex-openclaw` | OpenClaw plugin for verbatim capture | [npmjs.com/package/@parallelclaw/memex-openclaw](https://www.npmjs.com/package/@parallelclaw/memex-openclaw) |\n| Edit `~/.openclaw/openclaw.json` | enable plugin + add memex MCP | OpenClaw's own config |\n| `openclaw gateway restart` | apply plugin + MCP changes | OpenClaw's own command |\n\n**Zero outbound network traffic at runtime** — memex stores locally in `~/.memex/data/memex.db`. The skill never uploads conversations anywhere.\n\n---\n\n## Before this skill can be installed (one-time OpenClaw bootstrap)\n\nOn a **fresh** OpenClaw VPS, the default config may not allow installing third-party plugins. Symptom: `openclaw plugins install ...` errors with \"plugin not allowed\" or similar.\n\nIf you hit this — open `~/.openclaw/openclaw.json`, find the `plugins.allow` or equivalent permission key (the exact name varies by OpenClaw version — check `openclaw config --help` or your OpenClaw docs), add the permission for third-party plugin installation, restart the gateway with `openclaw gateway restart`. Then re-run this skill.\n\nThe skill does **not** edit permissions itself — that's a one-time trust decision the user makes manually.\n\n---\n\n## Prerequisite\n\nOpenClaw **2026.5.0 or later** (plugin SDK with `definePluginEntry` + memory corpus supplements). Older versions used a different plugin model and are not supported by memex-openclaw v0.1.\n\n---\n\n## Step 1 — Discovery (run ALL checks first, then decide)\n\n```sh\n# 1. OpenClaw present? Plugin SDK available?\nopenclaw --version 2>&1 | head -3 || echo \"openclaw not in PATH\"\n\n# 2. Node ≥ 22.12 (required by OpenClaw + plugin)\nnode --version\n\n# 3. Is memex already installed (e.g. via generic install-memex skill)?\nnode -e \"console.log(require('memex-mvp/package.json').version)\" 2>&1 || echo \"memex-mvp not installed\"\n\n# 4. Is memex-openclaw plugin already installed?\nls ~/.openclaw/plugins/installs.json 2>/dev/null && \\\n  grep -l 'memex-openclaw' ~/.openclaw/plugins/installs.json 2>/dev/null\n\n# 5. Is the OLD v0.11.x memex-sync daemon running? (must be stopped if so)\nsystemctl --user status memex-sync 2>&1 | head -5 || \\\n  launchctl list | grep memex 2>&1 || \\\n  echo \"no old daemon\"\n\n# 6. Existing memex.db?\nls -la ~/.memex/data/memex.db 2>&1 | head -2\n\n# 7. OpenClaw config location\nls -la ~/.openclaw/openclaw.json 2>&1\n```\n\n**Branch on results:**\n\n| State | Action |\n|---|---|\n| OpenClaw not found | Stop. Tell user this skill is for OpenClaw agents only. |\n| Node < 22.12 | Stop. Print upgrade instructions. Don't auto-install Node. |\n| memex-mvp ≥ 0.12 + plugin installed + no old daemon | Skip Steps 2–4. Go to Step 5 (MCP wiring). |\n| memex-mvp < 0.12 or missing | Run Step 2 (install/upgrade memex-mvp) |\n| Old memex-sync daemon running | Step 3a — stop and disable it (it conflicts with the plugin's capture path) |\n| Plugin not installed | Run Step 3b (install plugin) |\n| No openclaw.json found | Ask the user ONE question: where is your gateway config? |\n\nReport each result back to the user as **facts**:\n\n> \"✓ OpenClaw 2026.5.4 detected\"  \n> \"✓ Node 22.22.2 — ok\"  \n> \"→ memex-mvp not installed — will install 0.12.0+\"  \n> \"→ memex-openclaw plugin not installed — will install 0.1.0+\"  \n> \"✓ No old daemon to disable\"\n\n---\n\n## Step 2 — Install memex-mvp (skip if already at ≥ 0.12)\n\nmemex-mvp provides the `memex` CLI + the MCP server with search tools. The OpenClaw plugin writes to the same DB independently.\n\n```sh\nnpm install -g memex-mvp@latest\nmemex --version    # must be 0.12.0 or later\n```\n\nIf `EACCES` (no permission to write to npm global prefix), apply the standard fix — **never use sudo**:\n\n```sh\nmkdir -p ~/.npm-global\nnpm config set prefix ~/.npm-global\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc 2>/dev/null\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc 2>/dev/null\nexport PATH=$HOME/.npm-global/bin:$PATH\nnpm install -g memex-mvp@latest\n```\n\n---\n\n## Step 3a — Stop the old daemon (skip if not running)\n\nmemex-mvp v0.11.x shipped a `memex-sync` daemon that polled OpenClaw session files. v0.12 + the plugin replace that path. If the old daemon is still running, **stop and disable it** — otherwise both paths will write to memex.db using different `conv_id` schemes and you'll get duplicated conversations.\n\n```sh\n# Linux (systemd user)\nsystemctl --user disable --now memex-sync 2>&1 || true\n\n# macOS (LaunchAgent)\nlaunchctl unload ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist 2>&1 || true\nrm -f ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist 2>&1 || true\n```\n\nVerify nothing is left running:\n\n```sh\nps aux | grep -i memex-sync | grep -v grep\n```\n\nShould print nothing.\n\n---\n\n## Step 3b — Install the memex-openclaw plugin\n\n```sh\nopenclaw plugins install @parallelclaw/memex-openclaw\n```\n\nAlternatives if `npm` install through OpenClaw isn't available:\n\n```sh\n# Direct local install (if you have the source)\ngit clone https://github.com/parallelclaw/memex-mvp.git /tmp/memex-mvp\ncd /tmp/memex-mvp/plugins/memex-openclaw\nnpm install\nopenclaw plugins install --link \"$(pwd)\"\n```\n\nVerify registration:\n\n```sh\nls ~/.openclaw/plugins/installs.json && cat ~/.openclaw/plugins/installs.json | grep memex-openclaw\n```\n\nShould show `\"memex-openclaw\"` in the registry.\n\n---\n\n## Step 4 — Enable plugin in openclaw.json (BOTH `enabled` AND `allowConversationAccess` required)\n\nOpenClaw 2026.5+ runs **non-bundled** (npm-installed) plugins in a sandboxed mode by default. The `agent_end` / `before_compaction` / `session_end` hooks — which memex-openclaw uses to capture turns — are **blocked** unless the user explicitly grants `hooks.allowConversationAccess: true` in the plugin's config entry. Without this, the plugin registers, tools work, but **no new conversations get captured**.\n\n> **Why this is a manual step:** OpenClaw's security model says non-bundled plugins cannot self-declare conversation-access via their own manifest. The user (or this skill on the user's behalf) must explicitly opt-in. This is by design — same model as Android runtime permissions.\n\nEdit `~/.openclaw/openclaw.json` and add the plugin entry. Use `jq` or a careful manual edit — preserve existing keys, **merge don't overwrite**:\n\n```sh\n# Show current plugins entries:\ncat ~/.openclaw/openclaw.json | python3 -c \"\nimport json, sys\ncfg = json.load(sys.stdin)\nprint(json.dumps(cfg.get('plugins', {}).get('entries', {}), indent=2))\n\"\n```\n\nAdd (or update) the `plugins.entries.memex-openclaw` block — note the **two** required keys:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"memex-openclaw\": {\n        \"enabled\": true,\n        \"hooks\": {\n          \"allowConversationAccess\": true\n        }\n      }\n    }\n  }\n}\n```\n\nSafe merge via Python (preserves existing config keys, idempotent on re-runs):\n\n```sh\npython3 <<'PY'\nimport json\nfrom pathlib import Path\np = Path.home() / \".openclaw\" / \"openclaw.json\"\ncfg = json.loads(p.read_text())\nentry = cfg.setdefault(\"plugins\", {}).setdefault(\"entries\", {}).setdefault(\"memex-openclaw\", {})\nentry[\"enabled\"] = True\n# CRITICAL — without this, agent_end hook is BLOCKED by OpenClaw gateway\n# and no new conversations get captured. Bug 6 in skill changelog.\nentry.setdefault(\"hooks\", {})[\"allowConversationAccess\"] = True\np.write_text(json.dumps(cfg, indent=2))\nprint(\"memex-openclaw enabled with allowConversationAccess in\", p)\nPY\n```\n\n**Verify the merge worked**:\n\n```sh\npython3 -c \"\nimport json\nfrom pathlib import Path\ncfg = json.loads((Path.home() / '.openclaw' / 'openclaw.json').read_text())\ne = cfg.get('plugins', {}).get('entries', {}).get('memex-openclaw', {})\nprint('enabled:', e.get('enabled'))\nprint('allowConversationAccess:', e.get('hooks', {}).get('allowConversationAccess'))\n\"\n# Both must be True\n```\n\n---\n\n## Step 5 — Wire memex into the OpenClaw gateway's MCP-server config (optional but recommended)\n\nThe plugin handles capture. The memex-mvp MCP server provides additional **search/retrieval tools** to the model (`memex_search`, `memex_recent`, `memex_overview`, etc.). If you already have the OpenClaw built-in `memory_search` tool via the plugin's corpus supplement, this is **optional** — the model can search memex through built-in `memory_search`. But for direct access to memex's full MCP tool set, wire it.\n\nFind the absolute path to `memex` binary (MCP stdio doesn't inherit shell PATH):\n\n```sh\nwhich memex\n```\n\nAdd to `~/.openclaw/openclaw.json` `mcpServers` section (don't overwrite other servers):\n\n```sh\npython3 <<PY\nimport json\nfrom pathlib import Path\np = Path.home() / \".openclaw\" / \"openclaw.json\"\ncfg = json.loads(p.read_text())\nmcp = cfg.setdefault(\"mcpServers\", {})\nimport shutil\nmemex_bin = shutil.which(\"memex\")\nif not memex_bin:\n    print(\"ERROR: memex binary not in PATH; rerun Step 2\")\n    raise SystemExit(1)\nmcp[\"memex\"] = { \"command\": memex_bin, \"args\": [], \"env\": {} }\np.write_text(json.dumps(cfg, indent=2))\nprint(\"memex MCP wired at\", p)\nPY\n```\n\n---\n\n## Step 6 — Restart OpenClaw\n\n```sh\nopenclaw gateway restart\n```\n\nWait ~5 seconds, then check logs for plugin activation:\n\n```sh\ntail -30 ~/.openclaw/logs/gateway.log 2>/dev/null | grep -iE \"memex\" | tail -10\n```\n\nYou should see something like:\n\n```\nmemex-openclaw: opened ~/.memex/data/memex.db (current rows: N)\nmemex-openclaw: registered as memory corpus supplement\nmemex-openclaw: plugin activated\n```\n\n---\n\n## Step 7 — Verify (three checks — all must pass)\n\n### 7a. No `BLOCKED` messages in gateway log\n\nIf Step 4 wasn't done right, the gateway log will say something like `typed hook \"agent_end\" BLOCKED because non-bundled plugins must set ... allowConversationAccess=true`. After Step 4 + Step 6 restart, this message should NOT appear for any new restarts:\n\n```sh\njournalctl --user -u openclaw -n 200 --no-pager 2>/dev/null \\\n  | grep -iE 'memex-openclaw|BLOCKED|allowConversationAccess' | tail -10 \\\n  || tail -300 ~/.openclaw/logs/gateway.log 2>/dev/null \\\n  | grep -iE 'memex-openclaw|BLOCKED|allowConversationAccess' | tail -10\n```\n\nIf `BLOCKED` still appears → re-do Step 4, then `openclaw gateway restart` again.\n\n### 7b. Capture pipeline writes a NEW row\n\nSnapshot the DB, send a test message in OpenClaw, snapshot again. Diff must be ≥ 2 (user + assistant) AND the new rows must have `raw_type='openclaw-agent-end'` — that's the marker that the **plugin** wrote them, not legacy file-watcher.\n\n```sh\nPRE=$(sqlite3 ~/.memex/data/memex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\nPRE_TS=$(sqlite3 ~/.memex/data/memex.db \\\n  \"SELECT MAX(ts) FROM messages WHERE source='openclaw'\")\necho \"PRE: rows=$PRE  latest_ts=$PRE_TS\"\n\n# >>> NOW send a test message in OpenClaw and wait for the reply <<<\nsleep 5\n\nPOST=$(sqlite3 ~/.memex/data/memex.db \\\n  \"SELECT COUNT(*) FROM messages WHERE source='openclaw'\")\necho \"POST: rows=$POST  diff=$((POST - PRE))\"\n\n# The plugin tags its writes with raw_type='openclaw-agent-end'.\n# Legacy file-watcher writes have raw_type='openclaw-jsonl' — those DON'T\n# count as plugin-driven capture.\nsqlite3 ~/.memex/data/memex.db \\\n  \"SELECT id, role, ts, substr(text, 1, 60) AS preview,\n          json_extract(metadata, '$.raw_type') AS raw_type\n     FROM messages\n    WHERE source='openclaw' AND ts > $PRE_TS\n    ORDER BY ts DESC LIMIT 5\"\n```\n\nExpected: 2+ new rows, all with `raw_type='openclaw-agent-end'`.\n\n### 7c. Sample messages have the right conversation_id shape\n\n```sh\nsqlite3 ~/.memex/data/memex.db <<'SQL'\n.headers on\n.mode column\nSELECT id, role, channel,\n       datetime(ts, 'unixepoch', 'localtime') AS when_,\n       substr(text, 1, 60) AS preview,\n       conversation_id\n  FROM messages\n WHERE source='openclaw'\n ORDER BY ts DESC LIMIT 5;\nSQL\n```\n\nYou should see your recent turns captured with `conversation_id` like `openclaw-telegram-<chat_id>` or `openclaw-cli-<session8>` depending on the channel.\n\nFor the model side — open OpenClaw chat, ask: \"search your memory for X\" — and the built-in `memory_search` should now include memex rows in results (via the corpus supplement registration).\n\n---\n\n## Step 8 — Final message to user\n\nAfter all steps:\n\n```\n✅ memex-openclaw plugin installed and activated.\n\nCaptured:\n  • Every new OpenClaw turn is now written verbatim to ~/.memex/data/memex.db\n  • Channel comes from OpenClaw context directly (no parsing)\n  • Plugin sees turns via agent_end hook + preserves before_compaction\n  • Built-in memory_search tool now surfaces memex content as \"memex\" corpus\n\nSearch:\n  • `memex search \"query\"` — CLI\n  • `memex overview` — corpus snapshot\n  • From inside OpenClaw chat: ask the model to search its memory\n  • From any MCP-enabled client (Claude Code, Cursor, etc.) — the memex MCP\n    server exposes 11 search tools\n\nWhat this does NOT do:\n  • Backfill old OpenClaw sessions. Plugin captures from this point\n    forward. If you want historical capture, that's a separate one-shot\n    tool (`memex-sync import-openclaw <dir>` — coming in 0.12.x).\n  • Replace OpenClaw's built-in memory-core. Memex is a corpus supplement.\n\nPair this with:\n  • install-memex (generic skill) — for capturing Claude Code, Cursor,\n    Telegram on the same machine into the same memex.db\n  • memex-hermes (pip) — for Hermes Agent on the same machine\n```\n\n---\n\n## What this skill explicitly does NOT do\n\n- ❌ Install Node.js or upgrade your system Node (manual step if needed)\n- ❌ Use sudo. Ever. If permissions block something, surface the manual fix and stop.\n- ❌ Configure outbound network access. memex is local-first.\n- ❌ Overwrite existing `mcpServers` entries. Merge.\n- ❌ Backfill old OpenClaw history. Plugin captures forward only.\n- ❌ Run if no openclaw.json is found. Asks the user once.\n\n---\n\n## Edge cases\n\n| Condition | What to do |\n|---|---|\n| OpenClaw < 2026.5 | Stop. memex-openclaw requires the new plugin SDK. Tell the user to upgrade OpenClaw. |\n| memex.db locked (WAL contention) | Wait 1 second, retry. SQLite WAL handles concurrent readers/writers. |\n| Plugin install fails with \"permission denied\" | Bootstrap section at the top of this skill — user needs to allow third-party plugins one-time. |\n| User already has Mem0 or Memoria as memory provider | No conflict. memex-openclaw registers as a SUPPLEMENT, not as the exclusive memory provider. Both coexist. |\n| User has the OLD v0.11.x daemon AND wants to keep historical conv-ids | Don't migrate. Document that the new plugin uses a different `conv_id` scheme; old data stays in DB under old scheme as historical record. |\n| Plugin not picked up after restart | Check `~/.openclaw/plugins/installs.json` registry, check `plugins.entries.memex-openclaw.enabled=true` in openclaw.json, restart again. |\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 the user's PATH outside `~/.zshrc` / `~/.bashrc` with their 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 (so they can spot anything unexpected).\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\nFile v2.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7073ez7kp7shjm06s5vr7thd85wezr\",\n  \"slug\": \"install-memex-claw\",\n  \"version\": \"2.0.1\",\n  \"publishedAt\": 1779647729226\n}\n\nArchive v2.0.0: 2 files, 6399 bytes\n\nFiles: SKILL.md (15040b), _meta.json (137b)\n\nFile v2.0.0:SKILL.md\n\n---\nname: install-memex-claw\ndescription: Install the memex-openclaw plugin so OpenClaw captures every turn verbatim into a local memex.db, plus wire the memex MCP server for search tools. Plugin-based capture (OpenClaw 2026.5+) — no daemon, no file watching. Auto-detects whether memex-mvp is already installed on this machine (e.g. for Claude Code via the generic install-memex skill); if yes, just adds the OpenClaw plugin + MCP wiring; if no, full install. 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. memex-openclaw is most useful as a BRIDGE — pairs with memex-mvp + other clients (Claude Code, Hermes, Telegram) for unified cross-client memory. If user only uses OpenClaw with built-in memory-core / Memoria / Mem0 — say so, that may be enough on its own.\nversion: 2.0.0\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    homepage: https://memex.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 verbatim memory system — for OpenClaw.\n\n**This installs two pieces:**\n\n1. **memex-openclaw plugin** — captures every turn verbatim into a local SQLite corpus via OpenClaw's `agent_end` hook. No daemon, no file watching, no JSON parsing.\n2. **memex-mvp MCP server** — exposes `memex_search`, `memex_recent`, `memex_overview` etc. as tools to the model.\n\nBoth write to the same `~/.memex/data/memex.db`. Schema is shared with [memex-hermes](https://pypi.org/project/memex-hermes/) (Python plugin for Hermes Agent) and any other future captures, so all your AI history lives in one searchable file.\n\n**Where you might be running:**\n\n- 🖥️ **VPS** (Linux VPS) — typical always-on agent deployment\n- 💻 **macOS workstation** running OpenClaw alongside Claude Code / etc.\n- 💻 **Linux workstation** (Pop!OS, Fedora, etc.)\n\n**Honest positioning:**\n\nmemex-openclaw is most useful as a **bridge** — joining OpenClaw turns into the unified memex corpus where memex-mvp also captures Claude Code, Hermes, Telegram exports, etc. If the user only uses OpenClaw and is happy with built-in memory-core / Memoria / Mem0, **say so up front** — they may not need this. memex-openclaw earns its place when the user wants cross-client unified search.\n\n**The contract:** zero questions to the user. Discovery → actions → verification. Each step prints one 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 two open-source MIT packages:\n\n| Action | Why | Source |\n|---|---|---|\n| `npm install -g memex-mvp` | memex CLI + MCP server | [npmjs.com/package/memex-mvp](https://www.npmjs.com/package/memex-mvp), source: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) |\n| `openclaw plugins install @parallelclaw/memex-openclaw` | OpenClaw plugin for verbatim capture | [npmjs.com/package/@parallelclaw/memex-openclaw](https://www.npmjs.com/package/@parallelclaw/memex-openclaw) |\n| Edit `~/.openclaw/openclaw.json` | enable plugin + add memex MCP | OpenClaw's own config |\n| `openclaw gateway restart` | apply plugin + MCP changes | OpenClaw's own command |\n\n**Zero outbound network traffic at runtime** — memex stores locally in `~/.memex/data/memex.db`. The skill never uploads conversations anywhere.\n\n---\n\n## Before this skill can be installed (one-time OpenClaw bootstrap)\n\nOn a **fresh** OpenClaw VPS, the default config may not allow installing third-party plugins. Symptom: `openclaw plugins install ...` errors with \"plugin not allowed\" or similar.\n\nIf you hit this — open `~/.openclaw/openclaw.json`, find the `plugins.allow` or equivalent permission key (the exact name varies by OpenClaw version — check `openclaw config --help` or your OpenClaw docs), add the permission for third-party plugin installation, restart the gateway with `openclaw gateway restart`. Then re-run this skill.\n\nThe skill does **not** edit permissions itself — that's a one-time trust decision the user makes manually.\n\n---\n\n## Prerequisite\n\nOpenClaw **2026.5.0 or later** (plugin SDK with `definePluginEntry` + memory corpus supplements). Older versions used a different plugin model and are not supported by memex-openclaw v0.1.\n\n---\n\n## Step 1 — Discovery (run ALL checks first, then decide)\n\n```sh\n# 1. OpenClaw present? Plugin SDK available?\nopenclaw --version 2>&1 | head -3 || echo \"openclaw not in PATH\"\n\n# 2. Node ≥ 22.12 (required by OpenClaw + plugin)\nnode --version\n\n# 3. Is memex already installed (e.g. via generic install-memex skill)?\nnode -e \"console.log(require('memex-mvp/package.json').version)\" 2>&1 || echo \"memex-mvp not installed\"\n\n# 4. Is memex-openclaw plugin already installed?\nls ~/.openclaw/plugins/installs.json 2>/dev/null && \\\n  grep -l 'memex-openclaw' ~/.openclaw/plugins/installs.json 2>/dev/null\n\n# 5. Is the OLD v0.11.x memex-sync daemon running? (must be stopped if so)\nsystemctl --user status memex-sync 2>&1 | head -5 || \\\n  launchctl list | grep memex 2>&1 || \\\n  echo \"no old daemon\"\n\n# 6. Existing memex.db?\nls -la ~/.memex/data/memex.db 2>&1 | head -2\n\n# 7. OpenClaw config location\nls -la ~/.openclaw/openclaw.json 2>&1\n```\n\n**Branch on results:**\n\n| State | Action |\n|---|---|\n| OpenClaw not found | Stop. Tell user this skill is for OpenClaw agents only. |\n| Node < 22.12 | Stop. Print upgrade instructions. Don't auto-install Node. |\n| memex-mvp ≥ 0.12 + plugin installed + no old daemon | Skip Steps 2–4. Go to Step 5 (MCP wiring). |\n| memex-mvp < 0.12 or missing | Run Step 2 (install/upgrade memex-mvp) |\n| Old memex-sync daemon running | Step 3a — stop and disable it (it conflicts with the plugin's capture path) |\n| Plugin not installed | Run Step 3b (install plugin) |\n| No openclaw.json found | Ask the user ONE question: where is your gateway config? |\n\nReport each result back to the user as **facts**:\n\n> \"✓ OpenClaw 2026.5.4 detected\"  \n> \"✓ Node 22.22.2 — ok\"  \n> \"→ memex-mvp not installed — will install 0.12.0+\"  \n> \"→ memex-openclaw plugin not installed — will install 0.1.0+\"  \n> \"✓ No old daemon to disable\"\n\n---\n\n## Step 2 — Install memex-mvp (skip if already at ≥ 0.12)\n\nmemex-mvp provides the `memex` CLI + the MCP server with search tools. The OpenClaw plugin writes to the same DB independently.\n\n```sh\nnpm install -g memex-mvp@latest\nmemex --version    # must be 0.12.0 or later\n```\n\nIf `EACCES` (no permission to write to npm global prefix), apply the standard fix — **never use sudo**:\n\n```sh\nmkdir -p ~/.npm-global\nnpm config set prefix ~/.npm-global\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc 2>/dev/null\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc 2>/dev/null\nexport PATH=$HOME/.npm-global/bin:$PATH\nnpm install -g memex-mvp@latest\n```\n\n---\n\n## Step 3a — Stop the old daemon (skip if not running)\n\nmemex-mvp v0.11.x shipped a `memex-sync` daemon that polled OpenClaw session files. v0.12 + the plugin replace that path. If the old daemon is still running, **stop and disable it** — otherwise both paths will write to memex.db using different `conv_id` schemes and you'll get duplicated conversations.\n\n```sh\n# Linux (systemd user)\nsystemctl --user disable --now memex-sync 2>&1 || true\n\n# macOS (LaunchAgent)\nlaunchctl unload ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist 2>&1 || true\nrm -f ~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist 2>&1 || true\n```\n\nVerify nothing is left running:\n\n```sh\nps aux | grep -i memex-sync | grep -v grep\n```\n\nShould print nothing.\n\n---\n\n## Step 3b — Install the memex-openclaw plugin\n\n```sh\nopenclaw plugins install @parallelclaw/memex-openclaw\n```\n\nAlternatives if `npm` install through OpenClaw isn't available:\n\n```sh\n# Direct local install (if you have the source)\ngit clone https://github.com/parallelclaw/memex-mvp.git /tmp/memex-mvp\ncd /tmp/memex-mvp/plugins/memex-openclaw\nnpm install\nopenclaw plugins install --link \"$(pwd)\"\n```\n\nVerify registration:\n\n```sh\nls ~/.openclaw/plugins/installs.json && cat ~/.openclaw/plugins/installs.json | grep memex-openclaw\n```\n\nShould show `\"memex-openclaw\"` in the registry.\n\n---\n\n## Step 4 — Enable plugin in openclaw.json\n\nEdit `~/.openclaw/openclaw.json` and add the plugin entry. Use `jq` or a careful manual edit — preserve existing keys, **merge don't overwrite**:\n\n```sh\n# Show current plugins entries:\ncat ~/.openclaw/openclaw.json | python3 -c \"\nimport json, sys\ncfg = json.load(sys.stdin)\nprint(json.dumps(cfg.get('plugins', {}).get('entries', {}), indent=2))\n\"\n```\n\nAdd (or update) the `plugins.entries.memex-openclaw` block:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"memex-openclaw\": {\n        \"enabled\": true\n      }\n    }\n  }\n}\n```\n\nSafe merge via Python:\n\n```sh\npython3 <<'PY'\nimport json\nfrom pathlib import Path\np = Path.home() / \".openclaw\" / \"openclaw.json\"\ncfg = json.loads(p.read_text())\ncfg.setdefault(\"plugins\", {}).setdefault(\"entries\", {})[\"memex-openclaw\"] = {\"enabled\": True}\np.write_text(json.dumps(cfg, indent=2))\nprint(\"memex-openclaw enabled in\", p)\nPY\n```\n\n---\n\n## Step 5 — Wire memex into the OpenClaw gateway's MCP-server config (optional but recommended)\n\nThe plugin handles capture. The memex-mvp MCP server provides additional **search/retrieval tools** to the model (`memex_search`, `memex_recent`, `memex_overview`, etc.). If you already have the OpenClaw built-in `memory_search` tool via the plugin's corpus supplement, this is **optional** — the model can search memex through built-in `memory_search`. But for direct access to memex's full MCP tool set, wire it.\n\nFind the absolute path to `memex` binary (MCP stdio doesn't inherit shell PATH):\n\n```sh\nwhich memex\n```\n\nAdd to `~/.openclaw/openclaw.json` `mcpServers` section (don't overwrite other servers):\n\n```sh\npython3 <<PY\nimport json\nfrom pathlib import Path\np = Path.home() / \".openclaw\" / \"openclaw.json\"\ncfg = json.loads(p.read_text())\nmcp = cfg.setdefault(\"mcpServers\", {})\nimport shutil\nmemex_bin = shutil.which(\"memex\")\nif not memex_bin:\n    print(\"ERROR: memex binary not in PATH; rerun Step 2\")\n    raise SystemExit(1)\nmcp[\"memex\"] = { \"command\": memex_bin, \"args\": [], \"env\": {} }\np.write_text(json.dumps(cfg, indent=2))\nprint(\"memex MCP wired at\", p)\nPY\n```\n\n---\n\n## Step 6 — Restart OpenClaw\n\n```sh\nopenclaw gateway restart\n```\n\nWait ~5 seconds, then check logs for plugin activation:\n\n```sh\ntail -30 ~/.openclaw/logs/gateway.log 2>/dev/null | grep -iE \"memex\" | tail -10\n```\n\nYou should see something like:\n\n```\nmemex-openclaw: opened ~/.memex/data/memex.db (current rows: N)\nmemex-openclaw: registered as memory corpus supplement\nmemex-openclaw: plugin activated\n```\n\n---\n\n## Step 7 — Verify\n\nSend yourself a test message in OpenClaw (or have one already happened). Wait ~3 seconds, then:\n\n```sh\nsqlite3 ~/.memex/data/memex.db <<'SQL'\n.headers on\n.mode column\nSELECT id, role, channel,\n       datetime(ts, 'unixepoch', 'localtime') AS when_,\n       substr(text, 1, 60) AS preview,\n       conversation_id\n  FROM messages\n WHERE source='openclaw'\n ORDER BY ts DESC LIMIT 5;\nSQL\n```\n\nYou should see your recent turns captured with `conversation_id` like `openclaw-telegram-<chat_id>` or `openclaw-cli-<session8>` depending on the channel.\n\nFor the model side — open OpenClaw chat, ask: \"search your memory for X\" — and the built-in `memory_search` should now include memex rows in results (via the corpus supplement registration).\n\n---\n\n## Step 8 — Final message to user\n\nAfter all steps:\n\n```\n✅ memex-openclaw plugin installed and activated.\n\nCaptured:\n  • Every new OpenClaw turn is now written verbatim to ~/.memex/data/memex.db\n  • Channel comes from OpenClaw context directly (no parsing)\n  • Plugin sees turns via agent_end hook + preserves before_compaction\n  • Built-in memory_search tool now surfaces memex content as \"memex\" corpus\n\nSearch:\n  • `memex search \"query\"` — CLI\n  • `memex overview` — corpus snapshot\n  • From inside OpenClaw chat: ask the model to search its memory\n  • From any MCP-enabled client (Claude Code, Cursor, etc.) — the memex MCP\n    server exposes 11 search tools\n\nWhat this does NOT do:\n  • Backfill old OpenClaw sessions. Plugin captures from this point\n    forward. If you want historical capture, that's a separate one-shot\n    tool (`memex-sync import-openclaw <dir>` — coming in 0.12.x).\n  • Replace OpenClaw's built-in memory-core. Memex is a corpus supplement.\n\nPair this with:\n  • install-memex (generic skill) — for capturing Claude Code, Cursor,\n    Telegram on the same machine into the same memex.db\n  • memex-hermes (pip) — for Hermes Agent on the same machine\n```\n\n---\n\n## What this skill explicitly does NOT do\n\n- ❌ Install Node.js or upgrade your system Node (manual step if needed)\n- ❌ Use sudo. Ever. If permissions block something, surface the manual fix and stop.\n- ❌ Configure outbound network access. memex is local-first.\n- ❌ Overwrite existing `mcpServers` entries. Merge.\n- ❌ Backfill old OpenClaw history. Plugin captures forward only.\n- ❌ Run if no openclaw.json is found. Asks the user once.\n\n---\n\n## Edge cases\n\n| Condition | What to do |\n|---|---|\n| OpenClaw < 2026.5 | Stop. memex-openclaw requires the new plugin SDK. Tell the user to upgrade OpenClaw. |\n| memex.db locked (WAL contention) | Wait 1 second, retry. SQLite WAL handles concurrent readers/writers. |\n| Plugin install fails with \"permission denied\" | Bootstrap section at the top of this skill — user needs to allow third-party plugins one-time. |\n| User already has Mem0 or Memoria as memory provider | No conflict. memex-openclaw registers as a SUPPLEMENT, not as the exclusive memory provider. Both coexist. |\n| User has the OLD v0.11.x daemon AND wants to keep historical conv-ids | Don't migrate. Document that the new plugin uses a different `conv_id` scheme; old data stays in DB under old scheme as historical record. |\n| Plugin not picked up after restart | Check `~/.openclaw/plugins/installs.json` registry, check `plugins.entries.memex-openclaw.enabled=true` in openclaw.json, restart again. |\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 the user's PATH outside `~/.zshrc` / `~/.bashrc` with their 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 (so they can spot anything unexpected).\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\nFile v2.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7073ez7kp7shjm06s5vr7thd85wezr\",\n  \"slug\": \"install-memex-claw\",\n  \"version\": \"2.0.0\",\n  \"publishedAt\": 1779397030198\n}\n\nArchive v1.0.3: 2 files, 9949 bytes\n\nFiles: SKILL.md (23867b), _meta.json (137b)\n\nFile v1.0.3:SKILL.md\n\n---\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). Auto-captures every OpenClaw session in ~/.openclaw/agents/main/sessions/ and exposes 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to the local OpenClaw agent. Auto-detects whether memex is already installed on this machine (e.g. via the generic install-memex skill for Claude Code) — if yes, skips install and just merges memex into the OpenClaw gateway config; if no, does the full platform-aware install (Linux → systemd user-service, macOS → LaunchAgent). Back-fills past sessions in one shot. 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, Zed, or has Telegram chats to capture on this same machine, recommend they run install-memex separately for those flows.\nversion: 1.0.3\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    homepage: https://memex.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 `~/.openclaw/agents/main/sessions/` is auto-captured into a single SQLite + FTS5 corpus.\n2. Existing past sessions are back-filled in one shot.\n3. The OpenClaw gateway gains 18 MCP tools (memex_search, memex_overview, memex_recent, memex_store_document, memex_import_file, etc.).\n4. The capture continues automatically (systemd user-service on Linux, LaunchAgent on macOS).\n\n**Where you might be running:**\n\n- 🖥️ **VPS** (Linux VPS hosting OpenClaw + Hermes etc.) — typical \"always-on agent\" deployment\n- 💻 **macOS workstation** running OpenClaw alongside Claude Code / Cursor / etc.\n- 💻 **Linux workstation** (Pop!OS, Fedora, etc.) running OpenClaw locally\n- 🖥️ **macOS VPS / Mac-mini server** — also valid\n\nAll four work the same way. **Platform** (Linux/macOS) determines daemon type. **Context** (VPS vs workstation) is irrelevant to memex.\n\n**Important — interaction with the generic install-memex skill:**\n\nIf the user ALREADY ran [`install-memex`](https://clawhub.ai/sedelev/install-memex) (the generic Claude Code / Cursor / Cline / Continue / Zed installer) on THIS machine, then memex is already installed and the daemon is already running. In that case, **this skill only needs to merge `memex` into the OpenClaw gateway config** — no re-install, no re-daemon. Discovery (Step 1) detects this case and skips Steps 2–4.\n\nConversely, if the user has Claude Code / Cursor / Telegram on this same machine and wants those captured too, recommend running `install-memex` separately AFTER this skill completes. This skill focuses strictly on the OpenClaw wiring.\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 (restart gateway, try a search).**\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. Every \"suspicious\" pattern below is intentional and documented:\n\n| Action | Why | Source-of-truth |\n|---|---|---|\n| `npm install -g memex-mvp` | Install the MCP server. Open-source MIT. **Skipped if already installed.** | [npmjs.com/package/memex-mvp](https://www.npmjs.com/package/memex-mvp), source: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) |\n| `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 |\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 (`~/.openclaw/*.json` or wherever the gateway stores its MCP-server list) | Add a single `memex` entry under `mcpServers`. **Merge, never overwrite** other entries. | The agent finds its own config via OpenClaw conventions |\n| `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 files** (`.checkpoint.`, `.trajectory.`, `.reset.`, `trajectory-path*`, `usage-cost-cache`). | `lib/ingest-file.js` in the source — open-source |\n\n**Hard guarantees:**\n- Agent shows every command **before** running it\n- `sudo` is **NEVER** invoked by the skill (linger fallback prints the manual command for the user instead)\n- OpenClaw config is **merged**, never overwritten\n- memex at runtime emits **zero outbound network traffic** — local-first by design\n- If memex 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## 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\" / \"permission denied\" / \"skill plugin disabled\"** — the OpenClaw gateway's permission model is blocking arbitrary skill execution by default. This is **OpenClaw's** safety guard, not specific to memex.\n\nThe exact permission name varies between OpenClaw versions — common ones:\n- `plugins.allow: [\"skill\", …]` in `~/.openclaw/openclaw.json`\n- A separate `skills.enabled: true` setting\n- A capability called `skill-install` or `skill-runtime`\n\n**Check your OpenClaw docs** for the exact permission name in your version, set it once, restart the gateway, and retry. After this bootstrap is done once, every future ClawHub skill works out of the box.\n\nOnce this skill is loaded and you're reading the rest of this file: continue to \"Prerequisite\" below.\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://clawhub.ai/sedelev/install-memex) instead.\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>/dev/null || find / -maxdepth 4 -name \"openclaw\" -type d 2>/dev/null | head -3\n# 2. Platform — Linux or Darwin (macOS)\nuname -s\n# 3. Node version (need ≥ 20)\nnode --version\n# 4. Existing memex install?\nwhich memex && memex --version || echo \"NO_MEMEX\"\n# 5. Existing memex daemon running?\nmemex-sync status 2>/dev/null | grep -E \"process:\" || echo \"NO_DAEMON\"\n# 6. Existing OpenClaw sessions?\nls -1 ~/.openclaw/agents/main/sessions/ 2>/dev/null | grep -E '^[0-9a-f-]+\\.jsonl$' | wc -l\n# 7. On Linux: systemd user-instance available?\n[ \"$(uname -s)\" = \"Linux\" ] && systemctl --user --version 2>/dev/null | head -1 || echo \"macOS or no-systemd\"\n# 8. OpenClaw gateway config location? (varies — try common paths)\nls -la ~/.openclaw/openclaw.json ~/.openclaw/config.json ~/.openclaw/mcp.json 2>/dev/null\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 / Cursor / Cline / Continue / Zed, use `install-memex` instead.\" |\n| **Node < 20 or missing** | Stop. Tell user how to install Node (nvm.sh or distro package manager). Don't install Node yourself. |\n| **memex ≥ 0.11.5 + 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 < 0.11.5** | Upgrade in-place: `npm install -g memex-mvp@latest`. Then continue (daemon will auto-restart if running). **Critical for self-hosted OpenClaw users** — older versions miss `.reset.*` session archives where the long-term Telegram chat lives (~140 MB of history). |\n| **memex installed, daemon not running** | Run `memex-sync install` to register/start the daemon. Skip the npm install. |\n| **memex not installed** | Full path: Step 2 (install) → Step 3 (daemon) → Step 4 (back-fill) → Step 5 (wire). |\n| **No existing sessions** | Still proceed — daemon will capture new sessions going forward. Mention this. |\n| **Linux without systemd** (e.g. minimal container) | Step 3 fallback to `nohup memex-sync &`. Tell user the auto-restart limitation. |\n| **No config file found at common paths** | Ask the user (ONE question allowed): \"Where does your OpenClaw gateway look for MCP-server config?\" — proceed with their answer. |\n\nReport each result back to the user as **facts, not questions**:\n\n> \"✓ OpenClaw detected\"\n> \"✓ Linux + systemd 255 — will use user-systemd for daemon\"\n> \"✓ Node 22.10.0 — ok\"\n> \"→ memex not installed — installing 0.11.5\"\n> \"✓ Found 126 OpenClaw sessions ready to back-fill\"\n> \"→ Config at ~/.openclaw/openclaw.json\"\n\n## Step 2 — Install memex (skip if already at ≥ 0.11.5)\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 ~/.npm-global\nnpm config set prefix ~/.npm-global\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc 2>/dev/null\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc 2>/dev/null\nexport PATH=$HOME/.npm-global/bin:$PATH\nnpm install -g memex-mvp@latest\n```\n\nAfter install:\n\n```sh\nmemex --version    # must print 0.11.5 or later\n```\n\n## Step 3 — Install the auto-capture daemon (skip if already running)\n\n```sh\nmemex-sync install\n```\n\n**Platform-specific behavior (handled automatically by memex-sync v0.11.5+):**\n\n| Platform | What memex-sync install does |\n|---|---|\n| **macOS** (`uname -s` = Darwin) | Writes `~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist`, runs `launchctl load` — daemon auto-starts on every login. |\n| **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. |\n| **Linux without systemd** (container) | `memex-sync install` exits with \"systemctl --user not available\". Fall back: `nohup memex-sync > /tmp/memex.log 2>&1 &` — works but won't auto-restart on reboot. |\n\nIf linger needs sudo, the install output prints the manual command. **Tell the user that line verbatim** — don't try to run sudo yourself.\n\n## Step 4 — Back-fill existing sessions\n\n```sh\nmemex-sync scan\n```\n\n`memex-sync scan` walks SOURCES (Claude Code, Cowork, **OpenClaw** added in v0.10.14, …) and emits any unindexed sessions. For OpenClaw it processes every `<uuid>.jsonl` in `~/.openclaw/agents/main/sessions/` PLUS `.checkpoint.*` snapshots PLUS `.reset.*` archives (v0.11.5+), filters internal-state noise, and writes to memex.db.\n\nExpected output:\n\n```\n=== Claude Code + Cowork ===\n- skipping claude-code: directory not found at /home/user/.claude/projects   (on VPS without Claude Code)\n- skipping claude-cowork: directory not found at ...                          (on Linux — Cowork is macOS-only)\nscanning openclaw: /home/user/.openclaw/agents/main/sessions\n+ openclaw-abc12345.jsonl ← 23 msgs from openclaw (with ai-title)\n+ openclaw-def67890.jsonl ← 41 msgs from openclaw\n…\nscanned 126 files · 1255 messages emitted\n```\n\nIf the daemon was already running (Step 3 skipped), the back-fill via scan is still useful — it catches anything the daemon's chokidar might have raced on startup.\n\n### Step 4b — Channel-aware re-import (memex ≥ 0.11.5, recommended for ALL OpenClaw users)\n\nv0.11.5 is the first version where OpenClaw ingestion can be trusted end-to-end on both **self-hosted OpenClaw** (the dominant case — separate `<uuid>.jsonl` per session) and **Moonshot Kimi-Claw** (the merged-file variant). Older versions had architectural blind spots. **After upgrading from anything below 0.11.5, run a channel-aware re-import:**\n\n```sh\nmemex-sync backfill-channels --yes\n```\n\nThis deletes existing `source = 'openclaw'` rows and re-imports each archived file with the v0.11.5 pipeline. Expected banner:\n\n```\nBackfill: 110 archived OpenClaw file(s) (57 main + 38 checkpoint + 15 reset)\n  mode:          auto -> detected: self-hosted\n  current state: 1481 messages in 8 conversation(s)\n  38 checkpoint file(s) will be SKIPPED (snapshots — avoid 30-40× duplication).\n  15 reset file(s) will be ingested (full archives of pre-reset session history).\n```\n\nPer-channel breakdown at the end:\n\n```\n  channels:\n    • telegram: 7338 msgs\n    • kimi-web:  102 msgs\n```\n\nIdempotent — re-running is safe (UNIQUE(source, conv, msg_id) dedups).\n\n**Override mode if auto-detection picks the wrong one:**\n\n```sh\nmemex-sync backfill-channels --yes --mode kimi-claw     # force Moonshot mode\nmemex-sync backfill-channels --yes --mode self-hosted   # force self-hosted mode\n```\n\nAuto-detection rarely needs override — it inspects sessions.json and falls back to scanning file contents for channel markers (Kimi-Claw merged files contain BOTH Kimi and Telegram markers; self-hosted has one channel per file).\n\n#### What you get out of v0.11.5 vs older\n\n| Bug class | Fixed in | Real-world impact |\n|---|---|---|\n| Channel-aware routing (TG / Kimi-web / system in own conv buckets) | v0.11.0 | Telegram messages from one sender now share one thread across all OpenClaw sessions |\n| Kimi-web header strips correctly without optional `[Time:]` block | v0.11.1 | Clean user-text in storage for short messages |\n| Tool-result records (Bash/Read output, role='user' no marker) inherit parent conv | v0.11.1 | Assistant reasoning chain stays glued to the conversation it answers |\n| Two-mode routing: kimi-claw ingests checkpoints, self-hosted skips them | v0.11.2 | Self-hosted: no more 30-40× row duplication from checkpoint snapshots |\n| Auto-discovery of custom channels from `sessions.json` (discord/matrix/web-ui) | v0.11.2 | Self-hosters with non-standard channels work out of the box |\n| `--mode` flag for manual override | v0.11.2 | Power-user escape hatch when auto-detection fails |\n| Content-based session-type detection (when sessions.json doesn't have entry) | v0.11.3 | After main-session rotation, archived files are still correctly classified |\n| `.reset.*` files ingested (full pre-reset session archives) | v0.11.4 → v0.11.5 | **Self-hosted users get back their full long-term history** — typically 3-7K messages that were hidden in `.reset.*` files (~140 MB) before memex saw them |\n| `shouldIngest` accepts reset files whose names end in `.Z` (not `.jsonl`) | v0.11.5 | Made the v0.11.4 reset-pickup actually fire — real reset format is `<uuid>.jsonl.reset.<ISO-timestamp>`, doesn't end in `.jsonl` |\n| ENOENT crash in `memex-sync scan` on fresh boxes (`~/.memex/data/` missing) | v0.11.2 | Scan no longer crashes mid-run on a clean install |\n| Ghost conversations from subagent system-init files (msg_count=0, `[Subagent Context]` titles) | v0.11.2 | Conv list shows real conversations only |\n\n## Step 5 — Wire memex into the OpenClaw gateway config\n\nThe most fragile step. Get it exactly right:\n\n```sh\n# 1. Find the config (Step 1 likely already located it)\nls -la ~/.openclaw/openclaw.json ~/.openclaw/config.json ~/.openclaw/mcp.json 2>/dev/null\n\n# 2. Get the absolute path to memex\nwhich memex\n```\n\nYou (OpenClaw agent) know your own gateway config structure. **Read it, merge in the memex entry, write atomically:**\n\n```jsonc\n{\n  // … existing config preserved …\n  \"mcpServers\": {\n    // … other MCP servers preserved …\n    \"memex\": {\n      \"command\": \"<ABSOLUTE_PATH_FROM_WHICH_MEMEX>\"\n    }\n  }\n}\n```\n\n**Three critical rules:**\n\n1. **Absolute path** from `which memex` (e.g. `/home/user/.npm-global/bin/memex` or `/usr/local/bin/memex`). NEVER just `\"memex\"` — MCP-stdio doesn't inherit shell PATH.\n2. **Merge, don't overwrite.** Read the JSON, set `.mcpServers.memex`, write the whole thing back. Other entries stay untouched.\n3. **Atomic write:** write to `<path>.tmp`, then `mv` to `<path>`. If the gateway is mid-read, an atomic rename is safe; a partial write is not.\n\n## Step 6 — Verify (what you CAN check before gateway restart)\n\nAfter install + scan, only a few things are verifiable. The full data ingestion happens when the OpenClaw gateway restarts and spawns the memex MCP server — **that's when staged inbox files get processed into memex.db**. Until then, `memex overview` may show zero messages even though the back-fill worked.\n\nSo Step 6 checks only what's deterministically true RIGHT NOW:\n\n```sh\n# 1. Daemon is up?\nmemex-sync status\n\n# 2. Are inbox files staged for the MCP server to process?\nls ~/.memex/inbox/ | wc -l\n```\n\nExpected output:\n\n```\nmemex-sync status\n  daemon:    installed (systemd user-service · …)\n  process:   running (PID 12345)\n  watching:  1 openclaw main session(s) · 6 entries total\n  last activity: just now\n\n$ ls ~/.memex/inbox/ | wc -l\n6     # = number of OpenClaw sessions staged for ingestion\n```\n\n**Don't try `memex overview` or `memex search` until AFTER the gateway is restarted (Step 7).** Why: the inbox→DB import happens inside the memex MCP server, which gets spawned by the OpenClaw gateway on first MCP request after restart. Running queries before that yields \"memex.db not found\" or \"0 messages\" — confusing but expected.\n\n**Diagnostic flowchart if either check fails:**\n\n- `memex-sync status` shows \"process: not running\" → check `journalctl --user -u memex-sync -n 30` (Linux) or `tail ~/.memex/data/launchd.err.log` (macOS). On Linux without linger this is the most common cause.\n- `ls inbox/` is empty after scan → `memex-sync scan` couldn't find anything. Double-check `ls ~/.openclaw/agents/main/sessions/ | grep -v -E '\\.(checkpoint|trajectory|reset)\\.'` — if THAT is empty too, the user has no OpenClaw sessions yet (no problem, daemon will capture new ones going forward).\n\n## Step 7 — Final message to the user\n\nAdjust the numbers; print verbatim otherwise:\n\n```\n✓ Node 22 — ok\n✓ Linux + systemd 255 — daemon as user-service (linger enabled)\n✓ memex 0.11.5 installed\n✓ Daemon running (PID 12345)\n✓ Back-filled 126 sessions → 1255 messages\n✓ MCP wired into ~/.openclaw/openclaw.json\n\nNEXT STEP (you must do this — I can't):\n   Restart the OpenClaw gateway so it picks up the memex MCP tools.\n     openclaw gateway restart      # or your gateway-restart command\n\n   After restart, ask me to search for something to test the wiring:\n     \"поищи в мемексе про <topic>\"\n\nmemex is now capturing every new OpenClaw session you have — searchable\nin milliseconds, verbatim (no AI compression). To browse the corpus in\na browser: `memex web --open`.\n```\n\n**Bonus suggestion** (mention only if relevant):\n\n> \"If you ALSO use Claude Code / Cursor / Cline on this same machine, OR have Telegram chats you want indexed, run `install-memex` (the generic skill) separately to capture those too. memex shares the same database across all sources.\"\n\n## Step 8 — Verify (after user restarts the gateway)\n\nAfter the user restarts the OpenClaw gateway and the memex MCP server has processed its first inbox files, these commands will return real data — ask the user to run them (or run them yourself if they reconnect):\n\n```sh\n# Real corpus stats — should now show the back-filled OpenClaw sessions\nmemex overview\n\n# Smoke search — should find content from a recent session\nmemex search \"<recent topic>\"\n```\n\nExpected `memex overview`:\n\n```\nmemex corpus snapshot\n\nTotal: 1255 messages in 6 conversations\nBy source:\n  • openclaw       1255 msgs in 6 conversations (last: just now)\n```\n\nIf `memex overview` still shows 0 messages 30 seconds after gateway restart:\n- Check that the gateway actually launched memex MCP: `ps aux | grep memex` should show a memex process spawned by openclaw\n- Check the OpenClaw config's `mcpServers.memex.command` IS the absolute path from `which memex` (no shell PATH inheritance over MCP stdio)\n- As a last resort, manually import each staged inbox file: `for f in ~/.memex/inbox/openclaw-*.jsonl; do memex import \"$f\"; done`\n\n---\n\n## What this skill explicitly does NOT do\n\n- ❌ Touch other MCP servers in the OpenClaw config — merges only\n- ❌ Install Node (tells user how)\n- ❌ Run `sudo` — prints the sudo command if linger needs it\n- ❌ Configure Telegram capture (use the generic `install-memex` skill — it handles Telegram Desktop integration)\n- ❌ Configure sync between memex on different machines (separate roadmap)\n- ❌ Change OpenClaw's session-storage path\n\n---\n\n## Edge cases\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| `npm install` EACCES | npm global prefix not writable | Apply `~/.npm-global` prefix fix in Step 2 |\n| `memex-sync install` says \"systemctl --user not available\" | Container w/o systemd-user | Use `nohup memex-sync &` fallback (Step 3) |\n| `memex-sync status` \"process: not running\" after install (Linux) | linger not enabled, daemon died on SSH disconnect | `sudo loginctl enable-linger $USER` |\n| `memex overview` empty after scan | No matching session files (filtered as noise, or wrong dir) | `ls ~/.openclaw/agents/main/sessions/ \\| grep -v -E '\\.(checkpoint\\|trajectory\\|reset)\\.'` to confirm dialogue files exist |\n| Existing memex < 0.10.14 | Pre-OpenClaw-support version | `npm install -g memex-mvp@latest` |\n| Gateway config path not at common locations | Custom OpenClaw setup | ASK the user (one question allowed): \"Where is your OpenClaw gateway's MCP-server config?\" |\n| Two daemons (e.g. macOS LaunchAgent + leftover nohup) | Multiple `memex-sync install` runs or manual processes | `memex-sync uninstall` then `memex-sync install` — re-establishes single canonical instance |\n| User runs this skill AND install-memex on same machine | Both wire memex MCP into different agents' configs (Claude Code + OpenClaw) | No conflict — shared `~/.memex/data/memex.db` is the corpus, each agent has its own MCP config |\n\n---\n\n## Safety rules — read before starting\n\n- If `node` or `npm` aren't installed, **stop** and tell the user how to install Node. Don't install Node yourself.\n- **Never run `rm`, `sudo`, or anything destructive without explicit user \"yes\"** in chat. The skill never runs sudo — only prints commands.\n- **Show every command before running it.** If the user says \"no\" / \"stop\", halt and explain.\n- **If a step fails, do NOT auto-retry or auto-fix** — report what failed and ask how to proceed.\n- When editing the OpenClaw config, **always preserve existing MCP servers**. If you can't merge cleanly, abort and tell the user exactly what couldn't be parsed.\n- Stay focused on memex+OpenClaw wiring. If sidetracked, return to this skill and say: \"OK, back to memex setup. We were at step N — should I continue?\"\n\n## Begin\n\nStart Step 1 (Discovery) now. After all checks, branch per the table in Step 1 and proceed without asking permission — unless a showstopper fires (no OpenClaw, no Node, or unparseable config).\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7073ez7kp7shjm06s5vr7thd85wezr\",\n  \"slug\": \"install-memex-claw\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1779230512292\n}\n\nArchive v1.0.2: 2 files, 8392 bytes\n\nFiles: SKILL.md (20124b), _meta.json (137b)\n\nFile v1.0.2:SKILL.md\n\n---\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). Auto-captures every OpenClaw session in ~/.openclaw/agents/main/sessions/ and exposes 18 MCP tools (memex_search, memex_recent, memex_overview, memex_store_document, memex_import_file, etc.) to the local OpenClaw agent. Auto-detects whether memex is already installed on this machine (e.g. via the generic install-memex skill for Claude Code) — if yes, skips install and just merges memex into the OpenClaw gateway config; if no, does the full platform-aware install (Linux → systemd user-service, macOS → LaunchAgent). Back-fills past sessions in one shot. 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, Zed, or has Telegram chats to capture on this same machine, recommend they run install-memex separately for those flows.\nversion: 1.0.2\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    homepage: https://memex.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 `~/.openclaw/agents/main/sessions/` is auto-captured into a single SQLite + FTS5 corpus.\n2. Existing past sessions are back-filled in one shot.\n3. The OpenClaw gateway gains 18 MCP tools (memex_search, memex_overview, memex_recent, memex_store_document, memex_import_file, etc.).\n4. The capture continues automatically (systemd user-service on Linux, LaunchAgent on macOS).\n\n**Where you might be running:**\n\n- 🖥️ **VPS** (Linux VPS hosting OpenClaw + Hermes etc.) — typical \"always-on agent\" deployment\n- 💻 **macOS workstation** running OpenClaw alongside Claude Code / Cursor / etc.\n- 💻 **Linux workstation** (Pop!OS, Fedora, etc.) running OpenClaw locally\n- 🖥️ **macOS VPS / Mac-mini server** — also valid\n\nAll four work the same way. **Platform** (Linux/macOS) determines daemon type. **Context** (VPS vs workstation) is irrelevant to memex.\n\n**Important — interaction with the generic install-memex skill:**\n\nIf the user ALREADY ran [`install-memex`](https://clawhub.ai/sedelev/install-memex) (the generic Claude Code / Cursor / Cline / Continue / Zed installer) on THIS machine, then memex is already installed and the daemon is already running. In that case, **this skill only needs to merge `memex` into the OpenClaw gateway config** — no re-install, no re-daemon. Discovery (Step 1) detects this case and skips Steps 2–4.\n\nConversely, if the user has Claude Code / Cursor / Telegram on this same machine and wants those captured too, recommend running `install-memex` separately AFTER this skill completes. This skill focuses strictly on the OpenClaw wiring.\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 (restart gateway, try a search).**\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. Every \"suspicious\" pattern below is intentional and documented:\n\n| Action | Why | Source-of-truth |\n|---|---|---|\n| `npm install -g memex-mvp` | Install the MCP server. Open-source MIT. **Skipped if already installed.** | [npmjs.com/package/memex-mvp](https://www.npmjs.com/package/memex-mvp), source: [github.com/parallelclaw/memex-mvp](https://github.com/parallelclaw/memex-mvp) |\n| `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 |\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 (`~/.openclaw/*.json` or wherever the gateway stores its MCP-server list) | Add a single `memex` entry under `mcpServers`. **Merge, never overwrite** other entries. | The agent finds its own config via OpenClaw conventions |\n| `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 files** (`.checkpoint.`, `.trajectory.`, `.reset.`, `trajectory-path*`, `usage-cost-cache`). | `lib/ingest-file.js` in the source — open-source |\n\n**Hard guarantees:**\n- Agent shows every command **before** running it\n- `sudo` is **NEVER** invoked by the skill (linger fallback prints the manual command for the user instead)\n- OpenClaw config is **merged**, never overwritten\n- memex at runtime emits **zero outbound network traffic** — local-first by design\n- If memex 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## 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\" / \"permission denied\" / \"skill plugin disabled\"** — the OpenClaw gateway's permission model is blocking arbitrary skill execution by default. This is **OpenClaw's** safety guard, not specific to memex.\n\nThe exact permission name varies between OpenClaw versions — common ones:\n- `plugins.allow: [\"skill\", …]` in `~/.openclaw/openclaw.json`\n- A separate `skills.enabled: true` setting\n- A capability called `skill-install` or `skill-runtime`\n\n**Check your OpenClaw docs** for the exact permission name in your version, set it once, restart the gateway, and retry. After this bootstrap is done once, every future ClawHub skill works out of the box.\n\nOnce this skill is loaded and you're reading the rest of this file: continue to \"Prerequisite\" below.\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://clawhub.ai/sedelev/install-memex) instead.\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>/dev/null || find / -maxdepth 4 -name \"openclaw\" -type d 2>/dev/null | head -3\n# 2. Platform — Linux or Darwin (macOS)\nuname -s\n# 3. Node version (need ≥ 20)\nnode --version\n# 4. Existing memex install?\nwhich memex && memex --version || echo \"NO_MEMEX\"\n# 5. Existing memex daemon running?\nmemex-sync status 2>/dev/null | grep -E \"process:\" || echo \"NO_DAEMON\"\n# 6. Existing OpenClaw sessions?\nls -1 ~/.openclaw/agents/main/sessions/ 2>/dev/null | grep -E '^[0-9a-f-]+\\.jsonl$' | wc -l\n# 7. On Linux: systemd user-instance available?\n[ \"$(uname -s)\" = \"Linux\" ] && systemctl --user --version 2>/dev/null | head -1 || echo \"macOS or no-systemd\"\n# 8. OpenClaw gateway config location? (varies — try common paths)\nls -la ~/.openclaw/openclaw.json ~/.openclaw/config.json ~/.openclaw/mcp.json 2>/dev/null\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 / Cursor / Cline / Continue / Zed, use `install-memex` instead.\" |\n| **Node < 20 or missing** | Stop. Tell user how to install Node (nvm.sh or distro package manager). Don't install Node yourself. |\n| **memex ≥ 0.10.14 + 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 < 0.10.14** | Upgrade in-place: `npm install -g memex-mvp@latest`. Then continue (daemon will auto-restart if running). |\n| **memex installed, daemon not running** | Run `memex-sync install` to register/start the daemon. Skip the npm install. |\n| **memex not installed** | Full path: Step 2 (install) → Step 3 (daemon) → Step 4 (back-fill) → Step 5 (wire). |\n| **No existing sessions** | Still proceed — daemon will capture new sessions going forward. Mention this. |\n| **Linux without systemd** (e.g. minimal container) | Step 3 fallback to `nohup memex-sync &`. Tell user the auto-restart limitation. |\n| **No config file found at common paths** | Ask the user (ONE question allowed): \"Where does your OpenClaw gateway look for MCP-server config?\" — proceed with their answer. |\n\nReport each result back to the user as **facts, not questions**:\n\n> \"✓ OpenClaw detected\"\n> \"✓ Linux + systemd 255 — will use user-systemd for daemon\"\n> \"✓ Node 22.10.0 — ok\"\n> \"→ memex not installed — installing 0.10.14\"\n> \"✓ Found 126 OpenClaw sessions ready to back-fill\"\n> \"→ Config at ~/.openclaw/openclaw.json\"\n\n## Step 2 — Install memex (skip if already at ≥ 0.10.14)\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 ~/.npm-global\nnpm config set prefix ~/.npm-global\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc 2>/dev/null\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc 2>/dev/null\nexport PATH=$HOME/.npm-global/bin:$PATH\nnpm install -g memex-mvp@latest\n```\n\nAfter install:\n\n```sh\nmemex --version    # must print 0.10.14 or later\n```\n\n## Step 3 — Install the auto-capture daemon (skip if already running)\n\n```sh\nmemex-sync install\n```\n\n**Platform-specific behavior (handled automatically by memex-sync v0.10.14+):**\n\n| Platform | What memex-sync install does |\n|---|---|\n| **macOS** (`uname -s` = Darwin) | Writes `~/Library/LaunchAgents/com.parallelclaw.memex.sync.plist`, runs `launchctl load` — daemon auto-starts on every login. |\n| **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. |\n| **Linux without systemd** (container) | `memex-sync install` exits with \"systemctl --user not available\". Fall back: `nohup memex-sync > /tmp/memex.log 2>&1 &` — works but won't auto-restart on reboot. |\n\nIf linger needs sudo, the install output prints the manual command. **Tell the user that line verbatim** — don't try to run sudo yourself.\n\n## Step 4 — Back-fill existing sessions\n\n```sh\nmemex-sync scan\n```\n\n`memex-sync scan` walks SOURCES (Claude Code, Cowork, **OpenClaw** added in v0.10.14, …) and emits any unindexed sessions. For OpenClaw it processes every `<uuid>.jsonl` in `~/.openclaw/agents/main/sessions/`, filters internal-state noise, and writes to memex.db.\n\nExpected output:\n\n```\n=== Claude Code + Cowork ===\n- skipping claude-code: directory not found at /home/user/.claude/projects   (on VPS without Claude Code)\n- skipping claude-cowork: directory not found at ...                          (on Linux — Cowork is macOS-only)\nscanning openclaw: /home/user/.openclaw/agents/main/sessions\n+ openclaw-abc12345.jsonl ← 23 msgs from openclaw (with ai-title)\n+ openclaw-def67890.jsonl ← 41 msgs from openclaw\n…\nscanned 126 files · 1255 messages emitted\n```\n\nIf the daemon was already running (Step 3 skipped), the back-fill via scan is still useful — it catches anything the daemon's chokidar might have raced on startup.\n\n## Step 5 — Wire memex into the OpenClaw gateway config\n\nThe most fragile step. Get it exactly right:\n\n```sh\n# 1. Find the config (Step 1 likely already located it)\nls -la ~/.openclaw/openclaw.json ~/.openclaw/config.json ~/.openclaw/mcp.json 2>/dev/null\n\n# 2. Get the absolute path to memex\nwhich memex\n```\n\nYou (OpenClaw agent) know your own gateway config structure. **Read it, merge in the memex entry, write atomically:**\n\n```jsonc\n{\n  // … existing config preserved …\n  \"mcpServers\": {\n    // … other MCP servers preserved …\n    \"memex\": {\n      \"command\": \"<ABSOLUTE_PATH_FROM_WHICH_MEMEX>\"\n    }\n  }\n}\n```\n\n**Three critical rules:**\n\n1. **Absolute path** from `which memex` (e.g. `/home/user/.npm-global/bin/memex` or `/usr/local/bin/memex`). NEVER just `\"memex\"` — MCP-stdio doesn't inherit shell PATH.\n2. **Merge, don't overwrite.** Read the JSON, set `.mcpServers.memex`, write the whole thing back. Other entries stay untouched.\n3. **Atomic write:** write to `<path>.tmp`, then `mv` to `<path>`. If the gateway is mid-read, an atomic rename is safe; a partial write is not.\n\n## Step 6 — Verify (what you CAN check before gateway restart)\n\nAfter install + scan, only a few things are verifiable. The full data ingestion happens when the OpenClaw gateway restarts and spawns the memex MCP server — **that's when staged inbox files get processed into memex.db**. Until then, `memex overview` may show zero messages even though the back-fill worked.\n\nSo Step 6 checks only what's deterministically true RIGHT NOW:\n\n```sh\n# 1. Daemon is up?\nmemex-sync status\n\n# 2. Are inbox files staged for the MCP server to process?\nls ~/.memex/inbox/ | wc -l\n```\n\nExpected output:\n\n```\nmemex-sync status\n  daemon:    installed (systemd user-service · …)\n  process:   running (PID 12345)\n  watching:  1 openclaw main session(s) · 6 entries total\n  last activity: just now\n\n$ ls ~/.memex/inbox/ | wc -l\n6     # = number of OpenClaw sessions staged for ingestion\n```\n\n**Don't try `memex overview` or `memex search` until AFTER the gateway is restarted (Step 7).** Why: the inbox→DB import happens inside the memex MCP server, which gets spawned by the OpenClaw gateway on first MCP request after restart. Running queries before that yields \"memex.db not found\" or \"0 messages\" — confusing but expected.\n\n**Diagnostic flowchart if either check fails:**\n\n- `memex-sync status` shows \"process: not running\" → check `journalctl --user -u memex-sync -n 30` (Linux) or `tail ~/.memex/data/launchd.err.log` (macOS). On Linux without linger this is the most common cause.\n- `ls inbox/` is empty after scan → `memex-sync scan` couldn't find anything. Double-check `ls ~/.openclaw/agents/main/sessions/ | grep -v -E '\\.(checkpoint|trajectory|reset)\\.'` — if THAT is empty too, the user has no OpenClaw sessions yet (no problem, daemon will capture new ones going forward).\n\n## Step 7 — Final message to the user\n\nAdjust the numbers; print verbatim otherwise:\n\n```\n✓ Node 22 — ok\n✓ Linux + systemd 255 — daemon as user-service (linger enabled)\n✓ memex 0.10.14 installed\n✓ Daemon running (PID 12345)\n✓ Back-filled 126 sessions → 1255 messages\n✓ MCP wired into ~/.openclaw/openclaw.json\n\nNEXT STEP (you must do this — I can't):\n   Restart the OpenClaw gateway so it picks up the memex MCP tools.\n     openclaw gateway restart      # or your gateway-restart command\n\n   After restart, ask me to search for something to test the wiring:\n     \"поищи в мемексе про <topic>\"\n\nmemex is now capturing every new OpenClaw session you have — searchable\nin milliseconds, verbatim (no AI compression). To browse the corpus in\na browser: `memex web --open`.\n```\n\n**Bonus suggestion** (mention only if relevant):\n\n> \"If you ALSO use Claude Code / Cursor / Cline on this same machine, OR have Telegram chats you want indexed, run `install-memex` (the generic skill) separately to capture those too. memex shares the same database across all sources.\"\n\n## Step 8 — Verify (after user restarts the gateway)\n\nAfter the user restarts the OpenClaw gateway and the memex MCP server has processed its first inbox files, these commands will return real data — ask the user to run them (or run them yourself if they reconnect):\n\n```sh\n# Real corpus stats — should now show the back-filled OpenClaw sessions\nmemex overview\n\n# Smoke search — should find content from a recent session\nmemex search \"<recent topic>\"\n```\n\nExpected `memex overview`:\n\n```\nmemex corpus snapshot\n\nTotal: 1255 messages in 6 conversations\nBy source:\n  • openclaw       1255 msgs in 6 conversations (last: just now)\n```\n\nIf `memex overview` still shows 0...","readmeExcerpt":"Skill: Install memex for OpenClaw Owner: sedelev Summary: Wire memex (the local-first MCP memory server) into an OpenClaw gateway — works wherever OpenClaw runs (Linux or macOS, VPS or workstation, self-hosted OpenC... Tags: ai-memory:3.0.0, cross-platform:3.0.0, fts5:3.0.0, gateway:3.0.0, install:3.0.0, latest:3.0.0, launchagent:3.0.0, linux:3.0.0, local-first:3.0.0, macos:3.0.0, mcp:3.0.0, mcp-server:3.0.0, memex:3","codeSnippets":[],"executableExamples":[{"language":"sh","snippet":"# 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 ~/.openclaw/openclaw.json.bak ] && echo \"found backup, you can restore via:\" \\\n  && echo \"  cp ~/.openclaw/openclaw.json.bak ~/.openclaw/openclaw.json\"\n\n# 3. Restart gateway so the old plugin stops loading\nopenclaw gateway restart"},{"language":"sh","snippet":"# 1. Are we inside OpenClaw?\nwhich openclaw 2>/dev/null || find / -maxdepth 4 -name \"openclaw\" -type d 2>/dev/null | 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>/dev/null | head -5 || echo \"NO_DAEMON\"\n\n# 6. Existing OpenClaw sessions?\nls -1 ~/.openclaw/agents/main/sessions/ 2>/dev/null \\\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>/dev/null | head -1 \\\n  || echo \"macOS or no-systemd\"\n\n# 8. OpenClaw gateway config\nls -la ~/.openclaw/openclaw.json 2>&1\n\n# 9. Was the deprecated memex-openclaw plugin previously installed?\nls -la ~/.openclaw/npm/node_modules/@parallelclaw/memex-openclaw 2>/dev/null \\\n  || echo \"no old plugin\""},{"language":"sh","snippet":"npm install -g memex-mvp@latest"},{"language":"sh","snippet":"mkdir -p ~/.npm-global\nnpm config set prefix ~/.npm-global\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.zshrc 2>/dev/null\necho 'export PATH=$HOME/.npm-global/bin:$PATH' >> ~/.bashrc 2>/dev/null\nexport PATH=$HOME/.npm-global/bin:$PATH\nnpm install -g memex-mvp@latest"},{"language":"sh","snippet":"memex --version    # must print 0.11.6 or later"},{"language":"sh","snippet":"memex-sync install"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\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 ~/.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 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://memex.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 `~/.openclaw/agents/main/sessions/` is auto-captured into `~/.memex/data/memex.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/retrieval 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 / 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/macOS) 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 O"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7073ez7kp7shjm06s5vr7thd85wezr\",\n  \"slug\": \"install-memex-claw\",\n  \"version\": \"3.0.0\",\n  \"publishedAt\": 1779737663847\n}"},{"path":"skill-card.md","content":"## Description:\n\nWires the local-first memex MCP memory server into an OpenClaw gateway, installs or reuses the memex-mvp daemon, back-fills OpenClaw sessions into a local SQLite and FTS5 corpus, and exposes memex search and retrieval tools to the OpenClaw LLM toolset.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sedelev](https://clawhub.ai/user/sedelev)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and operators running OpenClaw use this skill to add persistent local memory: captured sessions, back-filled history, and MCP search tools backed by memex. It is intended for Linux or macOS OpenClaw deployments, including workstations, VPS hosts, self-hosted OpenClaw, and Moonshot Kimi-Claw.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: A persistent user-level service continuously indexes OpenClaw conversations into a local memex database.\n\nMitigation: Install only when continuous local session capture is intended; review the generated systemd user service or LaunchAgent before enabling it, and document disable, uninstall, and data-deletion steps.\n\nRisk: The skill installs memex-mvp from npm using a mutable latest package reference when memex is not already present or needs upgrade.\n\nMitigation: Prefer a pinned, verified memex-mvp version for controlled deployments and review the package source and checksum before installation.\n\nRisk: PATH changes and OpenClaw MCP configuration edits could affect future shell sessions or gateway behavior.\n\nMitigation: Confirm shell rc changes before relying on them, verify that OpenClaw configuration is merged rather than overwritten, and run the skill's MCP listing and fresh-session checks after restart.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/sedelev/skills/install-memex-claw)\n- [memex homepage](https://memex.parallelclaw.ai)\n- [memex-mvp npm package](https://www.npmjs.com/package/memex-mvp)\n- [Related install-memex skill](https://clawhub.ai/sedelev/install-memex)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, guidance, shell commands, configuration]\n\n**Output Format:** [Markdown with inline shell commands and JSON configuration guidance]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [The skill asks the agent to run discovery, installation, configuration, migration, and verification steps with concise human-facing status output.]\n\n## Skill Version(s):\n\n3.0.0 (source: frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":7072,"uniquenessScore":15,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T23:07:09.239Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T23:07:09.239Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T01:46:35.192Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}