{"id":47589766,"url":"https://github.com/ob-labs/memory-powermem","last_synced_at":"2026-04-01T17:12:08.146Z","repository":{"id":335301626,"uuid":"1145143102","full_name":"ob-labs/memory-powermem","owner":"ob-labs","description":"openclaw(clawdbot) Plugin: give your bot long-term memory with PowerMem—smart extraction, Ebbinghaus recall, multi-agent isolation.","archived":false,"fork":false,"pushed_at":"2026-03-18T08:55:51.000Z","size":419,"stargazers_count":7,"open_issues_count":3,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T00:17:45.966Z","etag":null,"topics":["agent","llm","long-short-term-memory","memory","molbot","openclaw","openclaw-extension","openclaw-plugin","openclaw-skills","powermem"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ob-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-29T13:33:19.000Z","updated_at":"2026-03-18T08:45:44.000Z","dependencies_parsed_at":"2026-03-09T21:04:46.866Z","dependency_job_id":null,"html_url":"https://github.com/ob-labs/memory-powermem","commit_stats":null,"previous_names":["ob-labs/moltbot-extension-powermem","ob-labs/openclaw-extension-powermem","ob-labs/memory-powermem"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ob-labs/memory-powermem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ob-labs%2Fmemory-powermem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ob-labs%2Fmemory-powermem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ob-labs%2Fmemory-powermem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ob-labs%2Fmemory-powermem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ob-labs","download_url":"https://codeload.github.com/ob-labs/memory-powermem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ob-labs%2Fmemory-powermem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","llm","long-short-term-memory","memory","molbot","openclaw","openclaw-extension","openclaw-plugin","openclaw-skills","powermem"],"created_at":"2026-04-01T17:12:06.833Z","updated_at":"2026-04-01T17:12:08.140Z","avatar_url":"https://github.com/ob-labs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\n*[PowerMem](https://github.com/oceanbase/powermem) + [OpenClaw](https://github.com/openclaw/openclaw): maximum token savings for AI agents.*\n\n\u003cimg src=\"docs/images/openclaw_powermem.jpeg\" alt=\"PowerMem with OpenClaw\" width=\"900\"/\u003e\n\n\u003c/p\u003e\n\n# OpenClaw Memory (PowerMem) Plugin\n\nThis plugin lets [OpenClaw](https://github.com/openclaw/openclaw) use long-term memory via [PowerMem](https://github.com/oceanbase/powermem): intelligent extraction, Ebbinghaus forgetting curve, multi-agent isolation.\n\n**Default:** **CLI mode** — the plugin runs `pmem` locally (no `powermem-server`). Use **HTTP mode** when you already run a shared PowerMem API (teams / enterprise).\n\nFollow the steps in order: install PowerMem, then install the plugin, configure OpenClaw (defaults work for CLI + `~/.openclaw/powermem/powermem.env`), and verify.\n\n---\n\n## Prerequisites\n\n- **OpenClaw** installed (CLI + gateway working)\n- **PowerMem** installed (`pip install powermem`) with `pmem` available — either on PATH when you start the gateway, or via absolute `pmemPath` in plugin config\n- **`.env` for PowerMem** with at least database + LLM + Embedding (see [PowerMem `.env.example`](https://github.com/oceanbase/powermem/blob/master/.env.example)); for individuals, prefer `~/.openclaw/powermem/powermem.env` and SQLite\n\n---\n\n## Step 1: Install and start PowerMem\n\nChoose **Option A (CLI, recommended for OpenClaw individuals)**, **Option B (HTTP + pip)**, or **Option C (Docker)**.\n\n### Option A: CLI + SQLite (recommended for individuals)\n\nNo HTTP server. Matches the plugin’s **default** (`mode: cli`).\n\n1. **Install PowerMem** (venv recommended):\n\n   ```bash\n   python3 -m venv ~/.openclaw/powermem/.venv\n   source ~/.openclaw/powermem/.venv/bin/activate\n   pip install powermem\n   ```\n\n2. **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.\n\n3. If `pmem` exists only inside the venv, set `pmemPath` in the plugin `config` to the absolute path of `pmem` in that venv.\n\n4. **Verify** — With venv activated: `pmem --version`. After gateway start: `openclaw ltm health`.\n\n---\n\n### Option B: Install with pip (run HTTP server locally)\n\nUse this when you want a **standalone API** or are not using CLI mode. Best if you already have Python 3.11+ on the machine.\n\n**1. Install PowerMem**\n\n```bash\npip install powermem\n```\n\n**2. Prepare config**\n\nIn **any directory** where you want to keep config (e.g. `~/powermem`):\n\n```bash\nmkdir -p ~/powermem \u0026\u0026 cd ~/powermem\n# Copy from PowerMem repo: if you cloned it, run: cp /path/to/powermem/.env.example .env\n```\n\nIf you did not clone the PowerMem repo, create a `.env` with at least: database + LLM + Embedding. Here is a **minimal working example** (OceanBase + Qwen; replace with your API key and DB credentials):\n\n```bash\n# Create .env in ~/powermem (replace your_api_key_here and your_password)\ncat \u003e .env \u003c\u003c 'EOF'\nTIMEZONE=Asia/Shanghai\nDATABASE_PROVIDER=oceanbase\n\nOCEANBASE_HOST=127.0.0.1\nOCEANBASE_PORT=2881\nOCEANBASE_USER=root@sys\nOCEANBASE_PASSWORD=your_password\nOCEANBASE_DATABASE=powermem\nOCEANBASE_COLLECTION=memories\n\nLLM_PROVIDER=qwen\nLLM_API_KEY=your_api_key_here\nLLM_MODEL=qwen-plus\n\nEMBEDDING_PROVIDER=qwen\nEMBEDDING_API_KEY=your_api_key_here\nEMBEDDING_MODEL=text-embedding-v4\nEMBEDDING_DIMS=1536\nEOF\n```\n\nReplace `your_api_key_here` with your Tongyi Qwen API key (and set `your_password` and other DB fields as needed for OceanBase). For OpenAI or other providers, see PowerMem’s [.env.example](https://github.com/oceanbase/powermem/blob/master/.env.example) for `LLM_*` and `EMBEDDING_*`.\n\n**3. Start the HTTP server**\n\nRun this **in the same directory as `.env`**:\n\n```bash\ncd ~/powermem   # or wherever .env lives\npowermem-server --host 0.0.0.0 --port 8000\n```\n\nYou should see something like `Uvicorn running on http://0.0.0.0:8000`. Leave this terminal open.\n\n**4. Verify PowerMem**\n\nIn a new terminal:\n\n```bash\ncurl -s http://localhost:8000/api/v1/system/health\n```\n\nIf you get JSON (e.g. with `\"status\":\"healthy\"`), PowerMem is ready.\n\n---\n\n### Option C: Run with Docker (no Python needed)\n\nBest if you have Docker and prefer not to install Python.\n\n**1. Clone PowerMem and prepare .env**\n\n```bash\ngit clone https://github.com/oceanbase/powermem.git\ncd powermem\ncp .env.example .env\n```\n\nEdit `.env` and set at least:\n\n- `LLM_API_KEY`, `LLM_PROVIDER`, `LLM_MODEL`\n- `EMBEDDING_API_KEY`, `EMBEDDING_PROVIDER`, `EMBEDDING_MODEL`\n\nDatabase: OceanBase is recommended.\n\n**2. Start the container**\n\nFrom the **powermem project root** (same level as `.env`):\n\n```bash\ndocker-compose -f docker/docker-compose.yml up -d\n```\n\n**3. Verify**\n\n```bash\ncurl -s http://localhost:8000/api/v1/system/health\n```\n\nJSON response means the server is up. API docs: `http://localhost:8000/docs`.\n\n---\n\n## Install options\n\n- **One-click (Linux/macOS):**  \n  ```bash\n  curl -fsSL https://raw.githubusercontent.com/ob-labs/memory-powermem/main/install.sh | bash\n  ```  \n  From a clone: `cd /path/to/memory-powermem \u0026\u0026 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/)).\n- **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”**.  \n- **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.\n- **Manual:** Steps below.\n\n---\n\n## Step 2: Install the plugin into OpenClaw\n\nOn your machine (use your actual plugin path):\n\n```bash\n# Install from npm (recommended for end users; downloads and installs from the official npm registry)\nopenclaw plugins install memory-powermem\n\n# Install from a local directory (e.g. cloned repo)\nopenclaw plugins install /path/to/memory-powermem\n\n# For development (symlink, no copy)\nopenclaw plugins install -l /path/to/memory-powermem\n```\n\n**Note:** Running `npm i memory-powermem` in a Node project only adds the package to that project’s `node_modules`; it does **not** register the plugin with OpenClaw. To use this as an OpenClaw plugin, you must run `openclaw plugins install memory-powermem` (or install from a path as above), then restart the gateway.\n\nAfter install, run `openclaw plugins list` and confirm `memory-powermem` is listed. With **no** `plugins.entries[\"memory-powermem\"].config`, the plugin uses **defaults**: `mode: \"cli\"`, `envFile` under `~/.openclaw/powermem/powermem.env`, `pmemPath: \"pmem\"`, plus `autoCapture` / `autoRecall` / `inferOnAdd` enabled. Ensure `pmem` is on PATH (or set `pmemPath`) and the env file exists and is valid.\n\n---\n\n## Step 3: Configure OpenClaw (optional)\n\nIf you use **CLI mode** with the default paths and `pmem` on PATH, you can skip this step. Customize for HTTP, a different URL/API key, or a non-default `envFile` / `pmemPath`.\n\n**CLI (default):**\n\n```json\n{\n  \"plugins\": {\n    \"slots\": { \"memory\": \"memory-powermem\" },\n    \"entries\": {\n      \"memory-powermem\": {\n        \"enabled\": true,\n        \"config\": {\n          \"mode\": \"cli\",\n          \"envFile\": \"/home/you/.openclaw/powermem/powermem.env\",\n          \"pmemPath\": \"pmem\",\n          \"autoCapture\": true,\n          \"autoRecall\": true,\n          \"inferOnAdd\": true\n        }\n      }\n    }\n  }\n}\n```\n\n**HTTP (shared server):**\n\n```json\n\"config\": {\n  \"mode\": \"http\",\n  \"baseUrl\": \"http://localhost:8000\",\n  \"autoCapture\": true,\n  \"autoRecall\": true,\n  \"inferOnAdd\": true\n}\n```\n\nNotes:\n\n- **CLI (default):** You may omit `mode` and use CLI when `baseUrl` is empty; use `envFile` + `pmemPath`.\n- **HTTP:** When `mode` is `http`, `baseUrl` is required; if you set `baseUrl` without `mode`, the plugin treats it as HTTP. Do **not** append `/api/v1` to `baseUrl`. If the server uses API key auth, add `\"apiKey\"`.\n- **Restart the OpenClaw gateway** (or Mac menubar app) after changing config.\n\n---\n\n## Step 4: Verify plugin and PowerMem connection\n\nIn a terminal:\n\n```bash\n# Check whether PowerMem is reachable\nopenclaw ltm health\n```\n\nIf there are no errors and you see a healthy status, the plugin is talking to PowerMem.\n\nThen try a manual add and search:\n\n```bash\n# Add a memory\nopenclaw ltm add \"I prefer a cup of Americano every morning\"\n\n# Search by content\nopenclaw ltm search \"coffee\"\n```\n\nIf search returns what you just added (or similar content), the full flow (install PowerMem → install plugin → configure OpenClaw) is working end to end.\n\n---\n\n## OpenClaw plugin commands (reference)\n\nCommon CLI commands for managing plugins:\n\n| Command | Description |\n|---------|-------------|\n| `openclaw plugins list` | List installed plugins; confirm `memory-powermem` is listed. Use `--json` for machine-readable output. |\n| `openclaw plugins info \u003cid\u003e` | Show details for a plugin (e.g. `openclaw plugins info memory-powermem`). |\n| `openclaw plugins uninstall \u003cid\u003e` | Remove the plugin (e.g. `openclaw plugins uninstall memory-powermem`). Use `--keep-files` to leave files on disk. |\n| `openclaw plugins enable \u003cid\u003e` | Enable a disabled plugin. |\n| `openclaw plugins disable \u003cid\u003e` | Disable a plugin without uninstalling. |\n| `openclaw plugins doctor` | Diagnose plugin load and configuration issues. |\n| `openclaw plugins update \u003cid\u003e` | Update a plugin installed from npm. Use `openclaw plugins update --all` to update all. |\n\nAfter installing, uninstalling, or changing config, restart the OpenClaw gateway for changes to take effect.\n\n---\n\n## Config options (optional)\n\n| Option        | Required | Description |\n|---------------|----------|-------------|\n| `mode`        | No       | Backend: `\"cli\"` (default) or `\"http\"`. If omitted, non-empty `baseUrl` implies `http`. |\n| `baseUrl`     | Yes (http) | PowerMem API base URL when `mode` is `http`, e.g. `http://localhost:8000`, no `/api/v1` suffix. |\n| `apiKey`      | No       | Set when PowerMem server has API key authentication enabled (http mode). |\n| `envFile`     | No       | CLI: path to PowerMem `.env` (default when using plugin defaults: `~/.openclaw/powermem/powermem.env`). |\n| `pmemPath`    | No       | CLI: path to `pmem` executable; default `pmem`. |\n| `userId`      | No       | User isolation (multi-user); default `openclaw-user`. |\n| `agentId`     | No       | Agent isolation (multi-agent); default `openclaw-agent`. |\n| `autoCapture` | No       | Auto-store from conversations after agent ends; default `true`. |\n| `autoRecall`  | No       | Auto-inject relevant memories before agent starts; default `true`. |\n| `inferOnAdd`  | No       | Use PowerMem intelligent extraction when adding; default `true`. |\n\n**Auto-capture:** When a session ends, this round’s user/assistant text is sent to PowerMem (`infer: true`) for extraction and storage. At most 3 items per round, each up to about 6000 characters.\n\n---\n\n## Agent tools\n\nExposed to OpenClaw agents:\n\n- **memory_recall** — Search long-term memories by query.\n- **memory_store** — Store one memory (optional intelligent extraction on write).\n- **memory_forget** — Delete by memory ID or by search query.\n\n---\n\n## OpenClaw CLI (when plugin enabled)\n\n- `openclaw ltm search \u003cquery\u003e [--limit n]` — Search memories.\n- `openclaw ltm health` — Check PowerMem service health.\n- `openclaw ltm add \"\u003ctext\u003e\"` — Manually store one memory.\n\n---\n\n## Troubleshooting\n\n**1. `openclaw ltm health` fails or cannot connect**\n\n- **CLI:** `pmem` on PATH or correct `pmemPath`; valid `.env` at `envFile`.\n- **HTTP:** PowerMem is running (HTTP server in a terminal, or Docker); `baseUrl` is correct (e.g. `http://localhost:8000`; watch for `127.0.0.1` vs `localhost` mismatches).\n- Remote server: use the host IP or hostname instead of `localhost`.\n\n**2. Add/search returns nothing or 500**\n\n- Check PowerMem terminal or Docker logs; often LLM/Embedding not configured or wrong API key.\n- Ensure `LLM_API_KEY` and `EMBEDDING_API_KEY` in `.env` are set and valid.\n\n**3. Plugin installed but OpenClaw not using memory**\n\n- Confirm `plugins.slots.memory` is `memory-powermem` and `plugins.entries[\"memory-powermem\"].enabled` is `true`.\n- Restart the gateway (or OpenClaw app) after config changes.\n\n**4. Agent does not search memory until I ask it to**\n\n- With `autoRecall: true`, the plugin injects system guidance so the agent is told to use `memory_recall` (or injected `\u003crelevant-memories\u003e`) when answering about past events, preferences, or people. Ensure `autoRecall` is not set to `false`.\n- Auto-recall runs before each turn using the current user message (or the previous user message if the prompt is very short). If the agent still replies without querying memory, try saying explicitly once “check memory for …” to confirm the pipeline; ensure the Web session after `/new` uses the same gateway and plugin.\n\n**5. Agent tries to read `memory/YYYY-MM-DD.md` and gets ENOENT**\n\n- OpenClaw's built-in **session-memory** hook writes session snapshots to workspace `memory/YYYY-MM-DD-slug.md`. When you use PowerMem as the memory slot, the agent may still be told (by workspace docs or inference) to load those files, causing failed `read` calls. Disable the hook so only PowerMem is used: run `openclaw hooks disable session-memory`, or set `hooks.internal.entries[\"session-memory\"].enabled` to `false` in `~/.openclaw/openclaw.json`. Restart the gateway after changing config.\n\n---\n\n## Development\n\n```bash\ncd /path/to/memory-powermem\npnpm install\npnpm lint   # type-check\npnpm test   # run tests (if any)\n```\n\n---\n\n## License\n\nApache License 2.0. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fob-labs%2Fmemory-powermem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fob-labs%2Fmemory-powermem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fob-labs%2Fmemory-powermem/lists"}