{"_id":"@adbpg-ai/openclaw-mem0","name":"@adbpg-ai/openclaw-mem0","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@adbpg-ai/openclaw-mem0","version":"1.0.1","type":"module","description":"OpenClaw memory plugin for AnalyticDB for PostgreSQL Long-Term Memory service. Apache-2.0 fork of @mem0/openclaw-mem0 with self-hosted endpoint compatibility.","license":"Apache-2.0","author":{"name":"Alibaba Cloud AnalyticDB Team"},"homepage":"https://help.aliyun.com/zh/analyticdb/analyticdb-for-postgresql/","repository":{"type":"git","url":"git+https://github.com/shaohuaxi/adbpg-ai-openclaw-mem0.git"},"bugs":{"url":"https://github.com/shaohuaxi/adbpg-ai-openclaw-mem0/issues"},"keywords":["openclaw","plugin","memory","long-term-memory","adbpg","analyticdb","alibaba-cloud","mem0-compatible"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsup","test":"vitest run"},"dependencies":{"@sinclair/typebox":"0.34.47","mem0ai":"3.0.3"},"openclaw":{"extensions":["./dist/index.js"],"compat":{"pluginApi":">=2026.4.24","minGatewayVersion":">=2026.4.24"},"build":{"openclawVersion":"2026.4.24","pluginSdkVersion":"2026.4.24"},"install":{"npmSpec":"@adbpg-ai/openclaw-mem0"}},"devDependencies":{"@types/node":"^22.15.0","@vitest/coverage-v8":"^4.0.18","tsup":"^8.5.0","typescript":"^5.8.3","vitest":"^4.0.18"},"pnpm":{"overrides":{"protobufjs@<7.5.5":"^7.5.5"}},"_id":"@adbpg-ai/openclaw-mem0@1.0.1","gitHead":"34755abeba6114b41fdac463783a7cc198653957","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-eQ9JztEHpCS1tpVTtPD9D+MIuJGIJ1caf6fKjUPe9jSHcqjLJsOGP7Us/xh2JAtMo3lLH2zY+xsPNXME6PtF/Q==","shasum":"9d0df28ee349937b470b2ee400defdae217410d2","tarball":"https://registry.npmjs.org/@adbpg-ai/openclaw-mem0/-/openclaw-mem0-1.0.1.tgz","fileCount":18,"unpackedSize":670874,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFUgH3MOrcXC8fbkHIcTIttk+j17grL6l50TVhXlOiP5AiEAs55eMTPZ2zBqWltPa8sOysQcHsrVPbcm6a6MtQpR2L0="}]},"_npmUser":{"name":"adbpg-ai","email":"huaxi.shx@alibaba-inc.com"},"directories":{},"maintainers":[{"name":"adbpg-ai","email":"huaxi.shx@alibaba-inc.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openclaw-mem0_1.0.1_1780545441648_0.9060801090445247"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T03:57:21.458Z","1.0.1":"2026-06-04T03:57:21.813Z","modified":"2026-06-04T03:57:22.023Z"},"maintainers":[{"name":"adbpg-ai","email":"huaxi.shx@alibaba-inc.com"}],"description":"OpenClaw memory plugin for AnalyticDB for PostgreSQL Long-Term Memory service. Apache-2.0 fork of @mem0/openclaw-mem0 with self-hosted endpoint compatibility.","homepage":"https://help.aliyun.com/zh/analyticdb/analyticdb-for-postgresql/","keywords":["openclaw","plugin","memory","long-term-memory","adbpg","analyticdb","alibaba-cloud","mem0-compatible"],"repository":{"type":"git","url":"git+https://github.com/shaohuaxi/adbpg-ai-openclaw-mem0.git"},"author":{"name":"Alibaba Cloud AnalyticDB Team"},"bugs":{"url":"https://github.com/shaohuaxi/adbpg-ai-openclaw-mem0/issues"},"license":"Apache-2.0","readme":"# @adbpg-ai/openclaw-mem0\n\nOpenClaw memory plugin for [AnalyticDB for PostgreSQL Long-Term Memory](https://help.aliyun.com/zh/analyticdb/analyticdb-for-postgresql/) service.\n\nLets your OpenClaw agent use ADBPG Long-Term Memory as its persistent, cross-session memory backend — auto-recall before each turn, auto-capture after, and a CLI for direct read/write.\n\n> [!IMPORTANT]\n> **Disclaimer.** This package is an Apache-2.0 fork of the upstream\n> [`@mem0/openclaw-mem0`](https://www.npmjs.com/package/@mem0/openclaw-mem0)\n> plugin (Copyright 2023 Taranjeet Singh and the Mem0 contributors), modified\n> by Alibaba Cloud to add self-hosted endpoint compatibility. \"Mem0\" and\n> \"mem-zero\" are trademarks of [mem0.ai](https://mem0.ai); this package is\n> not endorsed by, sponsored by, or otherwise affiliated with mem0.ai.\n> See [`NOTICE`](./NOTICE) for the full attribution and modification log.\n\n## Why this fork\n\nUpstream `@mem0/openclaw-mem0` is designed for the Mem0 SaaS platform at\n`api.mem0.ai`. Its embedded SDK probes `GET /v1/ping/` before any\n`add` / `search` call and parses the response in a Mem0-cloud-specific\nshape. That probe blocks the plugin from talking to other Mem0 protocol-\ncompatible services that expose the same `/v3/memories/...` surface but\ndon't return a Mem0-cloud-shaped ping body.\n\nThis fork adds a 9-line guard to `PlatformProvider._init()` so the probe\nis skipped whenever `baseUrl` points at a non-`api.mem0.ai` host. The\nupstream `add` / `search` codepaths (which use the same `/v3/memories/add/`\nand `/v3/memories/search/` endpoints, the same `Authorization: Token`\nheader, and the same `{query, filters, top_k}` request body that ADBPG\nLong-Term Memory implements) work unmodified. Telemetry phone-home is\nalso disabled for non-`api.mem0.ai` deployments as a privacy side benefit.\n\nThe plugin id remains `openclaw-mem0`, so this is a **drop-in replacement**\nfor the upstream package. Existing `plugins.slots.memory: \"openclaw-mem0\"`\nconfiguration continues to work without changes.\n\n## Requirements\n\n- OpenClaw gateway `>= 2026.4.24` (recommended: latest)\n- Node.js `>= 22.19` (recommended: 24 LTS)\n- An ADBPG Long-Term Memory endpoint and API key — see\n  [the ADBPG documentation](https://help.aliyun.com/zh/analyticdb/analyticdb-for-postgresql/)\n  for how to provision one\n\n## Install\n\n```bash\nopenclaw plugins install @adbpg-ai/openclaw-mem0\n```\n\nBecause the plugin id remains `openclaw-mem0`, OpenClaw will refuse to\ninstall this alongside the upstream `@mem0/openclaw-mem0`. If you have\nthe upstream package installed, uninstall it first:\n\n```bash\nopenclaw plugins uninstall openclaw-mem0\nopenclaw plugins install @adbpg-ai/openclaw-mem0\n```\n\n## Configure (ADBPG Long-Term Memory)\n\nAdd the following to `~/.openclaw/openclaw.json`:\n\n```json5\n{\n  \"plugins\": {\n    \"slots\": { \"memory\": \"openclaw-mem0\" },\n    \"entries\": {\n      \"openclaw-mem0\": {\n        \"enabled\": true,\n        \"config\": {\n          \"mode\": \"platform\",\n          \"apiKey\": \"${ADBPG_LONGMEMORY_TOKEN}\",\n          \"baseUrl\": \"https://api-longmemory-cn-chengdu.opentrust.net\",\n          \"userId\": \"alice\"\n        }\n      }\n    }\n  }\n}\n```\n\nReplace `userId` with your application's per-user identifier (any stable\nstring you choose). Replace `baseUrl` with the regional endpoint shown in\nyour ADBPG console. Inject the API token as an environment variable, e.g.\nin `~/.bashrc`:\n\n```bash\nexport ADBPG_LONGMEMORY_TOKEN=sk-xxxxxxxxxxxxx\n```\n\nOpenClaw resolves `${ADBPG_LONGMEMORY_TOKEN}` at gateway startup before\nthe plugin sees it. The `~/.openclaw/openclaw.json` file is created with\nmode `0600` (owner-readable only); avoid committing it to source control.\n\nRestart the gateway:\n\n```bash\nopenclaw gateway restart\n```\n\n## Verify\n\n```bash\n# Health\nopenclaw mem0 status                                # → \"Connected to Mem0\"\n\n# Write\nopenclaw mem0 add \"User prefers dark mode\" --user-id alice\n\n# (ADBPG processes asynchronously; allow a few seconds)\nsleep 8\n\n# Search\nopenclaw mem0 search \"UI preferences\" --user-id alice\n\n# List\nopenclaw mem0 list --user-id alice\n```\n\n## Configure (Mem0 Cloud, alternative)\n\nThis fork also works against the upstream Mem0 Cloud — simply omit\n`baseUrl`:\n\n```json5\n\"openclaw-mem0\": {\n  \"enabled\": true,\n  \"config\": {\n    \"mode\": \"platform\",\n    \"apiKey\": \"${MEM0_API_KEY}\",\n    \"userId\": \"alice\"\n  }\n}\n```\n\nWhen `baseUrl` is unset (or set to `api.mem0.ai`), the upstream codepath\nruns unchanged — including telemetry phone-home and `/v1/ping/` probing.\n\n## Open-source mode (in-process)\n\nThe upstream open-source mode (running mem0's in-process SDK with your\nown LLM, embedder, and vector store) is preserved unchanged. See\n[`docs.mem0.ai/open-source/node-quickstart`](https://docs.mem0.ai/open-source/node-quickstart)\nfor upstream documentation.\n\n```json5\n\"openclaw-mem0\": {\n  \"enabled\": true,\n  \"config\": {\n    \"mode\": \"open-source\",\n    \"userId\": \"alice\"\n  }\n}\n```\n\n## CLI reference\n\nAll upstream `openclaw mem0 <subcommand>` commands work unchanged. See\nupstream README for full coverage. Common ones:\n\n```bash\nopenclaw mem0 status\nopenclaw mem0 add \"...\"        --user-id <uid>\nopenclaw mem0 search \"...\"     --user-id <uid>\nopenclaw mem0 list             --user-id <uid>\nopenclaw mem0 get   <memory_id>\nopenclaw mem0 update <memory_id> \"...\"\nopenclaw mem0 delete <memory_id>\nopenclaw mem0 delete --all     --user-id <uid> --confirm\n```\n\n## Architecture\n\n```\n                        ┌─────────────────────────┐\n   OpenClaw  ─────────► │   openclaw-mem0 plugin  │\n   gateway     hooks    │   (this package)        │\n                        └────────────┬────────────┘\n                                     │ uses mem0ai SDK\n                                     ▼\n                        ┌─────────────────────────┐\n                        │ ADBPG Long-Term Memory  │\n                        │ POST /v3/memories/add/  │\n                        │ POST /v3/memories/search/\n                        │ Authorization: Token …  │\n                        └─────────────────────────┘\n```\n\n## Building from source\n\n```bash\ngit clone https://github.com/aliyun/adbpg-ai-openclaw-mem0\ncd adbpg-ai-openclaw-mem0\npnpm install\npnpm run build       # → dist/\npnpm run test        # vitest\n```\n\n## License\n\nApache License 2.0 — see [`LICENSE`](./LICENSE) for the full text and\n[`NOTICE`](./NOTICE) for attribution and modification log relative to the\nupstream `@mem0/openclaw-mem0` package.\n\n## Trademark\n\n\"Mem0\" and \"mem-zero\" are trademarks of mem0.ai. \"OpenClaw\" is a\ntrademark of its respective owner. Use of those marks in this package is\nlimited to reasonable and customary descriptive reference, as permitted\nby Section 6 of the Apache License, Version 2.0. This package is not\nendorsed by, sponsored by, or otherwise affiliated with mem0.ai.\n\n\"AnalyticDB\" and \"AnalyticDB for PostgreSQL\" are trademarks of Alibaba\nCloud Computing Co., Ltd.\n","readmeFilename":"README.md","_rev":"1-93fbf502b4f6eb31159113ec0ad1324b"}