From bf5748bd3cf4002cbb9d579bc875756e9cf4a104 Mon Sep 17 00:00:00 2001 From: Teingi Date: Tue, 24 Mar 2026 14:14:10 +0800 Subject: [PATCH 1/2] chore(skills): rename install skills, drop INSTALL.md - Rename install-powermem-memory -> install-powermem-memory-full (full guide) - Rename install-powermem-memory-minimal -> install-powermem-memory (quickstart) - Update skill names, README/INSTALL references, and copy instructions - Remove INSTALL.md; fold one-click, multi-instance, openclaw.json examples into full skill + config-reference - Point install.sh Windows error to README / full skill Made-with: Cursor --- INSTALL.md | 205 --------------- README.md | 12 +- README_CN.md | 12 +- install.sh | 2 +- skills/install-powermem-memory-full/SKILL.md | 237 ++++++++++++++++++ .../config-reference.md | 50 +++- .../powermem-intro.md | 2 +- .../install-powermem-memory-minimal/SKILL.md | 97 ------- skills/install-powermem-memory/SKILL.md | 196 ++++++--------- 9 files changed, 373 insertions(+), 440 deletions(-) delete mode 100644 INSTALL.md create mode 100644 skills/install-powermem-memory-full/SKILL.md rename skills/{install-powermem-memory => install-powermem-memory-full}/config-reference.md (65%) rename skills/{install-powermem-memory => install-powermem-memory-full}/powermem-intro.md (94%) delete mode 100644 skills/install-powermem-memory-minimal/SKILL.md diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index f08cdfd..0000000 --- a/INSTALL.md +++ /dev/null @@ -1,205 +0,0 @@ -# Install PowerMem Memory for OpenClaw - -Give [OpenClaw](https://github.com/openclaw/openclaw) long-term memory via [PowerMem](https://github.com/oceanbase/powermem): intelligent extraction, Ebbinghaus forgetting curve. After setup, OpenClaw can **remember** facts from conversations and **recall** relevant context before responding. - ---- - -## One-Click Install (Linux / macOS) - -**Prerequisites:** OpenClaw installed (`openclaw --version`). - -**Default path:** The script configures **CLI mode** (no `powermem-server`). With current plugin defaults you **do not need** `powermem.env`: the plugin injects **SQLite** under your OpenClaw state directory and **LLM/embedding** from OpenClaw `agents.defaults.model` + provider keys (same as the gateway). The script may still create `~/.openclaw/powermem/powermem.env` as an optional override template. You still need `pip install powermem` and `pmem` on PATH (or `pmemPath`). - -```bash -curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash -``` - -Or run from the repo root (no download): - -```bash -cd /path/to/memory-powermem -bash install.sh -``` - -Non-interactive (defaults: **CLI** mode, env file `~/.openclaw/powermem/powermem.env`, SQLite template if new): - -```bash -curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash -s -y -``` - -Install to a specific OpenClaw instance: - -```bash -curl -fsSL ... | bash -s -- --workdir ~/.openclaw-second -``` - -The script will: 1) resolve OpenClaw workdir, 2) ask mode (**cli** / http) and paths, 3) for CLI, seed `powermem.env` if absent, 4) deploy the plugin into `/extensions/memory-powermem`, 5) run `npm install` there, 6) set OpenClaw config (plugins.enabled, slots.memory, entries.memory-powermem). - -**After running (CLI):** Ensure `pmem` is on PATH (or set `pmemPath`), then `openclaw gateway` and `openclaw ltm health`. With plugin defaults you normally **do not** need to edit `powermem.env`—LLM keys come from OpenClaw. Optional template file may still be created under `~/.openclaw/powermem/`. - -**After running (HTTP / enterprise):** Start PowerMem in a directory with `.env`, then `openclaw gateway`. - ---- - -## Quick Start (Let OpenClaw Install It) - -Copy **one** skill you want into OpenClaw’s skills directory, then ask OpenClaw to follow it. The two skills below are **independent** (each is complete for its scope; neither references the other). - -### OpenClaw skill — minimal install (`install-powermem-memory-minimal`) - -Short steps, no `powermem.env` required. - -**Linux / macOS:** - -```bash -mkdir -p ~/.openclaw/skills/install-powermem-memory-minimal -cp /path/to/memory-powermem/skills/install-powermem-memory-minimal/SKILL.md \ - ~/.openclaw/skills/install-powermem-memory-minimal/ -``` - -Then say e.g. **「PowerMem 快速安装」** / **“PowerMem quickstart”** or **「memory-powermem 最小安装」** / **“Minimal install memory-powermem”** / **“Install powermem memory minimal”**. - -### OpenClaw skill — full guide (`install-powermem-memory`) - -Install, configuration options, tools, and troubleshooting (includes bundled reference docs in the skill folder). - -**Linux / macOS:** - -```bash -mkdir -p ~/.openclaw/skills/install-powermem-memory -cp /path/to/memory-powermem/skills/install-powermem-memory/SKILL.md \ - ~/.openclaw/skills/install-powermem-memory/ -``` - -**Windows (PowerShell):** - -```powershell -New-Item -ItemType Directory -Force "$env:USERPROFILE\.openclaw\skills\install-powermem-memory" -Copy-Item "path\to\memory-powermem\skills\install-powermem-memory\SKILL.md" ` - "$env:USERPROFILE\.openclaw\skills\install-powermem-memory\" -``` - -Then say **「安装 PowerMem 记忆」** or **“Install PowerMem memory”**. - -For manual installation, continue below. - ---- - -## Prerequisites - -| Component | Purpose | -|-------------|---------| -| **OpenClaw** | CLI + gateway; run `openclaw --version` and `openclaw onboard` if needed. | -| **PowerMem** | **CLI (recommended):** `pip install powermem`, `pmem` on PATH, `.env` at `~/.openclaw/powermem/powermem.env` (install script can create a template). **HTTP:** run `powermem-server` and set plugin `mode: http` + `baseUrl`. | - -You do **not** install PowerMem inside OpenClaw; the plugin runs `pmem` subprocesses (CLI) or calls a HTTP API (server). - ---- - -## Manual Installation Steps - -### 1. Install PowerMem (CLI first) - -```bash -python3 -m venv ~/.openclaw/powermem/.venv -source ~/.openclaw/powermem/.venv/bin/activate -pip install powermem -``` - -Create or edit `~/.openclaw/powermem/powermem.env` (see [PowerMem .env.example](https://github.com/oceanbase/powermem/blob/master/.env.example)). Minimal fields: `DATABASE_PROVIDER=sqlite`, `SQLITE_PATH` (absolute path recommended), `LLM_*`, `EMBEDDING_*`. - -Verify: `pmem --version` (with venv activated). - -**(Optional) HTTP mode:** install PowerMem, put `.env` in a working directory, run `powermem-server --host 0.0.0.0 --port 8000`, verify `curl -s http://localhost:8000/api/v1/system/health`. - -### 2. Install the plugin into OpenClaw - -```bash -openclaw plugins install /path/to/memory-powermem -# Or symlink for development: -openclaw plugins install -l /path/to/memory-powermem -``` - -Confirm: `openclaw plugins list` shows `memory-powermem`. - -### 3. Configure OpenClaw - -Edit `~/.openclaw/openclaw.json` (or set via `openclaw config set`). - -**CLI mode (default, no server):** - -```json -{ - "plugins": { - "enabled": true, - "slots": { "memory": "memory-powermem" }, - "entries": { - "memory-powermem": { - "enabled": true, - "config": { - "mode": "cli", - "envFile": "/home/you/.openclaw/powermem/powermem.env", - "pmemPath": "pmem", - "autoCapture": true, - "autoRecall": true, - "inferOnAdd": true - } - } - } - } -} -``` - -Use your real home path for `envFile`. If `pmem` is only inside a venv, set `pmemPath` to the absolute path of the `pmem` binary. - -**HTTP mode (shared / enterprise):** - -```json -"config": { - "mode": "http", - "baseUrl": "http://localhost:8000", - "autoCapture": true, - "autoRecall": true, - "inferOnAdd": true -} -``` - -If you omit `mode` but set a non-empty `baseUrl`, the plugin treats the backend as **http** (backward compatible). - -### 4. Restart and verify - -Restart the OpenClaw gateway (or app), then: - -```bash -openclaw ltm health -openclaw ltm add "I prefer Americano in the morning" -openclaw ltm search "coffee" -``` - -If health is OK and search returns the memory, setup is complete. - ---- - -## Multi-Instance (--workdir) - -To target a different OpenClaw instance: - -```bash -# Install script -curl -fsSL ... | bash -s -- --workdir ~/.openclaw-second - -# Manual config -OPENCLAW_STATE_DIR=~/.openclaw-second openclaw config set plugins.slots.memory memory-powermem -``` - ---- - -## Troubleshooting - -| Symptom | Fix | -|--------|-----| -| `openclaw ltm health` fails | **CLI:** `pmem` not on PATH or wrong `pmemPath`; fix `.env` keys. **HTTP:** server down or wrong `baseUrl`. | -| Plugin not loaded | Ensure `plugins.slots.memory` is `memory-powermem` and gateway restarted. | -| Add/search returns 500 or empty | Check PowerMem logs; usually missing `LLM_*` / `EMBEDDING_*` in `.env`. | - -More: [README.md#troubleshooting](README.md#troubleshooting). diff --git a/README.md b/README.md index a9e90a3..6830641 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ No HTTP server. Matches the plugin’s **default** (`mode: cli`). pip install powermem ``` -2. **Config** — Use [INSTALL.md](INSTALL.md) one-liner `install.sh` to create `~/.openclaw/powermem/powermem.env` (SQLite template), or copy from PowerMem’s `.env.example`. Set `LLM_*` and `EMBEDDING_*`. +2. **Config** — From a clone of this repo, run `bash install.sh` (or the curl one-liner under **Install options** below) to create an optional `~/.openclaw/powermem/powermem.env` template, or copy from PowerMem’s `.env.example`. Set `LLM_*` and `EMBEDDING_*` when not relying on OpenClaw-injected models. 3. If `pmem` exists only inside the venv, set `pmemPath` in the plugin `config` to the absolute path of `pmem` in that venv. @@ -157,9 +157,13 @@ JSON response means the server is up. API docs: `http://localhost:8000/docs`. ## Install options -- **One-click (Linux/macOS):** See [INSTALL.md](INSTALL.md) for `install.sh` (curl or run from repo root). -- **OpenClaw skill (minimal install):** Copy [skills/install-powermem-memory-minimal/SKILL.md](skills/install-powermem-memory-minimal/SKILL.md) to `~/.openclaw/skills/install-powermem-memory-minimal/`, then say **「PowerMem 快速安装」** / **“PowerMem quickstart”** or **“Minimal install memory-powermem”** / **“Install powermem memory minimal”**. -- **OpenClaw skill (full guide):** Copy [skills/install-powermem-memory/SKILL.md](skills/install-powermem-memory/SKILL.md) (and its sibling `.md` files in that folder if you mirror the repo) to `~/.openclaw/skills/install-powermem-memory/`, then say **「安装 PowerMem 记忆」** / **“Install PowerMem memory”**. The minimal and full skills are **independent**; use whichever fits your workflow. +- **One-click (Linux/macOS):** + ```bash + curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash + ``` + From a clone: `cd /path/to/memory-powermem && bash install.sh`. Non-interactive: same URL but pipe to `bash -s -y`. Another OpenClaw instance: `bash -s -- --workdir ~/.openclaw-second`. Details and troubleshooting: OpenClaw skill **`install-powermem-memory-full`** ([skills/install-powermem-memory-full/](skills/install-powermem-memory-full/)). +- **OpenClaw skill — quickstart (`install-powermem-memory`):** Copy [skills/install-powermem-memory/SKILL.md](skills/install-powermem-memory/SKILL.md) to `~/.openclaw/skills/install-powermem-memory/`, then say **「PowerMem 快速安装」** / **“PowerMem quickstart”** or **“Minimal install memory-powermem”** / **“Install powermem memory minimal”**. +- **OpenClaw skill — full guide (`install-powermem-memory-full`):** Copy [skills/install-powermem-memory-full/SKILL.md](skills/install-powermem-memory-full/SKILL.md) (and its sibling `.md` files in that folder if you mirror the repo) to `~/.openclaw/skills/install-powermem-memory-full/`, then say **「安装 PowerMem 记忆」** / **“Install PowerMem memory”**. The quickstart and full-guide skills are **independent**; use whichever fits your workflow. - **Manual:** Steps below. --- diff --git a/README_CN.md b/README_CN.md index 0bb1203..21eb193 100644 --- a/README_CN.md +++ b/README_CN.md @@ -40,7 +40,7 @@ pip install powermem ``` -2. 配置:用 [INSTALL.md](INSTALL.md) 里的一键 `install.sh` 生成 `~/.openclaw/powermem/powermem.env`(SQLite 模板),或复制 PowerMem 官方 `.env.example`,填写 `LLM_*`、`EMBEDDING_*`。 +2. 配置:克隆本仓库后在根目录执行 `bash install.sh`(或使用下方「安装方式」里的 curl 一键命令)可生成可选的 `~/.openclaw/powermem/powermem.env` 模板;也可复制 PowerMem 官方 `.env.example` 并填写 `LLM_*`、`EMBEDDING_*`(不依赖 OpenClaw 注入模型时需要)。 3. 若 `pmem` 只在 venv 里,在插件 `config` 里把 `pmemPath` 设为该 venv 下 `pmem` 的绝对路径。 @@ -158,9 +158,13 @@ curl -s http://localhost:8000/api/v1/system/health ## 安装方式 -- **一键安装(Linux/macOS):** 见 [INSTALL.md](INSTALL.md),使用 `install.sh`(curl 或从仓库根目录执行)。 -- **OpenClaw skill(最小安装):** 将 [skills/install-powermem-memory-minimal/SKILL.md](skills/install-powermem-memory-minimal/SKILL.md) 复制到 `~/.openclaw/skills/install-powermem-memory-minimal/`,然后说「**PowerMem 快速安装**」或「**memory-powermem 最小安装**」或 **“Install powermem memory minimal”**。 -- **OpenClaw skill(完整指南):** 将 [skills/install-powermem-memory/SKILL.md](skills/install-powermem-memory/SKILL.md)(若从仓库拷贝,建议连同该目录下其余 `.md` 一并放入 skill 目录)复制到 `~/.openclaw/skills/install-powermem-memory/`,然后说「**安装 PowerMem 记忆**」。最小安装与完整指南两个 skill **彼此独立**,按需选用其一即可。 +- **一键安装(Linux/macOS):** + ```bash + curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash + ``` + 已克隆仓库:`cd /path/to/memory-powermem && bash install.sh`。非交互:同一 curl 命令改为接到 `bash -s -y`。指定另一数据目录:`bash -s -- --workdir ~/.openclaw-second`。更完整的说明与排错见 OpenClaw skill **`install-powermem-memory-full`**([skills/install-powermem-memory-full/](skills/install-powermem-memory-full/))。 +- **OpenClaw skill — 快速安装(`install-powermem-memory`):** 将 [skills/install-powermem-memory/SKILL.md](skills/install-powermem-memory/SKILL.md) 复制到 `~/.openclaw/skills/install-powermem-memory/`,然后说「**PowerMem 快速安装**」或「**memory-powermem 最小安装**」或 **“Install powermem memory minimal”**。 +- **OpenClaw skill — 完整指南(`install-powermem-memory-full`):** 将 [skills/install-powermem-memory-full/SKILL.md](skills/install-powermem-memory-full/SKILL.md)(若从仓库拷贝,建议连同该目录下其余 `.md` 一并放入 skill 目录)复制到 `~/.openclaw/skills/install-powermem-memory-full/`,然后说「**安装 PowerMem 记忆**」。快速安装与完整指南两个 skill **彼此独立**,按需选用其一即可。 - **手动安装:** 按下面步骤操作。 --- diff --git a/install.sh b/install.sh index 7841087..e985b4f 100644 --- a/install.sh +++ b/install.sh @@ -83,7 +83,7 @@ case "$(uname -s)" in *) OS="unknown";; esac if [[ "$OS" == "windows" ]]; then - err "Windows is not supported by this script. Use manual install (see INSTALL.md)." + err "Windows is not supported by this script. Use README.md or skills/install-powermem-memory-full for manual steps." exit 1 fi diff --git a/skills/install-powermem-memory-full/SKILL.md b/skills/install-powermem-memory-full/SKILL.md new file mode 100644 index 0000000..ed61e21 --- /dev/null +++ b/skills/install-powermem-memory-full/SKILL.md @@ -0,0 +1,237 @@ +--- +name: install-powermem-memory-full +description: OpenClaw full guide skill (id and folder name install-powermem-memory-full). Step-by-step install and configuration for the PowerMem long-term memory plugin—options, tools, troubleshooting—and bundled reference docs. Complements the quickstart skill install-powermem-memory; either can be used alone. +triggers: + - "安装 PowerMem 记忆" + - "安装 PowerMem 记忆插件" + - "Install PowerMem memory" + - "Install PowerMem memory plugin" + - "配置 PowerMem 记忆" + - "Configure PowerMem memory" + - "PowerMem 是什么" + - "什么是 PowerMem" + - "What is PowerMem" +--- + +# PowerMem Memory — Full Guide + +**Skill id / OpenClaw folder name:** `install-powermem-memory-full`. For the shortest install-only path, use **`install-powermem-memory`** (quickstart). + +This skill folder includes supplementary docs: + +- **powermem-intro.md** — What PowerMem is, features, vs file-based memory. +- **config-reference.md** — Config keys, state dir, commands. + +## How It Works + +- **Auto-Capture**: After a conversation, the plugin sends valuable user/assistant text to PowerMem (optional infer / intelligent extraction). +- **Auto-Recall**: Before each turn, it searches memories and can inject a `` block into context. + +## When User Asks to Install + +**Recommended order (TO C):** (1) OpenClaw installed and **default model + provider auth** configured. (2) **Python 3.10+ verified** (`python3 --version`) *before* venv / `pip install`. (3) `pip install powermem` and `pmem` available to the gateway (PATH or `pmemPath`). (4) Install the **memory-powermem** plugin. **No `powermem.env` is required** for the default path. + +The curl **`install.sh`** deploys the plugin and OpenClaw entries; with **`-y`** it may still create **`~/.openclaw/powermem/powermem.env`** as an *optional* template—it does **not** run `pip install powermem`. That file is **not** required if the user relies on **OpenClaw-injected** LLM + default SQLite. + +1. **Check OpenClaw** + `openclaw --version`. If missing: `npm install -g openclaw`, `openclaw onboard`. + Ensure **`agents.defaults.model`** is set (e.g. `openai/gpt-4o-mini`) and the corresponding **provider / API key** works for normal chat—the plugin reuses that for PowerMem when **`useOpenClawModel`** is true (default). + +2. **Check Python (required before venv / pip)** + PowerMem needs **Python 3.10 or newer**. Run **`python3 --version`** first; the minor version must be **≥ 10** (e.g. 3.10.x, 3.12.x). Optional strict check: + ```bash + python3 -c "import sys; assert sys.version_info >= (3, 10), 'Need Python 3.10+'; print(sys.version.split()[0], 'OK')" + ``` + If it fails: upgrade Python or use a specific binary (e.g. `python3.12`) for all commands below instead of `python3`. + +3. **Install PowerMem (CLI — default)** + - Venv recommended: e.g. `python3 -m venv ~/.openclaw/powermem/.venv && source ~/.openclaw/powermem/.venv/bin/activate`. + - `pip install powermem`. + - **Defaults:** Plugin injects **SQLite** at `/powermem/data/powermem.db` and **LLM + embedding** env vars derived from OpenClaw. Typical `stateDir` is `~/.openclaw` unless the user uses another instance (`OPENCLAW_STATE_DIR`, `--workdir`). + - **Optional `envFile`:** Path to a PowerMem `.env` for extra tuning. If the file **exists**, `pmem` loads it; **OpenClaw-derived vars still override** the same keys when `useOpenClawModel` is true. + - **`useOpenClawModel: false`:** Disables injection; user must supply a **complete** PowerMem config via `.env` and/or environment variables. + - **Verify:** `pmem --version`. If the gateway does not inherit the venv, set **`pmemPath`** to the absolute path of `pmem`. + +4. **HTTP path (enterprise / shared server)** + - Same **Python 3.10+** requirement as CLI; then `pip install powermem`, `.env` in server working directory, `powermem-server --host 0.0.0.0 --port 8000`. + - Check: `curl -s http://localhost:8000/api/v1/system/health`. + +5. **Install the plugin** + `openclaw plugins install /path/to/memory-powermem` (or `openclaw plugins install memory-powermem` from npm), or run **`install.sh`** from the [memory-powermem](https://github.com/ob-labs/memory-powermem) repo — see **One-click plugin deploy (`install.sh`)** below for curl / flags / `--workdir`. + +6. **Configure OpenClaw** + + **CLI — defaults (recommended, matches plugin defaults):** + Do **not** set `envFile` unless you need a file. Example: + + ```bash + openclaw config set plugins.enabled true + openclaw config set plugins.slots.memory memory-powermem + openclaw config set plugins.entries.memory-powermem.config.mode cli + openclaw config set plugins.entries.memory-powermem.config.pmemPath pmem + openclaw config set plugins.entries.memory-powermem.config.useOpenClawModel true --json + openclaw config set plugins.entries.memory-powermem.config.autoCapture true --json + openclaw config set plugins.entries.memory-powermem.config.autoRecall true --json + openclaw config set plugins.entries.memory-powermem.config.inferOnAdd true --json + ``` + + **CLI — optional `.env` override file:** + + ```bash + openclaw config set plugins.entries.memory-powermem.config.envFile "$HOME/.openclaw/powermem/powermem.env" + ``` + + (Only matters if that path exists; OpenClaw can still override LLM keys when `useOpenClawModel` is true.) + + **HTTP:** + + ```bash + openclaw config set plugins.entries.memory-powermem.config.mode http + openclaw config set plugins.entries.memory-powermem.config.baseUrl http://localhost:8000 + ``` + + Optional: `apiKey` if the server uses auth. + +7. **Verify** + Restart **gateway**, then in another terminal: + + ```bash + openclaw plugins list + ``` + + Confirm **memory-powermem** is listed and its status is **loaded**. If it is missing or not loaded, fix install/slot config and restart the gateway before running LTM checks. + + ```bash + openclaw ltm health + openclaw ltm add "I prefer coffee in the morning" + openclaw ltm search "coffee" + ``` + +## One-click plugin deploy (`install.sh`) + +**Requires:** OpenClaw installed (`openclaw --version`). The script does **not** run `pip install powermem`; ensure **`pmem`** is on PATH when the gateway runs or set **`pmemPath`**. + +**Default:** configures plugin **CLI** mode. With **`-y`**, it may still create **`~/.openclaw/powermem/powermem.env`** as an optional template — not required if you use OpenClaw-injected LLM + default SQLite. + +```bash +curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash +``` + +From a local clone (no download): + +```bash +cd /path/to/memory-powermem && bash install.sh +``` + +Non-interactive (defaults: CLI, may seed env file): + +```bash +curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash -s -y +``` + +Target a different OpenClaw instance: + +```bash +curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash -s -- --workdir ~/.openclaw-second +``` + +**What the script does:** resolve OpenClaw workdir → choose or default **cli** / **http** and paths → for CLI, optionally seed `powermem.env` if missing → deploy plugin to `/extensions/memory-powermem` → `npm install` there → set OpenClaw config (`plugins.enabled`, `slots.memory`, `entries.memory-powermem`). + +**After (CLI):** `openclaw gateway`, then `openclaw ltm health` — you usually **do not** need to edit `powermem.env` when using plugin defaults. + +**After (HTTP):** start PowerMem with a proper `.env` in the server cwd, then start the gateway. + +## Copy a skill into OpenClaw + +Copy **one** skill you want into `~/.openclaw/skills//` (folder name should match the skill id). The quickstart and full-guide skills are **independent**. + +**Quickstart (`install-powermem-memory`) — Linux / macOS:** + +```bash +mkdir -p ~/.openclaw/skills/install-powermem-memory +cp /path/to/memory-powermem/skills/install-powermem-memory/SKILL.md \ + ~/.openclaw/skills/install-powermem-memory/ +``` + +**Full guide (`install-powermem-memory-full`) — Linux / macOS:** copy **all** `.md` files in that folder. + +```bash +mkdir -p ~/.openclaw/skills/install-powermem-memory-full +cp /path/to/memory-powermem/skills/install-powermem-memory-full/*.md \ + ~/.openclaw/skills/install-powermem-memory-full/ +``` + +**Full guide — Windows (PowerShell):** + +```powershell +New-Item -ItemType Directory -Force "$env:USERPROFILE\.openclaw\skills\install-powermem-memory-full" +Copy-Item "path\to\memory-powermem\skills\install-powermem-memory-full\*.md" ` + "$env:USERPROFILE\.openclaw\skills\install-powermem-memory-full\" +``` + +## Multi-instance OpenClaw (`--workdir` / `OPENCLAW_STATE_DIR`) + +**Install script:** + +```bash +curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash -s -- --workdir ~/.openclaw-second +``` + +**Manual config** for that instance: + +```bash +OPENCLAW_STATE_DIR=~/.openclaw-second openclaw config set plugins.slots.memory memory-powermem +``` + +Plugin data and default SQLite follow **that** instance’s `stateDir`. + +## Available Tools + +| Tool | Description | +|------|-------------| +| **memory_recall** | Search long-term memories. Params: `query`, optional `limit`, `scoreThreshold`. | +| **memory_store** | Save text; optional infer. Params: `text`, optional `importance`. | +| **memory_forget** | Delete by `memoryId` or by `query` search. | + +## Configuration (summary) + +| Field | Default | Description | +|-------|---------|-------------| +| `mode` | `cli` | `cli` or `http`. | +| `baseUrl` | — | Required for HTTP; if `mode` omitted and `baseUrl` set → HTTP. | +| `apiKey` | — | HTTP server auth. | +| `envFile` | — | Optional CLI `.env` (used only if file exists). | +| `pmemPath` | `pmem` | CLI binary path. | +| `useOpenClawModel` | `true` | Inject LLM/embedding from OpenClaw + default SQLite under state dir. | +| `recallLimit` | `5` | Max memories per recall. | +| `recallScoreThreshold` | `0` | Min score 0–1. | +| `autoCapture` / `autoRecall` / `inferOnAdd` | `true` | Auto memory pipeline and infer on add. | + +## Daily Operations + +```bash +openclaw gateway + +openclaw ltm health +openclaw ltm add "Some fact to remember" +openclaw ltm search "query" + +openclaw config set plugins.slots.memory none +openclaw config set plugins.slots.memory memory-powermem +``` + +Restart the gateway after slot or plugin config changes. + +## Troubleshooting + +| Symptom | Fix | +|---------|-----| +| **Python < 3.10** | Run step 2 first; upgrade Python or use `python3.11` / `python3.12` for venv and `pip install`. Do not skip the version check. | +| **`pip install powermem` fails** | Confirm Python 3.10+, clean venv. See [PowerMem issues](https://github.com/oceanbase/powermem/issues). | +| **`pmem` not found** | Activate venv or set **`pmemPath`** to the full binary. | +| **`openclaw ltm health` unhealthy (CLI)** | Confirm **`agents.defaults.model`** and provider keys in OpenClaw; gateway version should expose plugin **`config`** + **`runtime.modelAuth`**. Or set **`useOpenClawModel: false`** and a full **`envFile`**. | +| **Health OK but add/search errors** | Embedding/LLM mismatch for your provider—see gateway logs; try optional **PowerMem `.env`** from [.env.example](https://github.com/oceanbase/powermem/blob/master/.env.example). | +| **Wrong SQLite file / instance** | Data is under **that OpenClaw instance’s `stateDir`** (`OPENCLAW_STATE_DIR` / `--workdir`). | +| **HTTP mode** | Server running, **`baseUrl`** correct, **`apiKey`** if enabled. | +| **`openclaw plugins list`**: no `memory-powermem`, or status is not **loaded** | Re-run plugin install; set `plugins.enabled` true and `plugins.slots.memory` = `memory-powermem`; restart **gateway**; run `openclaw plugins list` again until **memory-powermem** shows **loaded**. | +| **Add/search returns 500 or empty** | Check PowerMem / gateway logs; often missing or mismatched **`LLM_*` / `EMBEDDING_*`** in **`envFile`** when **`useOpenClawModel`** is false or overrides are incomplete. | diff --git a/skills/install-powermem-memory/config-reference.md b/skills/install-powermem-memory-full/config-reference.md similarity index 65% rename from skills/install-powermem-memory/config-reference.md rename to skills/install-powermem-memory-full/config-reference.md index c822ef0..a717edf 100644 --- a/skills/install-powermem-memory/config-reference.md +++ b/skills/install-powermem-memory-full/config-reference.md @@ -1,6 +1,6 @@ # Config & Commands Quick Reference -Quick reference for this skill folder. See **SKILL.md** for the full install flow. +Quick reference for skill **`install-powermem-memory-full`**. See **SKILL.md** in this folder for the full install flow. --- @@ -8,7 +8,7 @@ Quick reference for this skill folder. See **SKILL.md** for the full install flo - **Python 3.10+** — `python3 --version`. - **Install** — `pip install powermem` (virtualenv recommended). -- **CLI (default)** — No `powermem.env` required for a minimal setup: the plugin injects **SQLite** (under the OpenClaw **state directory**) and **LLM + embedding** from OpenClaw (`agents.defaults.model` + provider keys), as long as `useOpenClawModel` is `true` (default). +- **CLI (default)** — No `powermem.env` required for the default setup: the plugin injects **SQLite** (under the OpenClaw **state directory**) and **LLM + embedding** from OpenClaw (`agents.defaults.model` + provider keys), as long as `useOpenClawModel` is `true` (default). - **`pmem` on PATH** — When you start `openclaw gateway`, the same environment should expose `pmem`, or set plugin `pmemPath` to the binary’s absolute path (e.g. inside a venv). - **Optional `.env`** — Set `envFile` to a PowerMem `.env` if you want file-based overrides; if the file exists, it is loaded first, then OpenClaw-derived variables **override** the same keys (when `useOpenClawModel` is true). - **HTTP (shared server)** — Run `powermem-server` with its own `.env`; plugin `mode: http` + `baseUrl`. Verify with `curl` on `/api/v1/system/health`. @@ -67,3 +67,49 @@ openclaw config set plugins.slots.memory memory-powermem ``` Restart the gateway after changing plugin or memory-slot config. + +--- + +## Example `openclaw.json` fragments (manual edit) + +Prefer `openclaw config set` when possible; use these when editing **`~/.openclaw/openclaw.json`** (or your instance’s config) directly. Replace paths with the user’s home / real `pmem` binary path. + +**CLI mode (explicit `envFile`; optional when using OpenClaw-injected LLM + defaults):** + +```json +{ + "plugins": { + "enabled": true, + "slots": { "memory": "memory-powermem" }, + "entries": { + "memory-powermem": { + "enabled": true, + "config": { + "mode": "cli", + "envFile": "/home/you/.openclaw/powermem/powermem.env", + "pmemPath": "pmem", + "autoCapture": true, + "autoRecall": true, + "inferOnAdd": true + } + } + } + } +} +``` + +If `pmem` lives only inside a venv, set **`pmemPath`** to that binary’s absolute path. With **`useOpenClawModel: true`** and no need for a file, you can omit **`envFile`** (see **SKILL.md** for the recommended `openclaw config set` flow). + +**HTTP mode (shared server):** + +```json +"config": { + "mode": "http", + "baseUrl": "http://localhost:8000", + "autoCapture": true, + "autoRecall": true, + "inferOnAdd": true +} +``` + +If you omit **`mode`** but set a non-empty **`baseUrl`**, the plugin treats the backend as **http** (backward compatible). Add **`apiKey`** when the server requires it. diff --git a/skills/install-powermem-memory/powermem-intro.md b/skills/install-powermem-memory-full/powermem-intro.md similarity index 94% rename from skills/install-powermem-memory/powermem-intro.md rename to skills/install-powermem-memory-full/powermem-intro.md index 0bf64f0..0b5ae85 100644 --- a/skills/install-powermem-memory/powermem-intro.md +++ b/skills/install-powermem-memory-full/powermem-intro.md @@ -1,6 +1,6 @@ # PowerMem Introduction -Use this doc when the user asks "what is PowerMem", "why use PowerMem", or needs a product overview. +Ships with OpenClaw skill **`install-powermem-memory-full`** (folder `install-powermem-memory-full`). Use this doc when the user asks "what is PowerMem", "why use PowerMem", or needs a product overview. --- diff --git a/skills/install-powermem-memory-minimal/SKILL.md b/skills/install-powermem-memory-minimal/SKILL.md deleted file mode 100644 index 15e4959..0000000 --- a/skills/install-powermem-memory-minimal/SKILL.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -name: install-powermem-memory-minimal -description: memory-powermem 最小安装步骤(OpenClaw + PowerMem 长期记忆),面向个人用户;无需单独配置 powermem.env,复用 OpenClaw 里已配好的对话模型。本 skill 可独立分发,不依赖其他安装类 skill。 -triggers: - - "PowerMem 快速安装" - - "PowerMem 最简单安装" - - "memory-powermem 最小安装" - - "怎么装 PowerMem 记忆" - - "OpenClaw 记忆 怎么装" - - "安装长期记忆" - - "Quick install PowerMem" - - "PowerMem quickstart" - - "Easiest PowerMem setup" - - "Minimal install memory-powermem" - - "Install powermem memory minimal" ---- - -# PowerMem 记忆 · 极简安装(个人用户) - -你只要记住几件事:**OpenClaw 能正常聊天**、**Python 先确认 ≥ 3.10**、**本机装好 PowerMem**、**装上插件**。不用手写 `powermem.env`,记忆用的模型和 Key 会跟你在 OpenClaw 里配的一样。 - ---- - -## 你要做什么(按顺序) - -1. **确认 OpenClaw 已经能用** - 终端执行 `openclaw --version`,并且你已经在 OpenClaw 里配好了**平时对话用的模型**(能正常回复即可)。 - -2. **先检查 Python 版本(必须 ≥ 3.10)** - 在创建虚拟环境或执行 `pip install` **之前**必须先确认版本,否则后续容易装失败或运行异常: - ```bash - python3 --version - ``` - 输出应为 **Python 3.10.x、3.11.x、3.12.x** 等(次版本号 ≥ 10)。也可用下面命令做一次硬性校验(不通过会报错退出): - ```bash - python3 -c "import sys; assert sys.version_info >= (3, 10), '需要 Python 3.10 或更高'; print(sys.version.split()[0], 'OK')" - ``` - 若版本不够:先升级本机 Python,或安装并使用 `python3.11` / `python3.12` 等满足要求的解释器,并将下面步骤里的 **`python3`** 换成实际命令(例如 `python3.12 -m venv ...`)。 - -3. **安装 PowerMem(Python)** - 建议用虚拟环境,然后安装: - ```bash - python3 -m venv ~/.openclaw/powermem/.venv - source ~/.openclaw/powermem/.venv/bin/activate - pip install powermem - ``` - 装好后执行 `pmem --version`,能输出版本就行。 - -4. **让网关能找到 `pmem`** - 如果你启动 `openclaw gateway` 的终端**没有**激活上面的 venv,有两种简单办法二选一: - - 每次开网关前先 `source ~/.openclaw/powermem/.venv/bin/activate`;或 - - 在插件配置里把 **`pmemPath`** 写成 venv 里 `pmem` 的**完整路径**(装完后可用 `which pmem` 查看)。 - -5. **一键装插件(推荐)** - 在 **Mac / Linux** 上执行(需已安装 OpenClaw): - ```bash - curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash -s -y - ``` - 脚本会把插件放进 OpenClaw,并打开「用 OpenClaw 的模型驱动记忆」等默认选项。 - -6. **重启网关并检查** - ```bash - openclaw gateway - ``` - 另开终端,**先**确认插件已被网关加载: - ```bash - openclaw plugins list - ``` - 输出里要有 **memory-powermem**,且其状态为 **loaded**(已加载)。若只有安装记录、状态不是 loaded,先按下面「若某一步失败」处理,**不要**跳过这步直接去测 `ltm`。 - 通过后再检查记忆健康并试写读: - ```bash - openclaw ltm health - ``` - 显示健康后试一句: - ```bash - openclaw ltm add "我喜欢喝美式" - openclaw ltm search "咖啡" - ``` - ---- - -## 若某一步失败 - -| 情况 | 怎么办 | -|------|--------| -| `python3 --version` 低于 3.10 | **先升级或换用** `python3.11` / `python3.12` 等,再重做「检查 Python」与 venv 步骤;不要跳过版本检查强行 `pip install`。 | -| `pip install powermem` 报错 | 再次确认 Python ≥ 3.10;换干净 venv 再试。 | -| `pmem` 找不到 | 激活 venv,或配置 **`pmemPath`** 为绝对路径。 | -| `plugins list` 没有 **memory-powermem**,或状态不是 **loaded** | 确认已执行安装脚本或 `openclaw plugins install`;`plugins.enabled` 为 true、`plugins.slots.memory` 为 **memory-powermem**;改完后**重启 gateway**,再执行 `openclaw plugins list` 复查。 | -| `ltm health` 不健康 | 确认 OpenClaw 里**默认模型**和 API Key 本身能聊天;升级 OpenClaw 到较新版本后再试。 | -| 想要更多选项(多实例、HTTP、自建服务器等) | 查阅 **[memory-powermem](https://github.com/ob-labs/memory-powermem)** 仓库根目录的 **INSTALL.md** 与 **README**。 | - ---- - -## 说明(一句话) - -记忆数据默认存在本机 OpenClaw 数据目录下的 SQLite 里;**不需要**你再单独维护一份 PowerMem 的 `.env`,除非你熟悉进阶配置。 diff --git a/skills/install-powermem-memory/SKILL.md b/skills/install-powermem-memory/SKILL.md index 0ad59a9..4d80d64 100644 --- a/skills/install-powermem-memory/SKILL.md +++ b/skills/install-powermem-memory/SKILL.md @@ -1,156 +1,100 @@ --- name: install-powermem-memory -description: Step-by-step guide to install and configure the PowerMem long-term memory plugin (full path, options, troubleshooting). After setup, the plugin auto-captures conversation highlights and auto-recalls relevant memories. This skill is self-contained and can be published independently of any minimal-install skill. +description: OpenClaw skill「快速安装」路径(skill id 与目录名均为 install-powermem-memory):memory-powermem + PowerMem 最少步骤,面向个人用户;无需单独配置 powermem.env,复用 OpenClaw 里已配好的对话模型。可独立分发;完整选项、工具说明与排错见 install-powermem-memory-full。 triggers: - - "安装 PowerMem 记忆" - - "安装 PowerMem 记忆插件" - - "Install PowerMem memory" - - "Install PowerMem memory plugin" - - "配置 PowerMem 记忆" - - "Configure PowerMem memory" - - "PowerMem 是什么" - - "什么是 PowerMem" - - "What is PowerMem" + - "PowerMem 快速安装" + - "PowerMem 最简单安装" + - "memory-powermem 最小安装" + - "怎么装 PowerMem 记忆" + - "OpenClaw 记忆 怎么装" + - "安装长期记忆" + - "Quick install PowerMem" + - "PowerMem quickstart" + - "Easiest PowerMem setup" + - "Minimal install memory-powermem" + - "Install powermem memory minimal" --- -# PowerMem Memory Guide +# PowerMem 记忆 · 快速安装(个人用户) -This skill folder includes supplementary docs: +本 skill 在 OpenClaw 中的标识与建议目录名为 **`install-powermem-memory`**。若需要 HTTP/多实例、工具表与详细排错,请改用 **`install-powermem-memory-full`**(仓库内 `skills/install-powermem-memory-full/`,需一并拷贝该目录下全部 `.md`)。 -- **powermem-intro.md** — What PowerMem is, features, vs file-based memory. -- **config-reference.md** — Config keys, state dir, commands. +你只要记住几件事:**OpenClaw 能正常聊天**、**Python 先确认 ≥ 3.10**、**本机装好 PowerMem**、**装上插件**。不用手写 `powermem.env`,记忆用的模型和 Key 会跟你在 OpenClaw 里配的一样。 -## How It Works - -- **Auto-Capture**: After a conversation, the plugin sends valuable user/assistant text to PowerMem (optional infer / intelligent extraction). -- **Auto-Recall**: Before each turn, it searches memories and can inject a `` block into context. - -## When User Asks to Install - -**Recommended order (TO C):** (1) OpenClaw installed and **default model + provider auth** configured. (2) **Python 3.10+ verified** (`python3 --version`) *before* venv / `pip install`. (3) `pip install powermem` and `pmem` available to the gateway (PATH or `pmemPath`). (4) Install the **memory-powermem** plugin. **No `powermem.env` is required** for the default path. +--- -The curl **`install.sh`** deploys the plugin and OpenClaw entries; with **`-y`** it may still create **`~/.openclaw/powermem/powermem.env`** as an *optional* template—it does **not** run `pip install powermem`. That file is **not** required if the user relies on **OpenClaw-injected** LLM + default SQLite. +## 你要做什么(按顺序) -1. **Check OpenClaw** - `openclaw --version`. If missing: `npm install -g openclaw`, `openclaw onboard`. - Ensure **`agents.defaults.model`** is set (e.g. `openai/gpt-4o-mini`) and the corresponding **provider / API key** works for normal chat—the plugin reuses that for PowerMem when **`useOpenClawModel`** is true (default). +1. **确认 OpenClaw 已经能用** + 终端执行 `openclaw --version`,并且你已经在 OpenClaw 里配好了**平时对话用的模型**(能正常回复即可)。 -2. **Check Python (required before venv / pip)** - PowerMem needs **Python 3.10 or newer**. Run **`python3 --version`** first; the minor version must be **≥ 10** (e.g. 3.10.x, 3.12.x). Optional strict check: +2. **先检查 Python 版本(必须 ≥ 3.10)** + 在创建虚拟环境或执行 `pip install` **之前**必须先确认版本,否则后续容易装失败或运行异常: ```bash - python3 -c "import sys; assert sys.version_info >= (3, 10), 'Need Python 3.10+'; print(sys.version.split()[0], 'OK')" + python3 --version ``` - If it fails: upgrade Python or use a specific binary (e.g. `python3.12`) for all commands below instead of `python3`. - -3. **Install PowerMem (CLI — default)** - - Venv recommended: e.g. `python3 -m venv ~/.openclaw/powermem/.venv && source ~/.openclaw/powermem/.venv/bin/activate`. - - `pip install powermem`. - - **Defaults:** Plugin injects **SQLite** at `/powermem/data/powermem.db` and **LLM + embedding** env vars derived from OpenClaw. Typical `stateDir` is `~/.openclaw` unless the user uses another instance (`OPENCLAW_STATE_DIR`, `--workdir`). - - **Optional `envFile`:** Path to a PowerMem `.env` for extra tuning. If the file **exists**, `pmem` loads it; **OpenClaw-derived vars still override** the same keys when `useOpenClawModel` is true. - - **`useOpenClawModel: false`:** Disables injection; user must supply a **complete** PowerMem config via `.env` and/or environment variables. - - **Verify:** `pmem --version`. If the gateway does not inherit the venv, set **`pmemPath`** to the absolute path of `pmem`. - -4. **HTTP path (enterprise / shared server)** - - Same **Python 3.10+** requirement as CLI; then `pip install powermem`, `.env` in server working directory, `powermem-server --host 0.0.0.0 --port 8000`. - - Check: `curl -s http://localhost:8000/api/v1/system/health`. - -5. **Install the plugin** - `openclaw plugins install /path/to/memory-powermem`, or **`install.sh`** from [INSTALL.md](https://github.com/ob-labs/memory-powermem/blob/main/INSTALL.md). - -6. **Configure OpenClaw** - - **CLI — minimal (recommended, matches plugin defaults):** - Do **not** set `envFile` unless you need a file. Example: - + 输出应为 **Python 3.10.x、3.11.x、3.12.x** 等(次版本号 ≥ 10)。也可用下面命令做一次硬性校验(不通过会报错退出): ```bash - openclaw config set plugins.enabled true - openclaw config set plugins.slots.memory memory-powermem - openclaw config set plugins.entries.memory-powermem.config.mode cli - openclaw config set plugins.entries.memory-powermem.config.pmemPath pmem - openclaw config set plugins.entries.memory-powermem.config.useOpenClawModel true --json - openclaw config set plugins.entries.memory-powermem.config.autoCapture true --json - openclaw config set plugins.entries.memory-powermem.config.autoRecall true --json - openclaw config set plugins.entries.memory-powermem.config.inferOnAdd true --json + python3 -c "import sys; assert sys.version_info >= (3, 10), '需要 Python 3.10 或更高'; print(sys.version.split()[0], 'OK')" ``` + 若版本不够:先升级本机 Python,或安装并使用 `python3.11` / `python3.12` 等满足要求的解释器,并将下面步骤里的 **`python3`** 换成实际命令(例如 `python3.12 -m venv ...`)。 - **CLI — optional `.env` override file:** - +3. **安装 PowerMem(Python)** + 建议用虚拟环境,然后安装: ```bash - openclaw config set plugins.entries.memory-powermem.config.envFile "$HOME/.openclaw/powermem/powermem.env" + python3 -m venv ~/.openclaw/powermem/.venv + source ~/.openclaw/powermem/.venv/bin/activate + pip install powermem ``` + 装好后执行 `pmem --version`,能输出版本就行。 - (Only matters if that path exists; OpenClaw can still override LLM keys when `useOpenClawModel` is true.) - - **HTTP:** +4. **让网关能找到 `pmem`** + 如果你启动 `openclaw gateway` 的终端**没有**激活上面的 venv,有两种简单办法二选一: + - 每次开网关前先 `source ~/.openclaw/powermem/.venv/bin/activate`;或 + - 在插件配置里把 **`pmemPath`** 写成 venv 里 `pmem` 的**完整路径**(装完后可用 `which pmem` 查看)。 +5. **一键装插件(推荐)** + 在 **Mac / Linux** 上执行(需已安装 OpenClaw)。脚本**不会**替你执行 `pip install powermem`;装插件前仍需完成上面的 PowerMem 与 `pmem` 步骤。 ```bash - openclaw config set plugins.entries.memory-powermem.config.mode http - openclaw config set plugins.entries.memory-powermem.config.baseUrl http://localhost:8000 + curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash -s -y ``` + 已克隆本仓库时,也可在仓库根目录执行:`bash install.sh`(可加 `-y`、或 `bash -s -- --workdir ~/.openclaw-second` 指定另一套 OpenClaw 数据目录)。 + 脚本会把插件放进 OpenClaw,并打开「用 OpenClaw 的模型驱动记忆」等默认选项;带 `-y` 时仍可能生成可选模板 **`~/.openclaw/powermem/powermem.env`**(默认路径下通常不必手改)。 - Optional: `apiKey` if the server uses auth. - -7. **Verify** - Restart **gateway**, then in another terminal: - +6. **重启网关并检查** + ```bash + openclaw gateway + ``` + 另开终端,**先**确认插件已被网关加载: ```bash openclaw plugins list ``` - - Confirm **memory-powermem** is listed and its status is **loaded**. If it is missing or not loaded, fix install/slot config and restart the gateway before running LTM checks. - + 输出里要有 **memory-powermem**,且其状态为 **loaded**(已加载)。若只有安装记录、状态不是 loaded,先按下面「若某一步失败」处理,**不要**跳过这步直接去测 `ltm`。 + 通过后再检查记忆健康并试写读: ```bash openclaw ltm health - openclaw ltm add "I prefer coffee in the morning" - openclaw ltm search "coffee" ``` + 显示健康后试一句: + ```bash + openclaw ltm add "我喜欢喝美式" + openclaw ltm search "咖啡" + ``` + +--- + +## 若某一步失败 + +| 情况 | 怎么办 | +|------|--------| +| `python3 --version` 低于 3.10 | **先升级或换用** `python3.11` / `python3.12` 等,再重做「检查 Python」与 venv 步骤;不要跳过版本检查强行 `pip install`。 | +| `pip install powermem` 报错 | 再次确认 Python ≥ 3.10;换干净 venv 再试。 | +| `pmem` 找不到 | 激活 venv,或配置 **`pmemPath`** 为绝对路径。 | +| `plugins list` 没有 **memory-powermem**,或状态不是 **loaded** | 确认已执行安装脚本或 `openclaw plugins install`;`plugins.enabled` 为 true、`plugins.slots.memory` 为 **memory-powermem**;改完后**重启 gateway**,再执行 `openclaw plugins list` 复查。 | +| `ltm health` 不健康 | 确认 OpenClaw 里**默认模型**和 API Key 本身能聊天;升级 OpenClaw 到较新版本后再试。 | +| 想要更多选项(多实例、HTTP、`install.sh` 细节、工具与排错表等) | 使用 **`install-powermem-memory-full`** skill(含 **config-reference.md**),或查阅 **[memory-powermem](https://github.com/ob-labs/memory-powermem)** 的 **README**。 | + +--- + +## 说明(一句话) -## Available Tools - -| Tool | Description | -|------|-------------| -| **memory_recall** | Search long-term memories. Params: `query`, optional `limit`, `scoreThreshold`. | -| **memory_store** | Save text; optional infer. Params: `text`, optional `importance`. | -| **memory_forget** | Delete by `memoryId` or by `query` search. | - -## Configuration (summary) - -| Field | Default | Description | -|-------|---------|-------------| -| `mode` | `cli` | `cli` or `http`. | -| `baseUrl` | — | Required for HTTP; if `mode` omitted and `baseUrl` set → HTTP. | -| `apiKey` | — | HTTP server auth. | -| `envFile` | — | Optional CLI `.env` (used only if file exists). | -| `pmemPath` | `pmem` | CLI binary path. | -| `useOpenClawModel` | `true` | Inject LLM/embedding from OpenClaw + default SQLite under state dir. | -| `recallLimit` | `5` | Max memories per recall. | -| `recallScoreThreshold` | `0` | Min score 0–1. | -| `autoCapture` / `autoRecall` / `inferOnAdd` | `true` | Auto memory pipeline and infer on add. | - -## Daily Operations - -```bash -openclaw gateway - -openclaw ltm health -openclaw ltm add "Some fact to remember" -openclaw ltm search "query" - -openclaw config set plugins.slots.memory none -openclaw config set plugins.slots.memory memory-powermem -``` - -Restart the gateway after slot or plugin config changes. - -## Troubleshooting - -| Symptom | Fix | -|---------|-----| -| **Python < 3.10** | Run step 2 first; upgrade Python or use `python3.11` / `python3.12` for venv and `pip install`. Do not skip the version check. | -| **`pip install powermem` fails** | Confirm Python 3.10+, clean venv. See [PowerMem issues](https://github.com/oceanbase/powermem/issues). | -| **`pmem` not found** | Activate venv or set **`pmemPath`** to the full binary. | -| **`openclaw ltm health` unhealthy (CLI)** | Confirm **`agents.defaults.model`** and provider keys in OpenClaw; gateway version should expose plugin **`config`** + **`runtime.modelAuth`**. Or set **`useOpenClawModel: false`** and a full **`envFile`**. | -| **Health OK but add/search errors** | Embedding/LLM mismatch for your provider—see gateway logs; try optional **PowerMem `.env`** from [.env.example](https://github.com/oceanbase/powermem/blob/master/.env.example). | -| **Wrong SQLite file / instance** | Data is under **that OpenClaw instance’s `stateDir`** (`OPENCLAW_STATE_DIR` / `--workdir`). | -| **HTTP mode** | Server running, **`baseUrl`** correct, **`apiKey`** if enabled. | -| **`openclaw plugins list`**: no `memory-powermem`, or status is not **loaded** | Re-run plugin install; set `plugins.enabled` true and `plugins.slots.memory` = `memory-powermem`; restart **gateway**; run `openclaw plugins list` again until **memory-powermem** shows **loaded**. | +记忆数据默认存在本机 OpenClaw 数据目录下的 SQLite 里;**不需要**你再单独维护一份 PowerMem 的 `.env`,除非你熟悉进阶配置。 From 47017205d55f78724e30ad1c4eda4c34f848ff1a Mon Sep 17 00:00:00 2001 From: Teingi Date: Tue, 24 Mar 2026 15:29:43 +0800 Subject: [PATCH 2/2] Rename OpenClaw skills to install-memory-powermem* Rename skill folders from install-powermem-memory* to install-memory-powermem* for consistent naming. Update SKILL frontmatter, READMEs, install.sh, and bundled reference docs. Made-with: Cursor --- README.md | 6 ++-- README_CN.md | 6 ++-- install.sh | 2 +- .../SKILL.md | 28 +++++++++---------- .../config-reference.md | 2 +- .../powermem-intro.md | 2 +- .../SKILL.md | 10 +++---- 7 files changed, 28 insertions(+), 28 deletions(-) rename skills/{install-powermem-memory-full => install-memory-powermem-full}/SKILL.md (92%) rename skills/{install-powermem-memory-full => install-memory-powermem-full}/config-reference.md (98%) rename skills/{install-powermem-memory-full => install-memory-powermem-full}/powermem-intro.md (96%) rename skills/{install-powermem-memory => install-memory-powermem}/SKILL.md (92%) diff --git a/README.md b/README.md index 6830641..c248c18 100644 --- a/README.md +++ b/README.md @@ -161,9 +161,9 @@ JSON response means the server is up. API docs: `http://localhost:8000/docs`. ```bash curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash ``` - From a clone: `cd /path/to/memory-powermem && bash install.sh`. Non-interactive: same URL but pipe to `bash -s -y`. Another OpenClaw instance: `bash -s -- --workdir ~/.openclaw-second`. Details and troubleshooting: OpenClaw skill **`install-powermem-memory-full`** ([skills/install-powermem-memory-full/](skills/install-powermem-memory-full/)). -- **OpenClaw skill — quickstart (`install-powermem-memory`):** Copy [skills/install-powermem-memory/SKILL.md](skills/install-powermem-memory/SKILL.md) to `~/.openclaw/skills/install-powermem-memory/`, then say **「PowerMem 快速安装」** / **“PowerMem quickstart”** or **“Minimal install memory-powermem”** / **“Install powermem memory minimal”**. -- **OpenClaw skill — full guide (`install-powermem-memory-full`):** Copy [skills/install-powermem-memory-full/SKILL.md](skills/install-powermem-memory-full/SKILL.md) (and its sibling `.md` files in that folder if you mirror the repo) to `~/.openclaw/skills/install-powermem-memory-full/`, then say **「安装 PowerMem 记忆」** / **“Install PowerMem memory”**. The quickstart and full-guide skills are **independent**; use whichever fits your workflow. + From a clone: `cd /path/to/memory-powermem && bash install.sh`. Non-interactive: same URL but pipe to `bash -s -y`. Another OpenClaw instance: `bash -s -- --workdir ~/.openclaw-second`. Details and troubleshooting: OpenClaw skill **`install-memory-powermem-full`** ([skills/install-memory-powermem-full/](skills/install-memory-powermem-full/)). +- **OpenClaw skill — quickstart (`install-memory-powermem`):** Copy [skills/install-memory-powermem/SKILL.md](skills/install-memory-powermem/SKILL.md) to `~/.openclaw/skills/install-memory-powermem/`, then say **「PowerMem 快速安装」** / **“PowerMem quickstart”** or **“Minimal install memory-powermem”** / **“Install memory powermem minimal”**. +- **OpenClaw skill — full guide (`install-memory-powermem-full`):** Copy [skills/install-memory-powermem-full/SKILL.md](skills/install-memory-powermem-full/SKILL.md) (and its sibling `.md` files in that folder if you mirror the repo) to `~/.openclaw/skills/install-memory-powermem-full/`, then say **「安装 PowerMem 记忆」** / **“Install PowerMem memory”**. The quickstart and full-guide skills are **independent**; use whichever fits your workflow. - **Manual:** Steps below. --- diff --git a/README_CN.md b/README_CN.md index 21eb193..8456c71 100644 --- a/README_CN.md +++ b/README_CN.md @@ -162,9 +162,9 @@ curl -s http://localhost:8000/api/v1/system/health ```bash curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash ``` - 已克隆仓库:`cd /path/to/memory-powermem && bash install.sh`。非交互:同一 curl 命令改为接到 `bash -s -y`。指定另一数据目录:`bash -s -- --workdir ~/.openclaw-second`。更完整的说明与排错见 OpenClaw skill **`install-powermem-memory-full`**([skills/install-powermem-memory-full/](skills/install-powermem-memory-full/))。 -- **OpenClaw skill — 快速安装(`install-powermem-memory`):** 将 [skills/install-powermem-memory/SKILL.md](skills/install-powermem-memory/SKILL.md) 复制到 `~/.openclaw/skills/install-powermem-memory/`,然后说「**PowerMem 快速安装**」或「**memory-powermem 最小安装**」或 **“Install powermem memory minimal”**。 -- **OpenClaw skill — 完整指南(`install-powermem-memory-full`):** 将 [skills/install-powermem-memory-full/SKILL.md](skills/install-powermem-memory-full/SKILL.md)(若从仓库拷贝,建议连同该目录下其余 `.md` 一并放入 skill 目录)复制到 `~/.openclaw/skills/install-powermem-memory-full/`,然后说「**安装 PowerMem 记忆**」。快速安装与完整指南两个 skill **彼此独立**,按需选用其一即可。 + 已克隆仓库:`cd /path/to/memory-powermem && bash install.sh`。非交互:同一 curl 命令改为接到 `bash -s -y`。指定另一数据目录:`bash -s -- --workdir ~/.openclaw-second`。更完整的说明与排错见 OpenClaw skill **`install-memory-powermem-full`**([skills/install-memory-powermem-full/](skills/install-memory-powermem-full/))。 +- **OpenClaw skill — 快速安装(`install-memory-powermem`):** 将 [skills/install-memory-powermem/SKILL.md](skills/install-memory-powermem/SKILL.md) 复制到 `~/.openclaw/skills/install-memory-powermem/`,然后说「**PowerMem 快速安装**」或「**memory-powermem 最小安装**」或 **“Install memory powermem minimal”**。 +- **OpenClaw skill — 完整指南(`install-memory-powermem-full`):** 将 [skills/install-memory-powermem-full/SKILL.md](skills/install-memory-powermem-full/SKILL.md)(若从仓库拷贝,建议连同该目录下其余 `.md` 一并放入 skill 目录)复制到 `~/.openclaw/skills/install-memory-powermem-full/`,然后说「**安装 PowerMem 记忆**」。快速安装与完整指南两个 skill **彼此独立**,按需选用其一即可。 - **手动安装:** 按下面步骤操作。 --- diff --git a/install.sh b/install.sh index e985b4f..d4403d2 100644 --- a/install.sh +++ b/install.sh @@ -83,7 +83,7 @@ case "$(uname -s)" in *) OS="unknown";; esac if [[ "$OS" == "windows" ]]; then - err "Windows is not supported by this script. Use README.md or skills/install-powermem-memory-full for manual steps." + err "Windows is not supported by this script. Use README.md or skills/install-memory-powermem-full for manual steps." exit 1 fi diff --git a/skills/install-powermem-memory-full/SKILL.md b/skills/install-memory-powermem-full/SKILL.md similarity index 92% rename from skills/install-powermem-memory-full/SKILL.md rename to skills/install-memory-powermem-full/SKILL.md index ed61e21..31c3c11 100644 --- a/skills/install-powermem-memory-full/SKILL.md +++ b/skills/install-memory-powermem-full/SKILL.md @@ -1,6 +1,6 @@ --- -name: install-powermem-memory-full -description: OpenClaw full guide skill (id and folder name install-powermem-memory-full). Step-by-step install and configuration for the PowerMem long-term memory plugin—options, tools, troubleshooting—and bundled reference docs. Complements the quickstart skill install-powermem-memory; either can be used alone. +name: install-memory-powermem-full +description: OpenClaw full guide skill (id and folder name install-memory-powermem-full). Step-by-step install and configuration for the PowerMem long-term memory plugin—options, tools, troubleshooting—and bundled reference docs. Complements the quickstart skill install-memory-powermem; either can be used alone. triggers: - "安装 PowerMem 记忆" - "安装 PowerMem 记忆插件" @@ -15,7 +15,7 @@ triggers: # PowerMem Memory — Full Guide -**Skill id / OpenClaw folder name:** `install-powermem-memory-full`. For the shortest install-only path, use **`install-powermem-memory`** (quickstart). +**Skill id / OpenClaw folder name:** `install-memory-powermem-full`. For the shortest install-only path, use **`install-memory-powermem`** (quickstart). This skill folder includes supplementary docs: @@ -145,28 +145,28 @@ curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/instal Copy **one** skill you want into `~/.openclaw/skills//` (folder name should match the skill id). The quickstart and full-guide skills are **independent**. -**Quickstart (`install-powermem-memory`) — Linux / macOS:** +**Quickstart (`install-memory-powermem`) — Linux / macOS:** ```bash -mkdir -p ~/.openclaw/skills/install-powermem-memory -cp /path/to/memory-powermem/skills/install-powermem-memory/SKILL.md \ - ~/.openclaw/skills/install-powermem-memory/ +mkdir -p ~/.openclaw/skills/install-memory-powermem +cp /path/to/memory-powermem/skills/install-memory-powermem/SKILL.md \ + ~/.openclaw/skills/install-memory-powermem/ ``` -**Full guide (`install-powermem-memory-full`) — Linux / macOS:** copy **all** `.md` files in that folder. +**Full guide (`install-memory-powermem-full`) — Linux / macOS:** copy **all** `.md` files in that folder. ```bash -mkdir -p ~/.openclaw/skills/install-powermem-memory-full -cp /path/to/memory-powermem/skills/install-powermem-memory-full/*.md \ - ~/.openclaw/skills/install-powermem-memory-full/ +mkdir -p ~/.openclaw/skills/install-memory-powermem-full +cp /path/to/memory-powermem/skills/install-memory-powermem-full/*.md \ + ~/.openclaw/skills/install-memory-powermem-full/ ``` **Full guide — Windows (PowerShell):** ```powershell -New-Item -ItemType Directory -Force "$env:USERPROFILE\.openclaw\skills\install-powermem-memory-full" -Copy-Item "path\to\memory-powermem\skills\install-powermem-memory-full\*.md" ` - "$env:USERPROFILE\.openclaw\skills\install-powermem-memory-full\" +New-Item -ItemType Directory -Force "$env:USERPROFILE\.openclaw\skills\install-memory-powermem-full" +Copy-Item "path\to\memory-powermem\skills\install-memory-powermem-full\*.md" ` + "$env:USERPROFILE\.openclaw\skills\install-memory-powermem-full\" ``` ## Multi-instance OpenClaw (`--workdir` / `OPENCLAW_STATE_DIR`) diff --git a/skills/install-powermem-memory-full/config-reference.md b/skills/install-memory-powermem-full/config-reference.md similarity index 98% rename from skills/install-powermem-memory-full/config-reference.md rename to skills/install-memory-powermem-full/config-reference.md index a717edf..86f9ab5 100644 --- a/skills/install-powermem-memory-full/config-reference.md +++ b/skills/install-memory-powermem-full/config-reference.md @@ -1,6 +1,6 @@ # Config & Commands Quick Reference -Quick reference for skill **`install-powermem-memory-full`**. See **SKILL.md** in this folder for the full install flow. +Quick reference for skill **`install-memory-powermem-full`**. See **SKILL.md** in this folder for the full install flow. --- diff --git a/skills/install-powermem-memory-full/powermem-intro.md b/skills/install-memory-powermem-full/powermem-intro.md similarity index 96% rename from skills/install-powermem-memory-full/powermem-intro.md rename to skills/install-memory-powermem-full/powermem-intro.md index 0b5ae85..cc7f672 100644 --- a/skills/install-powermem-memory-full/powermem-intro.md +++ b/skills/install-memory-powermem-full/powermem-intro.md @@ -1,6 +1,6 @@ # PowerMem Introduction -Ships with OpenClaw skill **`install-powermem-memory-full`** (folder `install-powermem-memory-full`). Use this doc when the user asks "what is PowerMem", "why use PowerMem", or needs a product overview. +Ships with OpenClaw skill **`install-memory-powermem-full`** (folder `install-memory-powermem-full`). Use this doc when the user asks "what is PowerMem", "why use PowerMem", or needs a product overview. --- diff --git a/skills/install-powermem-memory/SKILL.md b/skills/install-memory-powermem/SKILL.md similarity index 92% rename from skills/install-powermem-memory/SKILL.md rename to skills/install-memory-powermem/SKILL.md index 4d80d64..dd6af1b 100644 --- a/skills/install-powermem-memory/SKILL.md +++ b/skills/install-memory-powermem/SKILL.md @@ -1,6 +1,6 @@ --- -name: install-powermem-memory -description: OpenClaw skill「快速安装」路径(skill id 与目录名均为 install-powermem-memory):memory-powermem + PowerMem 最少步骤,面向个人用户;无需单独配置 powermem.env,复用 OpenClaw 里已配好的对话模型。可独立分发;完整选项、工具说明与排错见 install-powermem-memory-full。 +name: install-memory-powermem +description: OpenClaw skill「快速安装」路径(skill id 与目录名均为 install-memory-powermem):memory-powermem + PowerMem 最少步骤,面向个人用户;无需单独配置 powermem.env,复用 OpenClaw 里已配好的对话模型。可独立分发;完整选项、工具说明与排错见 install-memory-powermem-full。 triggers: - "PowerMem 快速安装" - "PowerMem 最简单安装" @@ -12,12 +12,12 @@ triggers: - "PowerMem quickstart" - "Easiest PowerMem setup" - "Minimal install memory-powermem" - - "Install powermem memory minimal" + - "Install memory powermem minimal" --- # PowerMem 记忆 · 快速安装(个人用户) -本 skill 在 OpenClaw 中的标识与建议目录名为 **`install-powermem-memory`**。若需要 HTTP/多实例、工具表与详细排错,请改用 **`install-powermem-memory-full`**(仓库内 `skills/install-powermem-memory-full/`,需一并拷贝该目录下全部 `.md`)。 +本 skill 在 OpenClaw 中的标识与建议目录名为 **`install-memory-powermem`**。若需要 HTTP/多实例、工具表与详细排错,请改用 **`install-memory-powermem-full`**(仓库内 `skills/install-memory-powermem-full/`,需一并拷贝该目录下全部 `.md`)。 你只要记住几件事:**OpenClaw 能正常聊天**、**Python 先确认 ≥ 3.10**、**本机装好 PowerMem**、**装上插件**。不用手写 `powermem.env`,记忆用的模型和 Key 会跟你在 OpenClaw 里配的一样。 @@ -91,7 +91,7 @@ triggers: | `pmem` 找不到 | 激活 venv,或配置 **`pmemPath`** 为绝对路径。 | | `plugins list` 没有 **memory-powermem**,或状态不是 **loaded** | 确认已执行安装脚本或 `openclaw plugins install`;`plugins.enabled` 为 true、`plugins.slots.memory` 为 **memory-powermem**;改完后**重启 gateway**,再执行 `openclaw plugins list` 复查。 | | `ltm health` 不健康 | 确认 OpenClaw 里**默认模型**和 API Key 本身能聊天;升级 OpenClaw 到较新版本后再试。 | -| 想要更多选项(多实例、HTTP、`install.sh` 细节、工具与排错表等) | 使用 **`install-powermem-memory-full`** skill(含 **config-reference.md**),或查阅 **[memory-powermem](https://github.com/ob-labs/memory-powermem)** 的 **README**。 | +| 想要更多选项(多实例、HTTP、`install.sh` 细节、工具与排错表等) | 使用 **`install-memory-powermem-full`** skill(含 **config-reference.md**),或查阅 **[memory-powermem](https://github.com/ob-labs/memory-powermem)** 的 **README**。 | ---