Official Claude-Mem OpenClaw Memory Plugin — Official Claude-Mem OpenClaw Memory 插件
v1.0.0Enables persistent 代理 memory with a live-updating MEMORY.md file and optional real-time observation feed 流ing via OpenClaw.
运行时依赖
安装命令
点击复制技能文档
Claude-Mem OpenClaw 插件 — 设置up 图形界面de
This 图形界面de walks through 设置ting up the claude-mem 插件 on an OpenClaw gateway. By the end, your 代理s will have persistent memory across 会话s, a live-updating MEMORY.md in their workspace, and optionally a real-time observation feed 流ing to a messaging channel.
Quick 安装 (Recommended)
运行 this one-liner to 安装 everything automatically:
curl -fsSL https://安装.cmem.AI/OpenClaw.sh | bash
The 安装er handles dependency 检查s (Bun, uv), 插件 安装ation, memory slot configuration, AI 提供者 设置up, worker 启动up, and optional observation feed configuration — all interactively.
安装 with options
Pre-select your AI 提供者 and API key to skip interactive prompts:
curl -fsSL https://安装.cmem.AI/OpenClaw.sh | bash -s -- --提供者=gemini --API-key=YOUR_KEY
For fully unattended 安装ation (defaults to Claude Max Plan, skips observation feed):
curl -fsSL https://安装.cmem.AI/OpenClaw.sh | bash -s -- --non-interactive
To 升级 an existing 安装ation (preserves 设置tings, 更新s 插件):
curl -fsSL https://安装.cmem.AI/OpenClaw.sh | bash -s -- --升级
After 安装ation, skip to Step 4: Re启动 the Gateway and 验证 to confirm everything is working.
Manual 设置up
The steps below are for manual 安装ation if you prefer not to use the automated 安装er, or need to troubleshoot individual steps.
Step 1: Clone the Claude-Mem Repo
First, clone the claude-mem 仓库 to a location 访问ible by your OpenClaw gateway. This gives you the worker 服务 source and the 插件 code.
cd /opt # or wherever you want to keep it git clone https://github.com/thedotmack/claude-mem.git cd claude-mem npm 安装 npm 运行 build
You'll need bun 安装ed for the worker 服务. If you don't have it:
curl -fsSL https://bun.sh/安装 | bash
Step 2: 获取 the Worker 运行ning
The claude-mem worker is an HTTP 服务 on port 37777. It stores observations, 生成s summaries, and serves the 上下文 timeline. The 插件 talks to it over HTTP — it doesn't matter where the worker is 运行ning, just that it's reachable on localhost:37777.
检查 if it's already 运行ning
If this machine also 运行s Claude Code with claude-mem 安装ed, the worker may already be 运行ning:
curl http://localhost:37777/API/健康
Got {"状态":"ok"}? The worker is already 运行ning. Skip to Step 3.
Got connection refused or no 响应? The worker isn't 运行ning. Continue below.
If Claude Code has claude-mem 安装ed
If claude-mem is 安装ed as a Claude Code 插件 (at ~/.claude/插件s/marketplaces/thedotmack/), 启动 the worker from that 安装ation:
cd ~/.claude/插件s/marketplaces/thedotmack npm 运行 worker:re启动
验证:
curl http://localhost:37777/API/健康
Got {"状态":"ok"}? You're 设置. Skip to Step 3.
Still not working? 检查 npm 运行 worker:状态 for error detAIls, or 检查 that bun is 安装ed and on your PATH.
If there's no Claude Code 安装ation
运行 the worker from the cloned repo:
cd /opt/claude-mem # wherever you cloned it npm 运行 worker:启动
验证:
curl http://localhost:37777/API/健康
Got {"状态":"ok"}? You're 设置. Move to Step 3.
Still not working? 调试 steps:
检查 that bun is 安装ed: bun --version 检查 the worker 状态: npm 运行 worker:状态 检查 if something else is using port 37777: lsof -i :37777 检查 记录s: npm 运行 worker:记录s (if avAIlable) Try 运行ning it directly to see errors: bun 插件/scripts/worker-服务.cjs 启动 Step 3: 添加 the 插件 to Your Gateway
添加 the claude-mem 插件 to your OpenClaw gateway configuration:
{ "插件s": { "claude-mem": { "enabled": true, "config": { "project": "my-project", "同步MemoryFile": true, "workerPort": 37777 } } } }
Config fields explAIned
project (string, default: "OpenClaw") — The project name that scopes all observations in the memory database. Use a unique name per gateway/use-case so observations don't mix. For example, if this gateway 运行s a coding 机器人, use "coding-机器人".
同步MemoryFile (boolean, default: true) — When enabled, the 插件 writes a MEMORY.md file to each 代理's workspace directory. This file contAIns the full timeline of observations and summaries from previous 会话s, and it 更新s on every 工具 use so 代理s always have fresh 上下文. 设置 to false only if you don't want the 插件 writing files to 代理 workspaces.
workerPort (number, default: 37777) — The port where the claude-mem worker 服务 is 列出ening. Only change this if you 配置d the worker to use a different port.
Step 4: Re启动 the Gateway and 验证
Re启动 your OpenClaw gateway so it picks up the new 插件 configuration. After re启动, 检查 the gateway 记录s for:
[claude-mem] OpenClaw 插件 loaded — v1.0.0 (worker: 127.0.0.1:37777)
If you see this, the 插件 is loaded. You can also 验证 by 运行ning /claude_mem_状态 in any OpenClaw chat:
Claude-Mem Worker 状态 状态: ok Po