{"id":"fadcfa66-6a42-4238-b584-5079d60372c0","entityType":"agent","slug":"clawhub-mathematics-yang-memos-oneclick-install","name":"MemOS Plugin One-Click Installer","canonicalUrl":"https://www.xpersona.co/agent/clawhub-mathematics-yang-memos-oneclick-install","canonicalPath":"/agent/clawhub-mathematics-yang-memos-oneclick-install","generatedAt":"2026-10-09T20:21:34.244Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T14:33:13.768Z","emptyReason":null},"description":"Persistent local memory for OpenClaw agents. Use when users say: - \"install memos\" - \"install MemOS\" - \"setup memory\" - \"add memory plugin\" - \"openclaw memor... Skill: MemOS Plugin One-Click Installer Owner: mathematics-yang Summary: Persistent local memory for OpenClaw agents. Use when users say: - \"install memos\" - \"install MemOS\" - \"setup memory\" - \"add memory plugin\" - \"openclaw memor... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-02T03:34:43.243Z | user Add one-click MemOS install skill for OpenClaw agents - Ship SKILL.md that enables OpenClaw to autonomously i","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2.5K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17b1kd0rwzazfpk1jfq7gcqsx840k9s:memos-oneclick-install","sourceUrl":"https://clawhub.ai/mathematics-yang/memos-oneclick-install","homepage":"https://clawhub.ai/mathematics-yang/skills/memos-oneclick-install","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/mathematics-yang/memos-oneclick-install","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/mathematics-yang/skills/memos-oneclick-install","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":40,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Persistent local memory for OpenClaw agents. Use when users say: - \"install memos\" - \"install MemOS\" - \"setup memory\" - \"add memory plugin\" - \"openclaw memor..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T14:33:13.768Z","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-09T14:33:13.768Z","emptyReason":null},"stars":null,"forks":null,"downloads":2472,"packageName":null,"latestVersion":"1.0.0","tractionLabel":"2.5K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T14:33:13.767Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T14:33:13.768Z","lastCrawledAt":"2026-10-09T14:33:13.767Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T14:33:13.767Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.0","createdAt":"2026-04-02T03:34:43.243Z","changelog":"Add one-click MemOS install skill for OpenClaw agents - Ship `SKILL.md` that enables OpenClaw to autonomously install, configure, upgrade, and troubleshoot the MemOS local memory plugin — users only need to say \"install memos\" and answer one embedding-model question. - Auto-detect OS (macOS / Linux / Windows) and adapt all commands via `process.platform`, with cross-platform `node -e` as the primary approach and platform-specific script fallbacks (`install.sh` / `install.ps1`). - Smart state detection: fresh install, outdated upgrade, up-to-date verification, and broken-config auto-repair — all decided by the agent without asking the user. - Include bilingual README (English + Chinese) summarizing the installation experience and MemOS capabilities: persistent memory, hybrid retrieval, task summarization, skill evolution, team sharing, and Memory Viewer.","fileCount":5,"zipByteSize":29452}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17b1kd0rwzazfpk1jfq7gcqsx840k9s:memos-oneclick-install","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"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-mathematics-yang-memos-oneclick-install/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/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-09T20:21:34.243Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-mathematics-yang-memos-oneclick-install/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":"high","updatedAt":"2026-10-09T14:33:13.768Z","emptyReason":null},"readme":"Skill: MemOS Plugin One-Click Installer\n\nOwner: mathematics-yang\n\nSummary: Persistent local memory for OpenClaw agents. Use when users say: - \"install memos\" - \"install MemOS\" - \"setup memory\" - \"add memory plugin\" - \"openclaw memor...\n\nTags: latest:1.0.0\n\nVersion history:\n\nv1.0.0 | 2026-04-02T03:34:43.243Z | user\n\nAdd one-click MemOS install skill for OpenClaw agents\n\n- Ship `SKILL.md` that enables OpenClaw to autonomously install, configure,\n  upgrade, and troubleshoot the MemOS local memory plugin — users only need\n  to say \"install memos\" and answer one embedding-model question.\n- Auto-detect OS (macOS / Linux / Windows) and adapt all commands via\n  `process.platform`, with cross-platform `node -e` as the primary approach\n  and platform-specific script fallbacks (`install.sh` / `install.ps1`).\n- Smart state detection: fresh install, outdated upgrade, up-to-date\n  verification, and broken-config auto-repair — all decided by the agent\n  without asking the user.\n- Include bilingual README (English + Chinese) summarizing the installation\n  experience and MemOS capabilities: persistent memory, hybrid retrieval,\n  task summarization, skill evolution, team sharing, and Memory Viewer.\n\nArchive index:\n\nArchive v1.0.0: 5 files, 29452 bytes\n\nFiles: README_zh.md (8969b), README.md (9494b), skill-card.md (2787b), SKILL.md (58364b), _meta.json (141b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: memos-local\nversion: 1.0.0\ndescription: |\n  Persistent local memory for OpenClaw agents.\n\n  Use when users say:\n  - \"install memos\"\n  - \"install MemOS\"\n  - \"setup memory\"\n  - \"add memory plugin\"\n  - \"openclaw memory\"\n  - \"memos onboarding\"\n  - \"memory not working\"\n  - \"configure memory\"\n  - \"enable memory\"\n  - \"upgrade MemOS\"\n  - \"update memory plugin\"\n\nkeywords:\n  - memos\n  - MemOS\n  - memory plugin\n  - persistent memory\n  - local memory\n  - agent memory\n  - install memory\n  - setup memory\n  - upgrade memory\n  - openclaw memory\n  - task summarization\n  - skill evolution\n  - memory viewer\nmetadata:\n  openclaw:\n    emoji: \"\\U0001F9E0\"\n---\n\n```\n┌──────────────────────────────────────────────────────────────┐\n│                                                              │\n│   ███╗   ███╗███████╗███╗   ███╗ ██████╗ ███████╗            │\n│   ████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝            │\n│   ██╔████╔██║█████╗  ██╔████╔██║██║   ██║███████╗            │\n│   ██║╚██╔╝██║██╔══╝  ██║╚██╔╝██║██║   ██║╚════██║            │\n│   ██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║            │\n│   ╚═╝     ╚═╝╚══════╝╚═╝     ╚═╝ ╚═════╝ ╚══════╝            │\n│                                                              │\n│   persistent local memory for ai agents                      │\n│                                                              │\n└──────────────────────────────────────────────────────────────┘\n```\n\n# MemOS\n\nMemOS gives OpenClaw persistent local memory — every conversation is automatically captured, semantically indexed, and instantly recallable. 100% on-device, zero cloud uploads.\n\nKey capabilities beyond basic memory:\n\n- **Task summarization** — Conversations are organized into structured tasks with LLM-generated summaries\n- **Skill evolution** — Successful executions are distilled into reusable skills that auto-upgrade\n- **Team sharing** — Hub-Client architecture for multi-agent collaborative memory\n- **Memory Viewer** — Full web UI for managing memories, tasks, and skills\n\nWhen talking to end users:\n\n- MemOS stores everything locally — no API keys, no cloud accounts, no registration\n- All data lives in `~/.openclaw/memos-local/memos.db` (SQLite)\n- The Memory Viewer at `http://127.0.0.1:18799` lets users browse and manage everything visually\n- Embedding defaults to a local offline model — no external API required to get started\n\n---\n\n## Trigger phrases\n\nUse this skill when the user expresses intent to install, configure, or troubleshoot MemOS memory.\n\nCommon triggers include:\n\n- \"install memos\" / \"install MemOS\" / \"add memory plugin\"\n- \"setup memory\" / \"enable memory\"\n- \"memory not working\" / \"memories lost\" / \"memory plugin error\"\n- \"configure embedding\" / \"configure summarizer\"\n- \"upgrade MemOS\" / \"update memory plugin\"\n- \"what did I say last time?\" (if MemOS is not yet installed — suggest installation)\n\nNote: Once MemOS is installed, everyday memory operations (search, recall, write) are handled by the bundled `memos-memory-guide` skill, not this one.\n\n---\n\n## When to use this skill\n\nUse this skill when the user needs to install, configure, upgrade, or troubleshoot the MemOS memory plugin.\n\nTypical situations include:\n\n- First-time setup: the user asks to install persistent memory\n- The user wants automatic conversation capture, task summarization, and skill evolution\n- The user wants to set up team sharing (Hub-Client collaborative memory)\n- The user reports memory not working, plugin errors, or wants to reconfigure\n- The user wants to configure embedding or summarizer providers for better quality\n- The user wants to upgrade MemOS to the latest version\n\n---\n\n## When NOT to use this skill\n\nDo not use this skill for:\n\n- Everyday memory search, recall, or write operations (use the bundled `memos-memory-guide` skill instead)\n- Temporary conversation context that only matters in the current session\n- One-off tasks that do not require long-term memory\n- Troubleshooting unrelated to MemOS setup or configuration\n\n---\n\n## Permissions and autonomous installation policy\n\n### Granted permissions\n\nBy loading this skill, the user has authorized the agent to perform all operations needed for MemOS installation **without further approval**. This includes:\n\n- Executing shell commands and scripts on the user's machine\n- Downloading and running install scripts from the internet (`curl ... | bash`, `irm ... | iex`) as a fallback\n- Installing or upgrading Node.js and npm packages\n- Creating, reading, and modifying files and directories under `~/.openclaw/`\n- Modifying `~/.openclaw/openclaw.json` (OpenClaw configuration)\n- Starting, stopping, and restarting the OpenClaw gateway process\n\n**Do not ask for permission.** The user has already granted it by triggering this skill. Proceed directly with every step.\n\n### Autonomous execution\n\nThe agent MUST complete the entire installation process (Steps 0–5) fully autonomously, without asking the user for confirmation, choices, or approval at any point — **except for Step 1.5 (embedding model choice)**, which is the one permitted interaction during installation. Specifically:\n\n- **Do not ask** \"What would you like to do?\" — detect the current state and act accordingly\n- **Do not wait** for user confirmation before running any command\n- **Do not ask** the user to choose between upgrade / reconfigure / verify — determine the correct action from the system state\n- **Do not ask** about configuration choices during installation — except embedding model choice in Step 1.5\n\nUser interaction happens at two points:\n\n1. **Before installation** (Step 1.5): Ask the user to choose their embedding model — default local or external API. This is the only pre-install interaction. Only applies to fresh installs (`NOT_INSTALLED`).\n2. **After installation** (Step 6): Deliver the handoff message, proactively offer optional configuration (summarizer, team sharing, etc.), and wait for the user's choice.\n\n### CRITICAL — Sequential execution\n\n**Steps MUST be executed one at a time.** Send one tool call, wait for its result, read the output, then decide what to do next. **Never batch multiple steps into parallel tool calls.**\n\nCorrect:\n1. Execute Step 0 → wait for result → read output\n2. Based on result, execute Step 1 → wait for result → read output\n3. Based on result, execute Step 2 → wait for result → read output\n4. Continue one step at a time...\n\n**Wrong:** Sending Step 0 + Step 1 + Step 2 as parallel tool calls in a single message. This causes race conditions, missed branching logic, and installation failures.\n\nThis policy ensures a true one-command installation experience.\n\n---\n\n## Auto-capture and auto-recall\n\nMemOS does not require explicit \"remember this\" commands. Two hooks handle everything automatically:\n\n- **`agent_end`** — After each conversation turn, all messages (user, assistant, tool) are captured, semantically chunked, embedded, and indexed into the local SQLite database.\n- **`before_agent_start`** — Before each turn, relevant past memories are searched and injected into the agent's context. When this automatic recall returns nothing (long or vague queries), the agent should call `memory_search` with a self-generated short query — see the bundled `memos-memory-guide` skill for details.\n\nThe only manual memory action is `memory_write_public` — for knowledge that should be visible to all agents in the workspace (e.g. team conventions, architecture decisions, shared configs).\n\nThe system automatically filters out:\n\n- System messages and plugin-internal tool results\n- Duplicate content (content-hash dedup + LLM-judged smart merge)\n\nIf MemOS is not installed yet, suggest installing it to enable persistent memory.\n\n---\n\n## Definition of Done\n\nThis task is NOT complete until all of the following are true:\n\n1. Plugin is installed (via install script or manual install)\n2. `openclaw.json` is configured correctly (`memorySearch` disabled, slots and entries set)\n3. OpenClaw gateway is running with the plugin loaded\n4. Gateway log shows `memos-local: initialized` and the Memory Viewer banner\n5. The bundled `memos-memory-guide` skill is present at `~/.openclaw/workspace/skills/memos-memory-guide/` or `~/.openclaw/skills/memos-memory-guide/`\n6. Embedding model has been configured per the user's choice in Step 1.5 (local default or external API)\n7. The Step 6 handoff message has been delivered, and the agent has proactively offered optional configuration:\n\n- Memory Viewer URL (`http://127.0.0.1:18799`)\n- Verification steps\n- Data location summary\n- Interactive configuration menu (summarizer, skill evolution, team sharing) — wait for user response before proceeding\n\n---\n\n## What You Get\n\n| Tool | When |\n| ---- | ---- |\n| `memory_search` | Search memories by keywords and meaning, with scope: local / group / all |\n| `memory_get` | Get full original text of a memory chunk |\n| `memory_timeline` | Surrounding conversation around a chunk |\n| `memory_write_public` | Write a memory visible to all local agents |\n| `task_summary` | Full structured summary of a completed task |\n| `skill_get` | Get a skill (experience guide) by skillId or taskId |\n| `skill_search` | Search available skills with scope: local / group / all |\n| `skill_install` | Install a skill into the agent workspace |\n| `memory_viewer` | Get the Memory Viewer URL |\n\nLifecycle hooks (automatic — no agent action needed):\n\n| Hook | Trigger | What happens |\n| ---- | ------- | ------------ |\n| `before_agent_start` | Every turn | Relevant memories injected as context |\n| `agent_end` | After each turn | Conversation captured and indexed |\n\nAdditional tools (`task_share`, `task_unshare`, `memory_share`, `memory_unshare`, `skill_publish`, `skill_unpublish`, `skill_files`, `skill_file_get`, `network_memory_detail`, `network_skill_pull`, `network_team_info`) are also available. See the bundled skill for full reference.\n\n**Bundled skill:** The plugin auto-installs `memos-memory-guide` into `~/.openclaw/workspace/skills/memos-memory-guide/`. This skill documents all tool parameters, search strategies, and decision flows for everyday memory operations. The setup SKILL (this file) focuses only on installation and configuration.\n\n---\n\n## Common failure modes\n\nAgents often finish the technical setup and forget to send the required final handoff.\nPrevent this by treating the handoff as part of the setup itself, not as optional follow-up.\n\nAnother common failure: forgetting to disable OpenClaw's built-in memory search. This causes duplicate retrieval and wasted tokens.\n\nA third common failure: asking the user for confirmation before running the install script, or asking which action to take when the plugin is already installed. This breaks the autonomous installation flow. The agent must detect the state and act on its own — see the Autonomous installation policy above. The **only exception** is Step 1.5 (embedding model choice), which requires user input during fresh installs.\n\nA fourth common failure: **sending multiple tool calls in parallel** (e.g. Step 0 + Step 1 + Step 2 as simultaneous exec calls). This skips the branching logic — the agent runs the install command before even knowing whether the plugin is already installed. Always execute steps sequentially, one at a time.\n\n---\n\n## Onboarding\n\n> **Communicating with the user:** Throughout this flow, whenever you need to inform the user of something, you MUST generate a **direct text reply** (the text content in your assistant response). Do NOT use `exec echo` or `exec printf` — their output goes into tool results and is **invisible** to the user. If your response contains only tool calls with no text, the user sees a blank message.\n\n> **Cross-platform convention:** All scripts in this flow are designed to work on **macOS, Linux, and Windows**. The primary approach is `node -e \"...\"` — the `node -e` syntax is identical in bash, PowerShell, and cmd, and Node.js is always available since OpenClaw runs on Node.js. Inside the Node.js scripts, `require('os').homedir()` replaces `$HOME` / `%USERPROFILE%`, `require('path').join(...)` handles path separators, and `process.platform` detects the OS (`darwin` / `linux` / `win32`). Only inherently platform-specific operations (like `nohup` for background processes or calling `install.sh` / `install.ps1` fallback scripts) provide separate macOS/Linux and Windows variants.\n\n### Step 0 — Check installation status and version\n\n`[AGENT]` Detect current installation state and compare with the latest available version. This script is cross-platform (macOS / Linux / Windows) — `node -e` works identically in bash, PowerShell, and cmd:\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst { execSync } = require('child_process');\nconst dir = path.join(require('os').homedir(), '.openclaw', 'extensions', 'memos-local-openclaw-plugin');\nconst pkgPath = path.join(dir, 'package.json');\n\nif (fs.existsSync(pkgPath)) {\n  console.log('ALREADY_INSTALLED');\n  let installed = 'unknown';\n  try { installed = JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version || 'unknown'; } catch(e) {}\n  console.log('INSTALLED_VERSION: ' + installed);\n\n  let latest = 'unknown';\n  try {\n    latest = execSync('npm view @memtensor/memos-local-openclaw-plugin version', { encoding: 'utf8', timeout: 30000 }).trim();\n  } catch(e) {\n    try {\n      latest = execSync('npm view @memtensor/memos-local-openclaw-plugin version --registry https://registry.npmmirror.com', { encoding: 'utf8', timeout: 30000 }).trim();\n    } catch(e2) {}\n  }\n  console.log('LATEST_VERSION: ' + latest);\n\n  if (installed === 'unknown' || latest === 'unknown') {\n    console.log('STATUS: VERSION_CHECK_FAILED');\n  } else if (installed === latest) {\n    console.log('STATUS: UP_TO_DATE');\n  } else {\n    console.log('STATUS: OUTDATED');\n  }\n} else {\n  console.log('NOT_INSTALLED');\n}\n\"\n```\n\nBranching — the agent decides autonomously (do **not** ask the user):\n\n- If `NOT_INSTALLED`:\n  - Inform the user briefly:\n    > Installing MemOS memory plugin...\n    > 正在安装 MemOS 记忆插件...\n  - Continue to Step 1 → **Step 1.5** (ask embedding choice) → Step 2 → Step 3 → Step 3.5 + Step 4. Do not wait for confirmation except in Step 1.5.\n\n- If `ALREADY_INSTALLED` + `OUTDATED`:\n  - Inform the user briefly:\n    > MemOS has a new version available (installed: X.X.X → latest: Y.Y.Y), upgrading automatically...\n    > MemOS 有新版本可用（当前: X.X.X → 最新: Y.Y.Y），正在自动升级...\n  - **Skip Step 1 and Step 1.5** — the existing embedding config in `openclaw.json` is preserved.\n  - Run the upgrade command directly (set timeout to at least **180 seconds**):\n    ```\n    node -e \"process.env.MEMOS_SKIP_SETUP='1';require('child_process').execSync('openclaw plugins update memos-local-openclaw-plugin',{stdio:'inherit'})\"\n    ```\n    If that command fails, fall back to full reinstall — remove the old plugin directory:\n    ```\n    node -e \"const p=require('path').join(require('os').homedir(),'.openclaw','extensions','memos-local-openclaw-plugin');require('fs').rmSync(p,{recursive:true,force:true});console.log('Removed: '+p)\"\n    ```\n    Then proceed to Step 1 → Step 2 → Step 3 → Step 3.5 + Step 4 (skip Step 1.5 — the existing embedding config in `openclaw.json` is preserved).\n  - After upgrade completes, rebuild `better-sqlite3`:\n    ```\n    node -e \"require('child_process').execSync('npm rebuild better-sqlite3',{cwd:require('path').join(require('os').homedir(),'.openclaw','extensions','memos-local-openclaw-plugin'),stdio:'inherit'})\"\n    ```\n  - Send a status message:\n    > ✅ MemOS updated to the latest version (Y.Y.Y), configuring...\n    > ✅ MemOS 已更新至最新版本 (Y.Y.Y)，正在配置...\n  - Continue to Step 3 → Step 3.5 + Step 4.\n\n- If `ALREADY_INSTALLED` + `UP_TO_DATE`:\n  - Inform the user:\n    > MemOS is already the latest version (X.X.X), no update needed. Memory Viewer: http://127.0.0.1:18799\n    > MemOS 已是最新版本 (X.X.X)，无需更新。Memory Viewer: http://127.0.0.1:18799\n  - Run a quick verification (Step 5 only — do **not** restart the gateway unnecessarily).\n  - If Step 5 verification passes → send a brief confirmation to the user and end. Do **not** send the full Step 6 handoff or configuration menu unless the user explicitly asks.\n  - If Step 5 verification fails (plugin not loading, config issues, etc.) → proceed to Step 3 → Step 3.5 + Step 4 → Step 5 → Step 6 to auto-repair.\n\n- If `ALREADY_INSTALLED` + `VERSION_CHECK_FAILED` (npm unreachable):\n  - Treat as `UP_TO_DATE` — cannot determine whether an update exists, so verify the current installation instead.\n\n---\n\n### Step 1 — Detect environment\n\n`[AGENT]` Collect environment information (cross-platform):\n\n```\nnode -e \"\nconst { execSync } = require('child_process');\nconsole.log('OS: ' + process.platform);\nconsole.log('Node.js: ' + process.version);\ntry {\n  const v = execSync('openclaw --version', { encoding: 'utf8', timeout: 10000 }).trim();\n  console.log('OpenClaw CLI: ' + (v || 'available'));\n} catch(e) {\n  console.log('OpenClaw CLI: NOT_FOUND');\n}\n\"\n```\n\n`process.platform` returns `darwin` (macOS), `linux`, or `win32` (Windows).\n\nRouting rule:\n\n- If `OpenClaw CLI` is available (the normal case — the agent is running inside OpenClaw) → use **Step 2 primary method** (`openclaw plugins install`). This works on all platforms and does not disconnect the session.\n- If `OpenClaw CLI` is NOT available (unusual) → use the **install script fallback** in Step 2. Choose bash (macOS/Linux: `install.sh`) or PowerShell (Windows: `install.ps1`) based on `process.platform`.\n\n---\n\n### Step 1.5 — Choose embedding model (user interaction)\n\n> **This step only applies to fresh installations** (`NOT_INSTALLED` in Step 0). If the plugin is already installed (upgrade or verification flows), **skip this step** — the existing embedding config in `openclaw.json` is preserved.\n\n> This is the **only** user interaction before installation completes. All other steps are fully autonomous.\n\n`[AGENT]` Present the following choices to the user:\n\n```\nBefore we continue, please choose the Embedding model for semantic search:\n在继续安装之前，请选择语义搜索使用的 Embedding（向量化）模型：\n\n🅰 Use default local model (recommended for beginners, reply A)\n🅰 使用默认本地模型（推荐新手，直接回复 A）\n   ✅ Fully offline, no API keys, zero configuration\n   ✅ 完全离线运行，无需 API 密钥，零配置\n   ✅ Works out of the box, no extra setup needed\n   ✅ 安装即用，无需任何额外设置\n   ℹ️  Uses Xenova/all-MiniLM-L6-v2, best suited for English-dominant scenarios\n   ℹ️  使用 Xenova/all-MiniLM-L6-v2 模型，适合英文为主的场景\n\n🅱 Use external Embedding API (recommended for better search quality, reply B)\n🅱 使用外部 Embedding API（推荐追求搜索质量的用户，回复 B）\n   ✅ Higher quality semantic search and memory recall\n   ✅ 更高质量的语义搜索和记忆召回\n   ✅ Better Chinese and multilingual understanding\n   ✅ 更好的中文、多语言理解能力\n   ℹ️  Requires API endpoint and key (supports OpenAI-compatible, Gemini, Cohere, etc.)\n   ℹ️  需要提供 API 地址和密钥（支持 OpenAI 兼容接口、Gemini、Cohere 等）\n\nPlease reply A or B:\n请回复 A 或 B：\n```\n\nWait for the user's response.\n\n**If the user chooses A** (or says \"默认\", \"default\", \"local\", \"本地\", \"skip\", \"跳过\", etc.):\n\n- No embedding config needed — the plugin auto-uses the local offline model when no `config.embedding` is present in `openclaw.json`.\n- Store internally: `EMBEDDING_CHOICE=local`\n- Confirm:\n  > OK, will use the default local model. Continuing installation...\n  > 好的，将使用默认本地模型。继续安装...\n- Continue to Step 2 immediately.\n\n**If the user chooses B** (or says \"API\", \"外部\", \"配置\", \"external\", etc.):\n\n- Ask the user for their API details:\n\n```\nPlease provide the following Embedding API information:\n请提供以下 Embedding API 信息：\n\n1. Provider (service type), options:\n1. Provider（服务商类型），可选值：\n   • openai_compatible — Any OpenAI-compatible API (OpenAI, Azure, SiliconFlow, Zhipu, etc.)\n   • openai_compatible — 任何 OpenAI 兼容接口（OpenAI、Azure、硅基流动、智谱等）\n   • gemini — Google Gemini\n   • cohere — Cohere\n   • voyage — Voyage AI\n   • mistral — Mistral AI\n\n2. Endpoint (API address), e.g.:\n2. Endpoint（API 地址），例如：\n   https://api.openai.com/v1\n\n3. API Key, e.g.:\n3. API Key（密钥），例如：\n   sk-xxxxxxxxxxxx\n\n4. Model (model name), e.g.:\n4. Model（模型名称），例如：\n   text-embedding-3-small / bge-m3\n\nPlease provide them in order, or reply in this format:\n请依次提供，或直接按如下格式回复：\nprovider: openai_compatible\nendpoint: https://api.openai.com/v1\napiKey: sk-xxx\nmodel: text-embedding-3-small\n```\n\n- Wait for the user's response. Parse the four values.\n- Store internally: `EMBEDDING_CHOICE=api`, `EMBEDDING_PROVIDER`, `EMBEDDING_ENDPOINT`, `EMBEDDING_API_KEY`, `EMBEDDING_MODEL`\n- Confirm:\n  > Got it, embedding config will be written during installation. Continuing...\n  > 收到，embedding 配置将在安装过程中自动写入。继续安装...\n- Continue to Step 2.\n\nThese values will be written into `openclaw.json` during Step 3.\n\n---\n\n### Step 2 — Install plugin\n\n#### Primary method — OpenClaw CLI (recommended for agents)\n\n`[AGENT]` Use the OpenClaw CLI to install the plugin. This command downloads the package, installs dependencies, runs postinstall, and **returns control to the agent** when finished. No session disconnect.\n\n```\nnode -e \"process.env.MEMOS_SKIP_SETUP='1';require('child_process').execSync('openclaw plugins install @memtensor/memos-local-openclaw-plugin',{stdio:'inherit'})\"\n```\n\n**Timeout:** This command downloads the npm package and compiles native modules (`better-sqlite3`). It typically takes 1–3 minutes. Set the tool call timeout to at least **180 seconds**. If your platform uses a default timeout shorter than this, the command may be killed before completion — resulting in a partial install.\n\nIf npm is slow or unreachable (common on mainland China networks), retry with the mirror:\n\n```\nnode -e \"process.env.MEMOS_SKIP_SETUP='1';process.env.NPM_CONFIG_REGISTRY='https://registry.npmmirror.com';require('child_process').execSync('openclaw plugins install @memtensor/memos-local-openclaw-plugin',{stdio:'inherit'})\"\n```\n\n`MEMOS_SKIP_SETUP=1` skips the interactive LAN sharing wizard in the postinstall script, which would hang in a non-interactive agent context. Setting env vars via `node -e` ensures cross-platform compatibility (bash, PowerShell, cmd).\n\nAfter the command completes successfully, **proactively rebuild `better-sqlite3`** to ensure the native module matches the current Node.js version. The plugin ships prebuilt binaries for Node.js 22, but the machine may run a different version (e.g. Node.js 24):\n\n```\nnode -e \"require('child_process').execSync('npm rebuild better-sqlite3',{cwd:require('path').join(require('os').homedir(),'.openclaw','extensions','memos-local-openclaw-plugin'),stdio:'inherit'})\"\n```\n\n`[AGENT]` After install and rebuild both complete, send a status message to the user:\n\n> ✅ MemOS plugin downloaded and installed successfully, configuring...\n> ✅ MemOS 插件下载安装成功，正在配置...\n\nThen continue to Step 3. The agent stays connected throughout.\n\n#### Fallback — install.sh / install.ps1\n\nOnly use the install script if `openclaw plugins install` fails (e.g., OpenClaw CLI not available, Node.js not installed). The install script can auto-install Node.js, but it has a critical side effect:\n\n> **WARNING:** The install script ends with `exec openclaw gateway run`, which **replaces the shell process**. The tool call will never return, and the agent session will disconnect.\n\n`[AGENT]` If you must use the install script:\n\n1. **First**, send a notice via the `message` tool (do **not** rely on the final assistant reply text — tool calls execute before the reply is delivered, and the gateway restart will prevent it from being sent):\n\n> MemOS memory plugin is being installed. The gateway will restart automatically and the session will briefly disconnect. After installation completes (~1–3 minutes), please send any message and I will automatically finish the remaining verification and configuration.\n> MemOS 记忆插件安装中，网关将自动重启，届时会话将短暂断开。安装完成后（约 1–3 分钟）请发送任意消息，我将自动完成剩余的验证和配置。\n\n2. **Then** execute the script immediately (do not wait for user confirmation):\n\nmacOS / Linux:\n```bash\ncurl -fsSL https://cdn.memtensor.com.cn/memos-local-openclaw/install.sh | bash\n```\n\nWindows (PowerShell):\n```powershell\npowershell -c \"irm https://cdn.memtensor.com.cn/memos-local-openclaw/install.ps1 | iex\"\n```\n\nThe install script automatically: ensures Node.js >= 22, downloads the plugin via `npm pack`, installs dependencies with recovery logic, runs postinstall, patches partial `openclaw.json` config, and starts the gateway via `exec`.\n\n**After reconnection:** When the user sends any follow-up message, the agent re-enters this skill from Step 0. Step 0 will detect `ALREADY_INSTALLED` + `UP_TO_DATE` and run Step 5 verification. Since the install script (install.sh / install.ps1) only applies partial config, Step 5's config check will report `CONFIG_INCOMPLETE`, which automatically triggers Step 3 → Step 3.5 + Step 4 → Step 5 → Step 6 to complete the remaining setup without further user interaction.\n\n---\n\n### Step 3 — Configure openclaw.json\n\n`[AGENT]` If the install script fallback was used, it already set `plugins.enabled` and `plugins.allow`. But additional configuration is still needed. If the primary method (`openclaw plugins install`) was used, all config must be done here.\n\nThe agent must patch `~/.openclaw/openclaw.json` to:\n\n1. Disable OpenClaw's built-in memory search (critical — prevents duplicate retrieval)\n2. Set `plugins.slots.memory` to the plugin ID\n3. Ensure the plugin entry (`plugins.entries`) is created and enabled\n\nCheck the installed OpenClaw version first:\n\n```\nopenclaw --version\n```\n\n#### OpenClaw >= 2.2.0\n\n`[AGENT]` Patch existing config (merge-safe, preserves other keys). Cross-platform — path computed via `os.homedir()`:\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst configPath = path.join(require('os').homedir(), '.openclaw', 'openclaw.json');\nconst pluginId = 'memos-local-openclaw-plugin';\n\nlet config = {};\nif (fs.existsSync(configPath)) {\n  const raw = fs.readFileSync(configPath, 'utf8').trim();\n  if (raw.length > 0) {\n    config = JSON.parse(raw);\n  }\n}\n\nif (!config.agents) config.agents = {};\nif (!config.agents.defaults) config.agents.defaults = {};\nif (!config.agents.defaults.memorySearch) config.agents.defaults.memorySearch = {};\nconfig.agents.defaults.memorySearch.enabled = false;\n\nif (!config.plugins) config.plugins = {};\nconfig.plugins.enabled = true;\nif (!config.plugins.slots) config.plugins.slots = {};\nconfig.plugins.slots.memory = pluginId;\nif (config.plugins.slots.contextEngine === pluginId) delete config.plugins.slots.contextEngine;\n\nif (!Array.isArray(config.plugins.allow)) config.plugins.allow = [];\nif (!config.plugins.allow.includes(pluginId)) config.plugins.allow.push(pluginId);\n\nif (!config.plugins.entries) config.plugins.entries = {};\nif (!config.plugins.entries[pluginId]) {\n  config.plugins.entries[pluginId] = { enabled: true, config: {} };\n} else {\n  config.plugins.entries[pluginId].enabled = true;\n}\n\nfs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\\n', 'utf8');\nconsole.log('OK: openclaw.json updated');\n\"\n```\n\n#### OpenClaw < 2.2.0\n\n`[AGENT]` Same as above, but omit the `allow` array:\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst configPath = path.join(require('os').homedir(), '.openclaw', 'openclaw.json');\nconst pluginId = 'memos-local-openclaw-plugin';\n\nlet config = {};\nif (fs.existsSync(configPath)) {\n  const raw = fs.readFileSync(configPath, 'utf8').trim();\n  if (raw.length > 0) {\n    config = JSON.parse(raw);\n  }\n}\n\nif (!config.agents) config.agents = {};\nif (!config.agents.defaults) config.agents.defaults = {};\nif (!config.agents.defaults.memorySearch) config.agents.defaults.memorySearch = {};\nconfig.agents.defaults.memorySearch.enabled = false;\n\nif (!config.plugins) config.plugins = {};\nconfig.plugins.enabled = true;\nif (!config.plugins.slots) config.plugins.slots = {};\nconfig.plugins.slots.memory = pluginId;\nif (config.plugins.slots.contextEngine === pluginId) delete config.plugins.slots.contextEngine;\n\nif (!config.plugins.entries) config.plugins.entries = {};\nif (!config.plugins.entries[pluginId]) {\n  config.plugins.entries[pluginId] = { enabled: true, config: {} };\n} else {\n  config.plugins.entries[pluginId].enabled = true;\n}\n\nfs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\\n', 'utf8');\nconsole.log('OK: openclaw.json updated');\n\"\n```\n\nAfter patching, `openclaw.json` should contain at least these keys (other existing keys are preserved):\n\n```json\n{\n  \"agents\": {\n    \"defaults\": {\n      \"memorySearch\": {\n        \"enabled\": false\n      }\n    }\n  },\n  \"plugins\": {\n    \"enabled\": true,\n    \"slots\": {\n      \"memory\": \"memos-local-openclaw-plugin\"\n    },\n    \"entries\": {\n      \"memos-local-openclaw-plugin\": {\n        \"enabled\": true,\n        \"config\": {}\n      }\n    },\n    \"allow\": [\"memos-local-openclaw-plugin\"]\n  }\n}\n```\n\n**Critical:** `agents.defaults.memorySearch.enabled` must be `false`. Otherwise OpenClaw's built-in memory search runs alongside MemOS, causing duplicate retrieval and wasted tokens.\n\n#### Embedding config (from Step 1.5)\n\nIf the user chose **Choice B (external API)** in Step 1.5, write the embedding config into `openclaw.json` immediately after the main config patch above:\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst configPath = path.join(require('os').homedir(), '.openclaw', 'openclaw.json');\nconst config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\nconst pluginId = 'memos-local-openclaw-plugin';\n\nif (!config.plugins) config.plugins = {};\nif (!config.plugins.entries) config.plugins.entries = {};\nif (!config.plugins.entries[pluginId]) config.plugins.entries[pluginId] = { enabled: true, config: {} };\nif (!config.plugins.entries[pluginId].config) config.plugins.entries[pluginId].config = {};\n\nconfig.plugins.entries[pluginId].config.embedding = {\n  provider: process.argv[1],\n  endpoint: process.argv[2],\n  apiKey: process.argv[3],\n  model: process.argv[4]\n};\n\nfs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\\n', 'utf8');\nconsole.log('OK: embedding configured');\n\" \"<PROVIDER>\" \"<ENDPOINT>\" \"<API_KEY>\" \"<MODEL>\"\n```\n\nReplace `<PROVIDER>`, `<ENDPOINT>`, `<API_KEY>`, `<MODEL>` with the actual values collected from the user in Step 1.5. Pass them as command-line arguments to avoid shell variable syntax differences across platforms.\n\nIf the user chose **Choice A (default local model)** in Step 1.5, **skip this substep** — no embedding config is needed. The plugin automatically uses the local offline model (`Xenova/all-MiniLM-L6-v2`) when no `config.embedding` is present.\n\n---\n\n### Step 3.5 + Step 4 — Notify user AND restart gateway\n\n> **CRITICAL — What the user can and cannot see:**\n>\n> - ✅ **Visible:** Direct text in your assistant response (the `text` content block you generate as the LLM)\n> - ❌ **Invisible:** Output from `exec echo`, `exec printf`, or any other tool's stdout/stderr — these go into tool results only, the user never sees them\n>\n> If you only issue tool calls (exec → exec → exec) without generating any text content, the user sees **nothing** — a blank response. You MUST produce a text reply.\n\n> **CRITICAL — Race condition:** The gateway restart kills the agent session within ~1 second. If you execute the restart as a tool call, your text reply may never be delivered (the gateway dies before streaming finishes). Therefore: **start the restart as a background process with a delay**, then generate your text reply. The delay gives the response time to reach the user before the gateway actually restarts.\n\n`[AGENT]` Execute the following steps **in a single assistant turn**, in this exact order:\n\n**First**, issue one tool call to schedule a **delayed background restart**. Use the cross-platform Node.js approach — it works on macOS, Linux, and Windows:\n\n```\nnode -e \"const{spawn}=require('child_process');const child=spawn(process.execPath,['-e','setTimeout(()=>{try{require(String.fromCharCode(99,104,105,108,100,95,112,114,111,99,101,115,115)).execSync(String.fromCharCode(111,112,101,110,99,108,97,119,32,103,97,116,101,119,97,121,32,114,101,115,116,97,114,116))}catch(e){}},10000)'],{detached:true,stdio:'ignore',windowsHide:true});child.unref();console.log('RESTART_SCHEDULED')\"\n```\n\n> The `String.fromCharCode(...)` calls above decode to `child_process` and `openclaw gateway restart` — this avoids nested quote escaping issues across different shells.\n\nIf the above command fails for any reason, fall back to the **platform-specific** version:\n\nmacOS / Linux:\n```bash\nnohup sh -c 'sleep 10 && openclaw gateway restart' >/dev/null 2>&1 &\necho \"RESTART_SCHEDULED\"\n```\n\nWindows (PowerShell):\n```powershell\nStart-Process -WindowStyle Hidden -FilePath node -ArgumentList \"-e\",\"setTimeout(()=>{require('child_process').execSync('openclaw gateway restart')},10000)\"\nWrite-Output \"RESTART_SCHEDULED\"\n```\n\nThis starts a background process that will restart the gateway **10 seconds from now**. The command returns immediately with `RESTART_SCHEDULED`. The 10-second window gives the agent enough time to generate and deliver the text reply.\n\n**Second**, in the **same assistant turn**, generate a direct text reply to the user (this is the text content block in your response — NOT exec echo). Include all of the following:\n\n```\n✅ MemOS memory plugin installed and configured successfully!\n✅ MemOS 记忆插件已安装并配置完成！\n\n🖥️ Memory Viewer: http://127.0.0.1:18799\nOpen the URL above in your browser to manage memories, tasks, and skills.\n打开浏览器访问上述地址，可管理记忆、任务和技能。\n\n📁 Data location / 数据位置: ~/.openclaw/memos-local/memos.db\n🔤 Embedding model / Embedding 模型: <fill based on Step 1.5 choice, e.g. \"local offline model / 本地离线模型\" or \"openai_compatible (bge-m3)\">\n\nThe gateway will restart in a few seconds to load the plugin. The session may briefly disconnect.\n网关将在几秒后自动重启以加载插件。会话可能短暂断开。\nAfter reconnecting, send any message and I will automatically verify the plugin is running correctly.\n重连后发送任意消息，我会自动验证插件是否正常运行。\n```\n\n> **Why this order works:** The delayed-restart tool call returns immediately, then the LLM generates the text reply. The text is streamed to the user over the next few seconds. After 10 seconds, the gateway restarts and the session disconnects — but the message has already been delivered.\n\n**After the gateway restarts:**\n\n- The user sends any follow-up message → the agent re-enters from Step 0\n- Step 0 detects `ALREADY_INSTALLED` + `UP_TO_DATE` → runs Step 5 verification\n- If verification passes → send a brief confirmation and the optional configuration menu (Step 6)\n- If verification fails → auto-repair\n\n**If none of the above delayed-restart commands work**, fall back to a two-turn approach:\n\n1. **Turn 1:** Generate text reply with the completion message above. Do NOT issue any restart command. End your turn.\n2. **Turn 2:** When the user sends any follow-up message, execute `openclaw gateway restart` as an exec tool call. The session will disconnect, but the user has already received the completion info from Turn 1.\n\n---\n\n### Step 5 — Verify installation\n\n`[AGENT]` Run the following checks in order.\n\n**Check 1 — Configuration completeness (cross-platform):**\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst configPath = path.join(require('os').homedir(), '.openclaw', 'openclaw.json');\nconst config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\nconst pluginId = 'memos-local-openclaw-plugin';\nconst issues = [];\n\nif (config.agents?.defaults?.memorySearch?.enabled !== false)\n  issues.push('memorySearch.enabled is not false');\nif (config.plugins?.slots?.memory !== pluginId)\n  issues.push('plugins.slots.memory not set');\nif (config.plugins?.slots?.contextEngine === pluginId)\n  issues.push('plugins.slots.contextEngine incorrectly set to plugin ID — must be removed');\nif (!config.plugins?.entries?.[pluginId]?.enabled)\n  issues.push('plugin entry not enabled');\nif (config.plugins?.enabled !== true)\n  issues.push('plugins.enabled is not true');\n\nif (issues.length === 0) {\n  console.log('CONFIG_OK');\n} else {\n  console.log('CONFIG_INCOMPLETE');\n  issues.forEach(i => console.log('  - ' + i));\n}\n\"\n```\n\nIf `CONFIG_INCOMPLETE` → the agent must go to Step 3 → Step 3.5 + Step 4 before continuing verification.\n\n**Check 2 — Gateway log (cross-platform):**\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst logPath = path.join(require('os').homedir(), '.openclaw', 'logs', 'gateway.log');\nif (!fs.existsSync(logPath)) { console.log('NO_LOG_FOUND'); process.exit(0); }\nconst lines = fs.readFileSync(logPath, 'utf8').split('\\n');\nconst last30 = lines.slice(-30);\nconst pattern = /memos-local|MemOS|Memory Viewer|error|Error/i;\nconst matches = last30.filter(l => pattern.test(l));\nif (matches.length === 0) { console.log('NO_RELEVANT_LOG_ENTRIES'); }\nelse { matches.forEach(l => console.log(l)); }\n\"\n```\n\nA successful setup shows:\n\n```\nmemos-local: initialized (db: ~/.openclaw/memos-local/memos.db)\nmemos-local: started (embedding: local)\n╔══════════════════════════════════════════╗\n║  MemOS Memory Viewer                     ║\n║  → http://127.0.0.1:18799               ║\n║  Open in browser to manage memories       ║\n╚══════════════════════════════════════════╝\n```\n\n**Check 3 — Plugin listed (cross-platform):**\n\n```\nnode -e \"\ntry {\n  const out = require('child_process').execSync('openclaw plugins list', { encoding: 'utf8', timeout: 10000 });\n  const matches = out.split('\\n').filter(l => /memos/i.test(l));\n  if (matches.length > 0) { matches.forEach(l => console.log(l)); }\n  else { console.log('PLUGIN_NOT_LISTED'); }\n} catch(e) { console.log('PLUGIN_NOT_LISTED'); }\n\"\n```\n\n**Check 4 — Bundled skill installed (cross-platform):**\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst home = require('os').homedir();\nconst p1 = path.join(home, '.openclaw', 'workspace', 'skills', 'memos-memory-guide', 'SKILL.md');\nconst p2 = path.join(home, '.openclaw', 'skills', 'memos-memory-guide', 'SKILL.md');\nif (fs.existsSync(p1)) { console.log('SKILL_OK'); }\nelse if (fs.existsSync(p2)) { console.log('SKILL_OK (alt path)'); }\nelse { console.log('SKILL_MISSING'); }\n\"\n```\n\n**Verification result:**\n\nA setup is successful if **all** of the following are true:\n\n- `CONFIG_OK` — all required keys are set correctly\n- Gateway log shows `memos-local: initialized`\n- No error messages related to `memos-local` in the log\n- Memory Viewer banner appears with the URL\n- Plugin appears in `openclaw plugins list`\n- `memos-memory-guide` skill is present\n\nIf any check fails, the agent should auto-repair based on the failure type. Do not ask the user what to do.\n\n**Auto-repair: config issues** → Step 3 → Step 3.5 + Step 4 → re-run Step 5.\n\n**Auto-repair: `better-sqlite3` / NODE_MODULE_VERSION mismatch:**\n\nIf the gateway log shows any of these errors:\n- `NODE_MODULE_VERSION` mismatch (e.g. \"compiled against NODE_MODULE_VERSION 127, this version requires 137\")\n- `Could not locate the bindings file`\n- `memos-local-openclaw-plugin failed during register` with a `better-sqlite3` error\n\nThe plugin ships prebuilt binaries for Node.js 22. If the machine runs a different Node.js version (e.g. v24.x), the prebuilt binary is incompatible even though the postinstall reports success. Run:\n\n```\nnode -e \"require('child_process').execSync('npm rebuild better-sqlite3',{cwd:require('path').join(require('os').homedir(),'.openclaw','extensions','memos-local-openclaw-plugin'),stdio:'inherit'})\"\n```\n\nThen restart the gateway (`openclaw gateway restart`) and re-run Step 5 verification. This rebuild compiles `better-sqlite3` from source for the current Node.js version.\n\nIf `npm rebuild` fails due to missing C++ build tools, install them first:\n- macOS: `xcode-select --install`\n- Linux: `sudo apt install build-essential python3`\n- Windows: install [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with \"C++ build tools\" workload\n\n**Auto-repair: other failures** → Step 3 → Step 3.5 + Step 4 → re-run Step 5.\n\n---\n\n### Step 6 — Post-verification handoff\n\n`[AGENT]` After Step 5 verification passes, send the full handoff message. If this step runs after a reconnection (i.e. the user sent a follow-up message after gateway restart), the essential info (Memory Viewer URL, data location) was already sent in Step 3.5. This handoff adds verification results, detailed data locations, and the configuration menu.\n\nPresent the message in bilingual format (English first, then Chinese), keeping the same structure and all information:\n\n```\n✅ MemOS memory plugin is installed and running.\n✅ MemOS 记忆插件已安装并正常运行。\n\n🖥️ MEMORY VIEWER / 记忆查看器\n\nOpen http://127.0.0.1:18799 in your browser to manage memories, tasks, and skills.\n打开浏览器访问 http://127.0.0.1:18799，可管理记忆、任务和技能。\n\n🧪 VERIFY IT WORKS / 验证是否生效\n\nStep A — Have a conversation about anything in your next OpenClaw session.\n步骤 A — 在下一次 OpenClaw 会话中随意对话。\nStep B — Open the Memory Viewer and check that the conversation appears.\n步骤 B — 打开 Memory Viewer，查看对话是否已被记录。\nStep C — In a new session, ask: \"Do you remember what we discussed last time?\"\n         The agent should recall the conversation via memory_search.\n步骤 C — 在新会话中问：\"你还记得我们上次聊了什么吗？\"\n         Agent 应通过 memory_search 召回对话内容。\n\n📁 DATA LOCATION / 数据位置\n\nDatabase / 数据库:       ~/.openclaw/memos-local/memos.db\nGateway log / 网关日志:  ~/.openclaw/logs/gateway.log\nPlugin code / 插件代码:  ~/.openclaw/extensions/memos-local-openclaw-plugin/\nMemory guide / 记忆指南: ~/.openclaw/workspace/skills/memos-memory-guide/SKILL.md\n                         (also / 也在 ~/.openclaw/skills/memos-memory-guide/)\nGenerated skills / 生成的技能: ~/.openclaw/memos-local/skills-store/\n\n♻️ REINSTALL / RECOVERY / 重装 / 恢复\n\nAll memory is stored locally in memos.db. To reinstall:\n所有记忆数据存储在本地 memos.db 中。重装步骤：\n1. Re-run the install script (your data is preserved in memos.db)\n1. 重新运行安装脚本（数据不会丢失）\n2. Re-apply the openclaw.json config (Step 3)\n2. 重新配置 openclaw.json（步骤 3）\n3. Restart the gateway\n3. 重启网关\n\n📦 BACKUP / 备份\n\nBack up ~/.openclaw/memos-local/memos.db periodically.\n定期备份 ~/.openclaw/memos-local/memos.db。\nThis single file contains all your memories, tasks, and skills.\n这个文件包含了你所有的记忆、任务和技能。\n\n🔧 OPTIONAL CONFIGURATION / 可选配置\n\nThe following can be configured now or at any time later:\n以下内容可以现在配置，也可以以后随时配置：\n\n- Summarizer model — improve task summary quality (default: OpenClaw native model)\n- 摘要模型 — 提升任务总结质量（默认：OpenClaw 原生模型）\n- Skill evolution model — higher quality auto-generated skills\n- 技能进化模型 — 更高质量的自动生成技能\n- Team sharing — Hub-Client multi-agent collaborative memory\n- 团队共享 — Hub-Client 多智能体协作记忆\n- Import memories — migrate OpenClaw built-in memories into MemOS\n- 导入记忆 — 将 OpenClaw 内置记忆迁移到 MemOS\n\n💡 Embedding model was configured during installation. Ask me anytime to change it.\n💡 Embedding 模型已在安装过程中配置完毕。如需更换，随时告诉我。\n```\n\nDo not default to offering a synthetic write/read demo as the next step.\n\n**After delivering the handoff, proactively ask the user:**\n\n```\nIs there anything you'd like me to configure now?\n需要我帮你配置以下内容吗？\n\n1. Configure summarizer — improve task summary quality (default: OpenClaw native model)\n1. 配置摘要模型 — 提升任务总结质量（默认：OpenClaw 原生模型）\n\n2. Customize skill evolution model — higher quality auto-generated skills\n2. 自定义技能进化模型 — 更高质量的自动生成技能\n\n3. Set up team sharing — Hub-Client multi-agent collaborative memory\n3. 设置团队共享 — Hub-Client 多智能体协作记忆\n\n4. Skip — start using MemOS right away\n4. 跳过 — 直接开始使用 MemOS\n\n💡 Embedding model was configured during installation. Ask me anytime to reconfigure.\n💡 Embedding 模型已在安装过程中配置完毕。如需更换，随时告诉我。\n```\n\nWait for the user's response. If the user chooses an option (1–3), follow the corresponding section in \"Optional Configuration\" below. If the user chooses 4 or does not respond, end the task. If the user asks to reconfigure embedding, follow the \"Embedding Provider (reconfigure)\" section.\n\nTogether with Step 1.5 (embedding model choice), these are the **only two** points in the entire flow where the agent waits for user input.\n\n---\n\n## Optional Configuration — Embedding and Summarizer\n\nEmbedding is configured during installation (Step 1.5) and is **not** included in the Step 6 menu. This section is used when the user **later asks** to reconfigure embedding, or when the user selects a configuration option from the Step 6 menu (summarizer, etc.).\n\n### Embedding Provider (reconfigure)\n\nAsk the user:\n\n> Which embedding provider do you want to switch to?\n> 你想切换到哪个 Embedding 服务商？\n\n| Provider | `provider` value | Example `model` | Notes |\n| -------- | ---------------- | --------------- | ----- |\n| OpenAI / compatible | `openai_compatible` | `bge-m3`, `text-embedding-3-small` | Any OpenAI-compatible API |\n| Gemini | `gemini` | `text-embedding-004` | Requires `apiKey` |\n| Cohere | `cohere` | `embed-english-v3.0` | Separates document/query embedding |\n| Voyage | `voyage` | `voyage-2` | |\n| Mistral | `mistral` | `mistral-embed` | |\n| Local (offline) | `local` | — | Default. Uses `Xenova/all-MiniLM-L6-v2`, no API needed |\n\n`[AGENT]` Patch the embedding config into `openclaw.json`:\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst configPath = path.join(require('os').homedir(), '.openclaw', 'openclaw.json');\nconst config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\nconst pluginId = 'memos-local-openclaw-plugin';\n\nif (!config.plugins) config.plugins = {};\nif (!config.plugins.entries) config.plugins.entries = {};\nif (!config.plugins.entries[pluginId]) config.plugins.entries[pluginId] = { enabled: true, config: {} };\nif (!config.plugins.entries[pluginId].config) config.plugins.entries[pluginId].config = {};\n\nconfig.plugins.entries[pluginId].config.embedding = {\n  provider: process.argv[1],\n  endpoint: process.argv[2],\n  apiKey: process.argv[3],\n  model: process.argv[4]\n};\n\nfs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\\n', 'utf8');\nconsole.log('OK: embedding configured');\n\" \"openai_compatible\" \"https://your-api-endpoint/v1\" \"sk-your-key\" \"bge-m3\"\n```\n\nReplace the four argument values above with user-provided values.\n\n### Summarizer Provider\n\n| Provider | `provider` value | Example `model` |\n| -------- | ---------------- | --------------- |\n| OpenAI / compatible | `openai_compatible` | `gpt-4o-mini` |\n| Anthropic | `anthropic` | `claude-3-haiku-20240307` |\n| Gemini | `gemini` | `gemini-1.5-flash` |\n| AWS Bedrock | `bedrock` | `anthropic.claude-3-haiku-20240307-v1:0` |\n\n`[AGENT]` Patch the summarizer config similarly:\n\n```\nnode -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst configPath = path.join(require('os').homedir(), '.openclaw', 'openclaw.json');\nconst config = JSON.parse(fs.readFileSync(configPath, 'utf8'));\nconst pluginId = 'memos-local-openclaw-plugin';\n\nif (!config.plugins) config.plugins = {};\nif (!config.plugins.entries) config.plugins.entries = {};\nif (!config.plugins.entries[pluginId]) config.plugins.entries[pluginId] = { enabled: true, config: {} };\nif (!config.plugins.entries[pluginId].config) config.plugins.entries[pluginId].config = {};\n\nconfig.plugins.entries[pluginId].config.summarizer = {\n  provider: process.argv[1],\n  endpoint: process.argv[2],\n  apiKey: process.argv[3],\n  model: process.argv[4],\n  temperature: 0\n};\n\nfs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\\n', 'utf8');\nconsole.log('OK: summarizer configured');\n\" \"openai_compatible\" \"https://your-api-endpoint/v1\" \"sk-your-key\" \"gpt-4o-mini\"\n```\n\nReplace the four argument values above with user-provided values.\n\nAfter configuring embedding or summarizer, restart the gateway:\n\n```\nopenclaw gateway restart\n```\n\n### Environment Variable Support\n\nUsers can use `${ENV_VAR}` placeholders in config to avoid hardcoding keys:\n\n```json\n{\n  \"apiKey\": \"${OPENAI_API_KEY}\"\n}\n```\n\n---\n\n## Troubleshooting\n\n| Symptom | Fix |\n| ------- | --- |\n| Plugin not loading | Check `plugins.slots.memory = \"memos-local-openclaw-plugin\"` and `plugins.entries.memos-local-openclaw-plugin.enabled = true` in `~/.openclaw/openclaw.json` |\n| Duplicate memory retrieval / wasted tokens | Set `agents.defaults.memorySearch.enabled = false` — OpenClaw's built-in memory is conflicting |\n| `better-sqlite3` native module error (`Could not locate the bindings file`) | The package ships prebuilt binaries for common platforms, and the plugin auto-rebuilds `better-sqlite3` on gateway startup. If it still fails, rebuild manually: `node -e \"require('child_process').execSync('npm rebuild better-sqlite3',{cwd:require('path').join(require('os').homedir(),'.openclaw','extensions','memos-local-openclaw-plugin'),stdio:'inherit'})\"`. Install C++ build tools first if needed: `xcode-select --install` (macOS), `sudo apt install build-essential python3` (Linux), or install [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) with \"C++ build tools\" workload (Windows) |\n| Plugin not listed in `openclaw plugins list` | Plugin not in `~/.openclaw/extensions/memos-local-openclaw-plugin`. Re-run the install script |\n| Memory Viewer not accessible | Ensure the gateway is running: `openclaw gateway start`. Check the gateway log using the cross-platform Node.js command from Step 5 Check 2 |\n| `Cannot find module` errors | Dependencies missing. The `postinstall` script normally auto-detects and re-installs missing dependencies. If it did not run, fix manually: `node -e \"require('child_process').execSync('npm install --omit=dev',{cwd:require('path').join(require('os').homedir(),'.openclaw','extensions','memos-local-openclaw-plugin'),stdio:'inherit'})\"` |\n| Skills not generating | Check `skillEvolution.enabled` is `true`, tasks have >= 6 chunks, and the LLM model is accessible (check gateway log for `SkillEvolver` errors) |\n| Install script fails on mainland China | The install script download URL (`cdn.memtensor.com.cn`) is China-optimized, but npm package download inside the script uses the standard npm registry. If npm is slow, set the environment variable `NPM_CONFIG_REGISTRY=https://registry.npmmirror.com` before running the script (on Windows PowerShell: `$env:NPM_CONFIG_REGISTRY='https://registry.npmmirror.com'`), or use the primary install method with the mirror flag |\n| `xcode-select\n\nFile v1.0.0:README.md\n\n# MemOS for OpenClaw — One-Click Install\n\n> Chinese version: [README_zh.md](./README_zh.md).\n\n[![npm version](https://img.shields.io/npm/v/@memtensor/memos-local-openclaw-plugin)](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/MemTensor/MemOS/blob/main/LICENSE)\n[![Node.js >= 18](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org/)\n[![GitHub](https://img.shields.io/badge/GitHub-Source-181717?logo=github)](https://github.com/MemTensor/MemOS/tree/main/apps/memos-local-openclaw)\n\n> [Homepage](https://memos-claw.openmem.net) · [Documentation](https://memos-claw.openmem.net/docs/) · [NPM](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin) · [Troubleshooting](https://memos-claw.openmem.net/docs/troubleshooting.html)\n\n---\n\n## What this folder contains\n\n| File | Purpose |\n| ---- | ------- |\n| **`SKILL.md`** | The agent skill that drives one-click installation. Once loaded, OpenClaw reads this file and **autonomously** installs, configures, and verifies the MemOS plugin — you just answer one question. |\n| **`README.md`** | This file — a human-readable overview of the installation experience and MemOS's features. |\n\n---\n\n## True one-click: let OpenClaw do the work\n\nThe **`SKILL.md`** in this folder is not a manual — it is a **machine-readable installation skill** designed for the OpenClaw agent. When you say *\"install memos\"* or *\"install MemOS\"*, here is what happens:\n\n### Zero manual steps\n\nOnce triggered, OpenClaw executes a **6-step autonomous pipeline** — detecting your current state, installing the plugin, writing configuration, restarting the gateway, verifying the result, and delivering a final summary. **You do not need to run any command yourself.**\n\nThe only interaction during the entire process is a single question:\n\n> *Choose your embedding model — local offline (A) or external API (B)?*\n\nReply `A` or `B`, and OpenClaw handles the rest. If you are upgrading an existing installation, even this question is skipped — the process is fully hands-free.\n\n### Automatic OS detection — macOS, Linux, and Windows\n\nYou never need to tell the agent what system you are running. The skill uses **`process.platform`** (`darwin` / `linux` / `win32`) to detect your OS and adapts every command accordingly:\n\n| Aspect | How it adapts |\n| ------ | ------------- |\n| **Path separators & home directory** | All paths are built with `require('path').join(...)` and `require('os').homedir()` — works identically on every OS. |\n| **Shell commands** | The primary approach is `node -e \"...\"`, which runs the same way in bash, PowerShell, and cmd. Platform-specific fallbacks (e.g. `nohup` on macOS/Linux, `Start-Process` on Windows) are used only when inherently necessary. |\n| **Install script fallback** | If the OpenClaw CLI is unavailable, the agent picks `install.sh` (macOS/Linux) or `install.ps1` (Windows) automatically — no user decision needed. |\n| **Native module rebuild** | `better-sqlite3` is rebuilt to match your local Node.js version; build-tool guidance is platform-aware (`xcode-select` / `apt install build-essential` / Visual Studio Build Tools). |\n\n**Bottom line:** whether you are on a Mac, a Linux server, or a Windows workstation, say *\"install memos\"* and walk away.\n\n### Smart state detection\n\nThe skill does not blindly reinstall. Before touching anything it checks:\n\n- **Not installed** — full install pipeline (Steps 0 – 6).\n- **Installed but outdated** — automatic upgrade, preserving your existing config.\n- **Already up to date** — quick verification only; no restart unless something is broken.\n- **Config incomplete or broken** — auto-repair without re-downloading the plugin.\n\nEvery branch is chosen by the agent. You are never asked *\"What would you like to do?\"*.\n\n---\n\n## What MemOS gives you\n\nOnce installed, the MemOS plugin transforms OpenClaw into a **memory-powered agent** — 100% on-device, no cloud account required for the default local-embedding path.\n\n### Core capabilities\n\n| Capability | Description |\n| ---------- | ----------- |\n| **Persistent memory** | Every conversation turn is automatically captured, semantically chunked, embedded, and indexed into a local SQLite database (`~/.openclaw/memos-local/memos.db`). No manual \"remember this\" needed. |\n| **Hybrid retrieval** | FTS5 keyword search + vector semantic search, fused with Reciprocal Rank Fusion (RRF) and Maximal Marginal Relevance (MMR) reranking. Configurable recency decay biases recent memories. |\n| **Task summarization** | Conversations are auto-segmented into tasks. Completed tasks receive structured LLM summaries — goal, key steps, result, and preserved details (code, commands, URLs, errors). |\n| **Skill evolution** | High-quality task executions are distilled into reusable skills (SKILL.md bundles) that can **auto-upgrade** when similar tasks appear later. Version history, quality scoring, and auto-install are built in. |\n| **Team sharing** | Optional Hub–Client architecture: one Hub stores shared data, clients keep private data local. Scoped search (`local` / `group` / `all`), task sharing, skill publish/pull, admin approval flow, and real-time notifications. |\n| **Memory Viewer** | A localhost web dashboard (default `http://127.0.0.1:18799`) with 7 pages: Memories, Tasks, Skills, Analytics, Logs, Import, Settings — full CRUD, i18n (Chinese/English), light/dark themes. |\n| **Memory migration** | One-click import of OpenClaw's native built-in memories (SQLite + JSONL) into MemOS, with smart deduplication and resume support. |\n| **Multi-provider embedding** | OpenAI-compatible, Gemini, Cohere, Voyage, Mistral, or fully offline local model (`Xenova/all-MiniLM-L6-v2`). |\n\n### Automatic hooks — no manual \"remember this\"\n\n| Hook | Trigger | What happens |\n| ---- | ------- | ------------ |\n| **`agent_end`** | After each turn | Messages are chunked, embedded, deduplicated (content-hash + LLM judge), and written. |\n| **`before_agent_start`** | Before each turn | Relevant memories are injected into context. If recall is weak, the agent calls `memory_search` with a self-generated query. |\n\n### Tools at your disposal\n\n| Tool | Role |\n| ---- | ---- |\n| `memory_search` | Keyword + semantic search over memories (scoped). |\n| `memory_get` / `memory_timeline` | Full chunk text / surrounding conversation context. |\n| `memory_write_public` | Write memory visible to all local agents. |\n| `task_summary` | Structured summary of a completed task. |\n| `skill_get` / `skill_search` / `skill_install` | Discover and install evolved skills. |\n| `memory_viewer` | Get the Memory Viewer URL. |\n\nPlus Hub–Client networking tools (`task_share`, `skill_publish`, `network_skill_pull`, etc.). Full reference lives in the bundled **`memos-memory-guide`** skill, auto-installed during setup.\n\n---\n\n## Why MemOS — advantages over alternatives\n\n| Problem | How MemOS solves it |\n| ------- | ------------------- |\n| **Agent forgets between sessions** | Durable, indexed memory — automatic capture after every turn. |\n| **Shallow context, repeated mistakes** | Task summaries + skill evolution turn raw chat logs into structured, reusable knowledge. |\n| **Multi-agent teams work in isolation** | Hub–Client sharing with scoped retrieval, task sharing, and skill publishing — while private data stays local. |\n| **No visibility into what the agent remembers** | Memory Viewer: CRUD, analytics, tool-call logs, migration, and online configuration in one dashboard. |\n| **Privacy and data residency concerns** | 100% local-first — SQLite on your machine. External APIs are optional and only used for embedding/summarization **you** configure. |\n| **Platform compatibility** | Runs on macOS, Linux, and Windows. The install skill auto-detects your OS and adapts. |\n| **Complex manual setup** | One phrase — *\"install memos\"* — triggers a fully autonomous pipeline. One embedding-choice question, zero shell commands from you. |\n\nMemOS is part of the broader [MemOS Memory Operating System](../MemOS/README.md) project: a unified store/retrieve/manage platform for LLMs and AI agents, with multimodal memory, knowledge-base management, and enterprise-grade optimizations. This OpenClaw plugin is the **local, on-device** deployment path.\n\n---\n\n## Privacy and security\n\n- **100% on-device** — all data in local SQLite, zero cloud uploads.\n- **Anonymous telemetry** — opt-out via config; only sends tool names, latencies, and version info. Never sends memory content, queries, or personal data.\n- **Viewer security** — binds to `127.0.0.1` only, password-protected with session cookies.\n\n---\n\n## Quick reference — manual install commands\n\nIn most cases you should just say *\"install memos\"* and let the skill handle it. If you prefer running the commands yourself:\n\n**macOS / Linux:**\n\n```bash\ncurl -fsSL https://cdn.memtensor.com.cn/memos-local-openclaw/install.sh | bash\n```\n\n**Windows (PowerShell):**\n\n```powershell\npowershell -c \"irm https://cdn.memtensor.com.cn/memos-local-openclaw/install.ps1 | iex\"\n```\n\n**Via OpenClaw CLI:**\n\n```bash\nopenclaw plugins install @memtensor/memos-local-openclaw-plugin\n```\n\nThen configure `~/.openclaw/openclaw.json`, start the gateway, and open the Memory Viewer. See [full documentation](https://memos-claw.openmem.net/docs/) for embedding/summarizer tables, team sharing setup, and troubleshooting.\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7122re74m5mqwg06nsnn2nwh8418kf\",\n  \"slug\": \"memos-oneclick-install\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1775100883243\n}\n\nFile v1.0.0:README_zh.md\n\n# MemOS for OpenClaw — 一键安装\n\n> English version: [README.md](./README.md).\n\n[![npm version](https://img.shields.io/npm/v/@memtensor/memos-local-openclaw-plugin)](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/MemTensor/MemOS/blob/main/LICENSE)\n[![Node.js >= 18](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org/)\n[![GitHub](https://img.shields.io/badge/GitHub-Source-181717?logo=github)](https://github.com/MemTensor/MemOS/tree/main/apps/memos-local-openclaw)\n\n> [主页](https://memos-claw.openmem.net) · [文档](https://memos-claw.openmem.net/docs/) · [NPM](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin) · [故障排除](https://memos-claw.openmem.net/docs/troubleshooting.html)\n\n---\n\n## 本目录包含\n\n| 文件 | 用途 |\n| ---- | ---- |\n| **`SKILL.md`** | 驱动一键安装的 Agent 技能。加载后，OpenClaw 读取此文件并 **自主** 完成 MemOS 插件的安装、配置与验证 —— 你只需回答一个问题。 |\n| **`README.md` / 本文件** | 面向人类的总览：安装体验说明与 MemOS 功能介绍。 |\n\n---\n\n## 真正的一键安装：让 OpenClaw 替你完成\n\n本目录中的 **`SKILL.md`** 不是一份手册 —— 它是一份 **机器可读的安装技能**，专为 OpenClaw Agent 设计。当你对 Agent 说出 *\"安装 memos\"* 或 *\"install MemOS\"*，以下流程会自动发生：\n\n### 零手动操作\n\n触发后，OpenClaw 执行一条 **6 步全自主流水线** —— 检测当前状态、安装插件、写入配置、重启网关、验证结果、交付最终总结。**你不需要自己执行任何命令。**\n\n整个过程中唯一的交互只有一个问题：\n\n> *选择嵌入模型 —— 本地离线模型 (A) 还是外部 API (B)？*\n\n回复 `A` 或 `B`，其余一切由 OpenClaw 处理。如果是升级现有安装，连这个问题也会跳过 —— 全程无需干预。\n\n### 自动识别操作系统 —— macOS、Linux、Windows 全适配\n\n你无需告诉 Agent 你在用什么系统。技能通过 **`process.platform`**（`darwin` / `linux` / `win32`）自动检测操作系统，并据此调整每一条命令：\n\n| 方面 | 如何适配 |\n| ---- | -------- |\n| **路径分隔符与主目录** | 所有路径通过 `require('path').join(...)` 和 `require('os').homedir()` 构建 —— 在每个系统上表现一致。 |\n| **Shell 命令** | 主要方式为 `node -e \"...\"`，在 bash、PowerShell 和 cmd 中行为相同。仅在固有平台差异处（如 macOS/Linux 的 `nohup`、Windows 的 `Start-Process`）使用特定回退方案。 |\n| **安装脚本回退** | 若 OpenClaw CLI 不可用，Agent 会根据系统自动选择 `install.sh`（macOS/Linux）或 `install.ps1`（Windows）—— 无需用户决定。 |\n| **原生模块重编译** | `better-sqlite3` 会自动重编译以匹配本地 Node.js 版本；构建工具指引也是平台感知的（`xcode-select` / `apt install build-essential` / Visual Studio Build Tools）。 |\n\n**一句话：** 无论你是用 Mac、Linux 服务器还是 Windows 工作站，说一声 *\"安装 memos\"*，然后坐等即可。\n\n### 智能状态检测\n\n技能不会盲目重装。在动手之前它会先检查：\n\n- **未安装** —— 执行完整安装流水线（Steps 0 – 6）。\n- **已安装但版本过旧** —— 自动升级，保留你现有的配置。\n- **已是最新版本** —— 仅做快速验证；除非发现问题，否则不重启。\n- **配置不完整或损坏** —— 自动修复，无需重新下载插件。\n\n每个分支都由 Agent 自主判断。你永远不会被问到 *\"你想做什么？\"*。\n\n---\n\n## MemOS 带给你什么\n\n安装完成后，MemOS 插件将 OpenClaw 变为一个 **具有记忆能力的 Agent** —— 100% 在本地设备上运行，默认使用本地嵌入模型时无需云端账号。\n\n### 核心能力\n\n| 能力 | 说明 |\n| ---- | ---- |\n| **持久记忆** | 每一轮对话自动采集、语义分块、嵌入并索引到本地 SQLite 数据库（`~/.openclaw/memos-local/memos.db`）。无需手动说\"记住这个\"。 |\n| **混合检索** | FTS5 关键词搜索 + 向量语义搜索，通过倒数排名融合 (RRF) 与最大边际相关性 (MMR) 重排序。可配置的时间衰减偏向近期记忆。 |\n| **任务总结** | 对话自动划分为任务。已完成任务生成结构化 LLM 摘要 —— 目标、关键步骤、结果，以及保留的代码/命令/URL/报错等关键细节。 |\n| **技能演化** | 高质量任务执行被提炼为可复用技能（SKILL.md 格式），相似任务出现时可 **自动升级**。内建版本历史、质量评分和自动安装功能。 |\n| **团队共享** | 可选 Hub–Client 架构：Hub 存储共享数据，Client 本地保留私密数据。支持范围检索（`local` / `group` / `all`）、任务共享、技能发布/拉取、管理员审批和实时通知。 |\n| **Memory Viewer** | 本机 Web 仪表盘（默认 `http://127.0.0.1:18799`），共 7 个页面：记忆、任务、技能、分析、日志、导入、设置 —— 完整增删改查，中英文切换，明暗主题。 |\n| **记忆迁移** | 一键导入 OpenClaw 原生内置记忆（SQLite + JSONL）至 MemOS，具有智能去重与断点续传功能。 |\n| **多嵌入提供商** | 支持 OpenAI 兼容接口、Gemini、Cohere、Voyage、Mistral，或完全离线本地模型（`Xenova/all-MiniLM-L6-v2`）。 |\n\n### 自动钩子 —— 无需手动「记住这句话」\n\n| 钩子 | 触发时机 | 行为 |\n| ---- | -------- | ---- |\n| **`agent_end`** | 每轮结束后 | 消息被分块、嵌入、去重（内容哈希 + LLM 判断）并写入。 |\n| **`before_agent_start`** | 每轮开始前 | 相关记忆注入上下文。若召回偏弱，Agent 会自动用自生成查询调用 `memory_search`。 |\n\n### 可用工具\n\n| 工具 | 作用 |\n| ---- | ---- |\n| `memory_search` | 关键词 + 语义检索记忆（支持范围）。 |\n| `memory_get` / `memory_timeline` | 完整块文本 / 周边对话上下文。 |\n| `memory_write_public` | 写入对所有本地 Agent 可见的共享记忆。 |\n| `task_summary` | 已完成任务的结构化摘要。 |\n| `skill_get` / `skill_search` / `skill_install` | 发现与安装演化出的技能。 |\n| `memory_viewer` | 获取 Memory Viewer 访问地址。 |\n\n还有 Hub–Client 网络工具（`task_share`、`skill_publish`、`network_skill_pull` 等）。完整参考见安装时自动部署的 **`memos-memory-guide`** 技能。\n\n---\n\n## 为何选择 MemOS —— 对比优势\n\n| 痛点 | MemOS 如何解决 |\n| ---- | -------------- |\n| **Agent 跨会话失忆** | 持久化索引记忆 —— 每轮自动采集。 |\n| **上下文浅、反复犯错** | 任务总结 + 技能演化，将原始聊天记录变为结构化、可复用的知识。 |\n| **多 Agent 团队各自为战** | Hub–Client 共享，按范围检索、任务共享与技能发布 —— 私密数据仍留在本地。 |\n| **看不到「它记住了什么」** | Memory Viewer：增删改查、分析、工具调用日志、迁移与在线配置集中于一处。 |\n| **隐私与数据驻留顾虑** | 100% 本地优先 —— SQLite 在你的机器上。外部 API 可选，且仅在 **你** 配置后才使用。 |\n| **系统兼容性** | 支持 macOS、Linux 和 Windows。安装技能自动识别系统并适配。 |\n| **复杂的手动安装** | 一句话 —— *\"安装 memos\"* —— 触发全自主流水线。一个嵌入模型选择问题，零条需要你手动输入的命令。 |\n\nMemOS 是更广泛的 [MemOS 记忆操作系统](../MemOS/README.md) 项目的一部分：面向 LLM 和 AI Agent 的统一存储/检索/管理平台，具有多模态记忆、知识库管理与企业级优化。本 OpenClaw 插件是其 **本地、设备端** 交付形态。\n\n---\n\n## 隐私与安全\n\n- **100% 在设备上** —— 所有数据存于本地 SQLite，零云端上传。\n- **匿名遥测** —— 可通过配置关闭；仅发送工具名称、延迟和版本信息，从不发送记忆内容、查询或个人数据。\n- **Viewer 安全** —— 仅绑定 `127.0.0.1`，密码保护 + 会话 Cookie。\n\n---\n\n## 速查 —— 手动安装命令\n\n多数情况下你只需说 *\"安装 memos\"*，让技能替你完成。如果你更倾向于自己执行：\n\n**macOS / Linux：**\n\n```bash\ncurl -fsSL https://cdn.memtensor.com.cn/memos-local-openclaw/install.sh | bash\n```\n\n**Windows（PowerShell）：**\n\n```powershell\npowershell -c \"irm https://cdn.memtensor.com.cn/memos-local-openclaw/install.ps1 | iex\"\n```\n\n**通过 OpenClaw CLI：**\n\n```bash\nopenclaw plugins install @memtensor/memos-local-openclaw-plugin\n```\n\n然后配置 `~/.openclaw/openclaw.json`、启动网关并打开 Memory Viewer。详细选项、嵌入/总结模型对照表、团队共享与排错见[完整文档](https://memos-claw.openmem.net/docs/)。\n\nFile v1.0.0:skill-card.md\n\n## Description:\n\nInstalls, configures, upgrades, and troubleshoots the MemOS local memory plugin for OpenClaw agents.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[mathematics-yang](https://clawhub.ai/user/mathematics-yang)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and OpenClaw users use this skill to add persistent local memory, semantic retrieval, task summaries, and memory-management tools to an OpenClaw agent. It guides the agent through install, configuration, upgrade, verification, and basic troubleshooting while asking the user only for embedding-model details when needed.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill gives the agent broad authority to install npm packages, modify OpenClaw configuration, restart services, and repair installations automatically.\n\nMitigation: Review the skill and package source before use, run it only in an environment where those changes are acceptable, and inspect configuration changes after installation.\n\nRisk: Fallback installer paths use remote shell scripts.\n\nMitigation: Prefer the OpenClaw CLI or another pinned, verified package source; avoid pipe-to-shell installers unless the script source has been reviewed and trusted.\n\nRisk: The installed plugin stores conversation memory locally and may interact with external embedding APIs if configured.\n\nMitigation: Use local embeddings for sensitive work, store API keys through environment-variable references when possible, and check telemetry, sharing, and memory-capture settings before enabling the plugin.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/mathematics-yang/skills/memos-oneclick-install)\n- [MemOS for OpenClaw Homepage](https://memos-claw.openmem.net)\n- [MemOS for OpenClaw Documentation](https://memos-claw.openmem.net/docs/)\n- [MemOS for OpenClaw Troubleshooting](https://memos-claw.openmem.net/docs/troubleshooting.html)\n- [NPM Package](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown guidance with shell commands and JSON configuration snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces agent-facing installation and troubleshooting steps; the installed plugin may persist local conversation memory.]\n\n## Skill Version(s):\n\n1.0.0 (source: server release metadata and SKILL.md frontmatter)\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.","readmeExcerpt":"Skill: MemOS Plugin One-Click Installer Owner: mathematics-yang Summary: Persistent local memory for OpenClaw agents. Use when users say: - \"install memos\" - \"install MemOS\" - \"setup memory\" - \"add memory plugin\" - \"openclaw memor... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-02T03:34:43.243Z | user Add one-click MemOS install skill for OpenClaw agents - Ship SKILL.md that enables OpenClaw to autonomously i","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"┌──────────────────────────────────────────────────────────────┐\n│                                                              │\n│   ███╗   ███╗███████╗███╗   ███╗ ██████╗ ███████╗            │\n│   ████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝            │\n│   ██╔████╔██║█████╗  ██╔████╔██║██║   ██║███████╗            │\n│   ██║╚██╔╝██║██╔══╝  ██║╚██╔╝██║██║   ██║╚════██║            │\n│   ██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║            │\n│   ╚═╝     ╚═╝╚══════╝╚═╝     ╚═╝ ╚═════╝ ╚══════╝            │\n│                                                              │\n│   persistent local memory for ai agents                      │\n│                                                              │\n└──────────────────────────────────────────────────────────────┘"},{"language":"text","snippet":"node -e \"\nconst fs = require('fs');\nconst path = require('path');\nconst { execSync } = require('child_process');\nconst dir = path.join(require('os').homedir(), '.openclaw', 'extensions', 'memos-local-openclaw-plugin');\nconst pkgPath = path.join(dir, 'package.json');\n\nif (fs.existsSync(pkgPath)) {\n  console.log('ALREADY_INSTALLED');\n  let installed = 'unknown';\n  try { installed = JSON.parse(fs.readFileSync(pkgPath, 'utf8')).version || 'unknown'; } catch(e) {}\n  console.log('INSTALLED_VERSION: ' + installed);\n\n  let latest = 'unknown';\n  try {\n    latest = execSync('npm view @memtensor/memos-local-openclaw-plugin version', { encoding: 'utf8', timeout: 30000 }).trim();\n  } catch(e) {\n    try {\n      latest = execSync('npm view @memtensor/memos-local-openclaw-plugin version --registry https://registry.npmmirror.com', { encoding: 'utf8', timeout: 30000 }).trim();\n    } catch(e2) {}\n  }\n  console.log('LATEST_VERSION: ' + latest);\n\n  if (installed === 'unknown' || latest === 'unknown') {\n    console.log('STATUS: VERSION_CHECK_FAILED');\n  } else if (installed === latest) {\n    console.log('STATUS: UP_TO_DATE');\n  } else {\n    console.log('STATUS: OUTDATED');\n  }\n} else {\n  console.log('NOT_INSTALLED');\n}\n\""},{"language":"text","snippet":"node -e \"process.env.MEMOS_SKIP_SETUP='1';require('child_process').execSync('openclaw plugins update memos-local-openclaw-plugin',{stdio:'inherit'})\""},{"language":"text","snippet":"node -e \"const p=require('path').join(require('os').homedir(),'.openclaw','extensions','memos-local-openclaw-plugin');require('fs').rmSync(p,{recursive:true,force:true});console.log('Removed: '+p)\""},{"language":"text","snippet":"node -e \"require('child_process').execSync('npm rebuild better-sqlite3',{cwd:require('path').join(require('os').homedir(),'.openclaw','extensions','memos-local-openclaw-plugin'),stdio:'inherit'})\""},{"language":"text","snippet":"node -e \"\nconst { execSync } = require('child_process');\nconsole.log('OS: ' + process.platform);\nconsole.log('Node.js: ' + process.version);\ntry {\n  const v = execSync('openclaw --version', { encoding: 'utf8', timeout: 10000 }).trim();\n  console.log('OpenClaw CLI: ' + (v || 'available'));\n} catch(e) {\n  console.log('OpenClaw CLI: NOT_FOUND');\n}\n\""}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: memos-local\nversion: 1.0.0\ndescription: |\n  Persistent local memory for OpenClaw agents.\n\n  Use when users say:\n  - \"install memos\"\n  - \"install MemOS\"\n  - \"setup memory\"\n  - \"add memory plugin\"\n  - \"openclaw memory\"\n  - \"memos onboarding\"\n  - \"memory not working\"\n  - \"configure memory\"\n  - \"enable memory\"\n  - \"upgrade MemOS\"\n  - \"update memory plugin\"\n\nkeywords:\n  - memos\n  - MemOS\n  - memory plugin\n  - persistent memory\n  - local memory\n  - agent memory\n  - install memory\n  - setup memory\n  - upgrade memory\n  - openclaw memory\n  - task summarization\n  - skill evolution\n  - memory viewer\nmetadata:\n  openclaw:\n    emoji: \"\\U0001F9E0\"\n---\n\n```\n┌──────────────────────────────────────────────────────────────┐\n│                                                              │\n│   ███╗   ███╗███████╗███╗   ███╗ ██████╗ ███████╗            │\n│   ████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔════╝            │\n│   ██╔████╔██║█████╗  ██╔████╔██║██║   ██║███████╗            │\n│   ██║╚██╔╝██║██╔══╝  ██║╚██╔╝██║██║   ██║╚════██║            │\n│   ██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝███████║            │\n│   ╚═╝     ╚═╝╚══════╝╚═╝     ╚═╝ ╚═════╝ ╚══════╝            │\n│                                                              │\n│   persistent local memory for ai agents                      │\n│                                                              │\n└──────────────────────────────────────────────────────────────┘\n```\n\n# MemOS\n\nMemOS gives OpenClaw persistent local memory — every conversation is automatically captured, semantically indexed, and instantly recallable. 100% on-device, zero cloud uploads.\n\nKey capabilities beyond basic memory:\n\n- **Task summarization** — Conversations are organized into structured tasks with LLM-generated summaries\n- **Skill evolution** — Successful executions are distilled into reusable skills that auto-upgrade\n- **Team sharing** — Hub-Client architecture for multi-agent collaborative memory\n- **Memory Viewer** — Full web UI for managing memories, tasks, and skills\n\nWhen talking to end users:\n\n- MemOS stores everything locally — no API keys, no cloud accounts, no registration\n- All data lives in `~/.openclaw/memos-local/memos.db` (SQLite)\n- The Memory Viewer at `http://127.0.0.1:18799` lets users browse and manage everything visually\n- Embedding defaults to a local offline model — no external API required to get started\n\n---\n\n## Trigger phrases\n\nUse this skill when the user expresses intent to install, configure, or troubleshoot MemOS memory.\n\nCommon triggers include:\n\n- \"install memos\" / \"install MemOS\" / \"add memory plugin\"\n- \"setup memory\" / \"enable memory\"\n- \"memory not working\" / \"memories lost\" / \"memory plugin error\"\n- \"configure embedding\" / \"configure summarizer\"\n- \"upgrade MemOS\" / \"update memory plugin\"\n- \"what did I say last time?\" (if MemOS is not yet installed — suggest installation)\n\nNote: Once MemOS is installed, everyday memory operations (search, recall, write) are handled by the bundled `memos-"},{"path":"README.md","content":"# MemOS for OpenClaw — One-Click Install\n\n> Chinese version: [README_zh.md](./README_zh.md).\n\n[![npm version](https://img.shields.io/npm/v/@memtensor/memos-local-openclaw-plugin)](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/MemTensor/MemOS/blob/main/LICENSE)\n[![Node.js >= 18](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org/)\n[![GitHub](https://img.shields.io/badge/GitHub-Source-181717?logo=github)](https://github.com/MemTensor/MemOS/tree/main/apps/memos-local-openclaw)\n\n> [Homepage](https://memos-claw.openmem.net) · [Documentation](https://memos-claw.openmem.net/docs/) · [NPM](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin) · [Troubleshooting](https://memos-claw.openmem.net/docs/troubleshooting.html)\n\n---\n\n## What this folder contains\n\n| File | Purpose |\n| ---- | ------- |\n| **`SKILL.md`** | The agent skill that drives one-click installation. Once loaded, OpenClaw reads this file and **autonomously** installs, configures, and verifies the MemOS plugin — you just answer one question. |\n| **`README.md`** | This file — a human-readable overview of the installation experience and MemOS's features. |\n\n---\n\n## True one-click: let OpenClaw do the work\n\nThe **`SKILL.md`** in this folder is not a manual — it is a **machine-readable installation skill** designed for the OpenClaw agent. When you say *\"install memos\"* or *\"install MemOS\"*, here is what happens:\n\n### Zero manual steps\n\nOnce triggered, OpenClaw executes a **6-step autonomous pipeline** — detecting your current state, installing the plugin, writing configuration, restarting the gateway, verifying the result, and delivering a final summary. **You do not need to run any command yourself.**\n\nThe only interaction during the entire process is a single question:\n\n> *Choose your embedding model — local offline (A) or external API (B)?*\n\nReply `A` or `B`, and OpenClaw handles the rest. If you are upgrading an existing installation, even this question is skipped — the process is fully hands-free.\n\n### Automatic OS detection — macOS, Linux, and Windows\n\nYou never need to tell the agent what system you are running. The skill uses **`process.platform`** (`darwin` / `linux` / `win32`) to detect your OS and adapts every command accordingly:\n\n| Aspect | How it adapts |\n| ------ | ------------- |\n| **Path separators & home directory** | All paths are built with `require('path').join(...)` and `require('os').homedir()` — works identically on every OS. |\n| **Shell commands** | The primary approach is `node -e \"...\"`, which runs the same way in bash, PowerShell, and cmd. Platform-specific fallbacks (e.g. `nohup` on macOS/Linux, `Start-Process` on Windows) are used only when inherently necessary. |\n| **Install script fallback** | If the OpenClaw CLI is unavailable, the agent picks `install.sh` (macOS/Linux) or `install.ps1` (Windows) automatically — n"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7122re74m5mqwg06nsnn2nwh8418kf\",\n  \"slug\": \"memos-oneclick-install\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1775100883243\n}"},{"path":"README_zh.md","content":"# MemOS for OpenClaw — 一键安装\n\n> English version: [README.md](./README.md).\n\n[![npm version](https://img.shields.io/npm/v/@memtensor/memos-local-openclaw-plugin)](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/MemTensor/MemOS/blob/main/LICENSE)\n[![Node.js >= 18](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org/)\n[![GitHub](https://img.shields.io/badge/GitHub-Source-181717?logo=github)](https://github.com/MemTensor/MemOS/tree/main/apps/memos-local-openclaw)\n\n> [主页](https://memos-claw.openmem.net) · [文档](https://memos-claw.openmem.net/docs/) · [NPM](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin) · [故障排除](https://memos-claw.openmem.net/docs/troubleshooting.html)\n\n---\n\n## 本目录包含\n\n| 文件 | 用途 |\n| ---- | ---- |\n| **`SKILL.md`** | 驱动一键安装的 Agent 技能。加载后，OpenClaw 读取此文件并 **自主** 完成 MemOS 插件的安装、配置与验证 —— 你只需回答一个问题。 |\n| **`README.md` / 本文件** | 面向人类的总览：安装体验说明与 MemOS 功能介绍。 |\n\n---\n\n## 真正的一键安装：让 OpenClaw 替你完成\n\n本目录中的 **`SKILL.md`** 不是一份手册 —— 它是一份 **机器可读的安装技能**，专为 OpenClaw Agent 设计。当你对 Agent 说出 *\"安装 memos\"* 或 *\"install MemOS\"*，以下流程会自动发生：\n\n### 零手动操作\n\n触发后，OpenClaw 执行一条 **6 步全自主流水线** —— 检测当前状态、安装插件、写入配置、重启网关、验证结果、交付最终总结。**你不需要自己执行任何命令。**\n\n整个过程中唯一的交互只有一个问题：\n\n> *选择嵌入模型 —— 本地离线模型 (A) 还是外部 API (B)？*\n\n回复 `A` 或 `B`，其余一切由 OpenClaw 处理。如果是升级现有安装，连这个问题也会跳过 —— 全程无需干预。\n\n### 自动识别操作系统 —— macOS、Linux、Windows 全适配\n\n你无需告诉 Agent 你在用什么系统。技能通过 **`process.platform`**（`darwin` / `linux` / `win32`）自动检测操作系统，并据此调整每一条命令：\n\n| 方面 | 如何适配 |\n| ---- | -------- |\n| **路径分隔符与主目录** | 所有路径通过 `require('path').join(...)` 和 `require('os').homedir()` 构建 —— 在每个系统上表现一致。 |\n| **Shell 命令** | 主要方式为 `node -e \"...\"`，在 bash、PowerShell 和 cmd 中行为相同。仅在固有平台差异处（如 macOS/Linux 的 `nohup`、Windows 的 `Start-Process`）使用特定回退方案。 |\n| **安装脚本回退** | 若 OpenClaw CLI 不可用，Agent 会根据系统自动选择 `install.sh`（macOS/Linux）或 `install.ps1`（Windows）—— 无需用户决定。 |\n| **原生模块重编译** | `better-sqlite3` 会自动重编译以匹配本地 Node.js 版本；构建工具指引也是平台感知的（`xcode-select` / `apt install build-essential` / Visual Studio Build Tools）。 |\n\n**一句话：** 无论你是用 Mac、Linux 服务器还是 Windows 工作站，说一声 *\"安装 memos\"*，然后坐等即可。\n\n### 智能状态检测\n\n技能不会盲目重装。在动手之前它会先检查：\n\n- **未安装** —— 执行完整安装流水线（Steps 0 – 6）。\n- **已安装但版本过旧** —— 自动升级，保留你现有的配置。\n- **已是最新版本** —— 仅做快速验证；除非发现问题，否则不重启。\n- **配置不完整或损坏** —— 自动修复，无需重新下载插件。\n\n每个分支都由 Agent 自主判断。你永远不会被问到 *\"你想做什么？\"*。\n\n---\n\n## MemOS 带给你什么\n\n安装完成后，MemOS 插件将 OpenClaw 变为一个 **具有记忆能力的 Agent** —— 100% 在本地设备上运行，默认使用本地嵌入模型时无需云端账号。\n\n### 核心能力\n\n| 能力 | 说明 |\n| ---- | ---- |\n| **持久记忆** | 每一轮对话自动采集、语义分块、嵌入并索引到本地 SQLite 数据库（`~/.openclaw/memos-local/memos.db`）。无需手动说\"记住这个\"。 |\n| **混合检索** | FTS5 关键词搜索 + 向量语义搜索，通过倒数排名融合 (RRF) 与最大边际相关性 (MMR) 重排序。可配置的时间衰减偏向近期记忆。 |\n| **任务总结** | 对话自动划分为任务。已完成任务生成结构化 LLM 摘要 —— 目标、关键步骤、结果，以及保留的代码/命令/URL/报错等关键细节。 |\n| **技能演化** | 高质量任务执行被提炼为可复用技能（SKILL.md 格式），相似任务出现时可 **自动升级**。内建版本历史、质量评分和自动安装功能。 |\n| **团队共享** | 可选 Hub–Client 架构：Hub 存储共享数据，Client 本地保留私密数据。支持范围检索（`local` / `group` / `all`）、任务共享、技能发布/拉取、管理员审批和实时通知。 |\n| **Memory View"},{"path":"skill-card.md","content":"## Description:\n\nInstalls, configures, upgrades, and troubleshoots the MemOS local memory plugin for OpenClaw agents.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[mathematics-yang](https://clawhub.ai/user/mathematics-yang)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and OpenClaw users use this skill to add persistent local memory, semantic retrieval, task summaries, and memory-management tools to an OpenClaw agent. It guides the agent through install, configuration, upgrade, verification, and basic troubleshooting while asking the user only for embedding-model details when needed.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill gives the agent broad authority to install npm packages, modify OpenClaw configuration, restart services, and repair installations automatically.\n\nMitigation: Review the skill and package source before use, run it only in an environment where those changes are acceptable, and inspect configuration changes after installation.\n\nRisk: Fallback installer paths use remote shell scripts.\n\nMitigation: Prefer the OpenClaw CLI or another pinned, verified package source; avoid pipe-to-shell installers unless the script source has been reviewed and trusted.\n\nRisk: The installed plugin stores conversation memory locally and may interact with external embedding APIs if configured.\n\nMitigation: Use local embeddings for sensitive work, store API keys through environment-variable references when possible, and check telemetry, sharing, and memory-capture settings before enabling the plugin.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/mathematics-yang/skills/memos-oneclick-install)\n- [MemOS for OpenClaw Homepage](https://memos-claw.openmem.net)\n- [MemOS for OpenClaw Documentation](https://memos-claw.openmem.net/docs/)\n- [MemOS for OpenClaw Troubleshooting](https://memos-claw.openmem.net/docs/troubleshooting.html)\n- [NPM Package](https://www.npmjs.com/package/@memtensor/memos-local-openclaw-plugin)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown guidance with shell commands and JSON configuration snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces agent-facing installation and troubleshooting steps; the installed plugin may persist local conversation memory.]\n\n## Skill Version(s):\n\n1.0.0 (source: server release metadata and SKILL.md frontmatter)\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":"Persistent local memory for OpenClaw agents. Use when users say: - \"install memos\" - \"install MemOS\" - \"setup memory\" - \"add memory plugin\" - \"openclaw memor... Skill: MemOS Plugin One-Click Installer Owner: mathematics-yang Summary: Persistent local memory for OpenClaw agents. Use when users say: - \"install memos\" - \"install MemOS\" - \"setup memory\" - \"add memory plugin\" - \"openclaw memor... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-04-02T03:34:43.243Z | user Add one-click MemOS install skill for OpenClaw agents - Ship SKILL.md that enables OpenClaw to autonomously i","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1556,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T14:33:13.768Z","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-09T14:33:13.768Z","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-09T20:21:34.244Z","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"}]}}}