{"id":46729961,"url":"https://github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin","last_synced_at":"2026-03-23T16:01:06.622Z","repository":{"id":336973418,"uuid":"1147967845","full_name":"MemTensor/MemOS-Cloud-OpenClaw-Plugin","owner":"MemTensor","description":"Official MemOS Cloud plugin for OpenClaw. Enables long-term memory for agents by recalling context before execution and saving conversations after each run.","archived":false,"fork":false,"pushed_at":"2026-03-16T13:02:52.000Z","size":113,"stargazers_count":277,"open_issues_count":13,"forks_count":43,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-16T19:58:26.443Z","etag":null,"topics":["ai-memory","memos","memtensor","openclaw","openclaw-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/MemTensor.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-02-02T12:24:44.000Z","updated_at":"2026-03-16T14:28:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin","commit_stats":null,"previous_names":["memtensor/memos-cloud-openclaw-plugin"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MemTensor/MemOS-Cloud-OpenClaw-Plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MemTensor%2FMemOS-Cloud-OpenClaw-Plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MemTensor%2FMemOS-Cloud-OpenClaw-Plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MemTensor%2FMemOS-Cloud-OpenClaw-Plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MemTensor%2FMemOS-Cloud-OpenClaw-Plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MemTensor","download_url":"https://codeload.github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MemTensor%2FMemOS-Cloud-OpenClaw-Plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30863009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-23T14:38:03.667Z","status":"ssl_error","status_checked_at":"2026-03-23T14:38:01.683Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["ai-memory","memos","memtensor","openclaw","openclaw-plugin"],"created_at":"2026-03-09T15:00:26.394Z","updated_at":"2026-03-23T16:01:06.614Z","avatar_url":"https://github.com/MemTensor.png","language":"JavaScript","readme":"# MemOS Cloud OpenClaw Plugin (Lifecycle)\n\nOfficial plugin maintained by MemTensor.\n\nA minimal OpenClaw lifecycle plugin that **recalls** memories from MemOS Cloud before each run and **adds** new messages to MemOS Cloud after each run.\n\n## Features\n- **Recall**: `before_agent_start` → `/search/memory`\n- **Add**: `agent_end` → `/add/message`\n- Uses **Token** auth (`Authorization: Token \u003cMEMOS_API_KEY\u003e`)\n\n## Install\n\n### Option A — NPM (Recommended)\n```bash\nopenclaw plugins install @memtensor/memos-cloud-openclaw-plugin@latest\nopenclaw gateway restart\n```\n\n\u003e **Note for Windows Users**:\n\u003e If you encounter `Error: spawn EINVAL`, this is a known issue with OpenClaw's plugin installer on Windows. Please use **Option B** (Manual Install) below.\n\nMake sure it’s enabled in `~/.openclaw/openclaw.json`:\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"memos-cloud-openclaw-plugin\": { \"enabled\": true }\n    }\n  }\n}\n```\n\n### Option B — Manual Install (Workaround for Windows)\n1. Download the latest `.tgz` from [NPM](https://www.npmjs.com/package/@memtensor/memos-cloud-openclaw-plugin).\n2. Extract it to a local folder (e.g., `C:\\Users\\YourName\\.openclaw\\extensions\\memos-cloud-openclaw-plugin`).\n3. Configure `~/.openclaw/openclaw.json` (or `%USERPROFILE%\\.openclaw\\openclaw.json`):\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"memos-cloud-openclaw-plugin\": { \"enabled\": true }\n    },\n    \"load\": {\n      \"paths\": [\n        \"C:\\\\Users\\\\YourName\\\\.openclaw\\\\extensions\\\\memos-cloud-openclaw-plugin\\\\package\"\n      ]\n    }\n  }\n}\n```\n*Note: The extracted folder usually contains a `package` subfolder. Point to the folder containing `package.json`.*\n\nRestart the gateway after config changes.\n\n## Environment Variables\nThe plugin tries env files in order (**openclaw → moltbot → clawdbot**). For each key, the first file with a value wins.\nIf none of these files exist (or the key is missing), it falls back to the process environment.\n\n**Where to configure**\n- Files (priority order):\n  - `~/.openclaw/.env`\n  - `~/.moltbot/.env`\n  - `~/.clawdbot/.env`\n- Each line is `KEY=value`\n\n**Quick setup (shell)**\n```bash\necho 'export MEMOS_API_KEY=\"mpg-...\"' \u003e\u003e ~/.zshrc\nsource ~/.zshrc\n# or\n\necho 'export MEMOS_API_KEY=\"mpg-...\"' \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n\n**Quick setup (Windows PowerShell)**\n```powershell\n[System.Environment]::SetEnvironmentVariable(\"MEMOS_API_KEY\", \"mpg-...\", \"User\")\n```\n\nIf `MEMOS_API_KEY` is missing, the plugin will warn with setup instructions and the API key URL.\n\n**Minimal config**\n```env\nMEMOS_API_KEY=YOUR_TOKEN\n```\n\n**Optional config**\n- `MEMOS_BASE_URL` (default: `https://memos.memtensor.cn/api/openmem/v1`)\n- `MEMOS_API_KEY` (required; Token auth) — get it at https://memos-dashboard.openmem.net/cn/apikeys/\n- `MEMOS_USER_ID` (optional; default: `openclaw-user`)\n- `MEMOS_CONVERSATION_ID` (optional override)\n- `MEMOS_RECALL_GLOBAL` (default: `true`; when true, search does **not** pass conversation_id)\n- `MEMOS_MULTI_AGENT_MODE` (default: `false`; enable multi-agent data isolation)\n- `MEMOS_CONVERSATION_PREFIX` / `MEMOS_CONVERSATION_SUFFIX` (optional)\n- `MEMOS_CONVERSATION_SUFFIX_MODE` (`none` | `counter`, default: `none`)\n- `MEMOS_CONVERSATION_RESET_ON_NEW` (default: `true`, requires hooks.internal.enabled)\n- `MEMOS_RECALL_FILTER_ENABLED` (default: `false`; run model-based memory filtering before injection)\n- `MEMOS_RECALL_FILTER_BASE_URL` (OpenAI-compatible base URL, e.g. `http://127.0.0.1:11434/v1`)\n- `MEMOS_RECALL_FILTER_API_KEY` (optional; required if your endpoint needs auth)\n- `MEMOS_RECALL_FILTER_MODEL` (model name used to filter recall candidates)\n- `MEMOS_RECALL_FILTER_TIMEOUT_MS` (default: `6000`)\n- `MEMOS_RECALL_FILTER_RETRIES` (default: `0`)\n- `MEMOS_RECALL_FILTER_CANDIDATE_LIMIT` (default: `30` per category)\n- `MEMOS_RECALL_FILTER_MAX_ITEM_CHARS` (default: `500`)\n- `MEMOS_RECALL_FILTER_FAIL_OPEN` (default: `true`; fallback to unfiltered recall on failure)\n\n## Optional Plugin Config\nIn `plugins.entries.memos-cloud-openclaw-plugin.config`:\n```json\n{\n  \"baseUrl\": \"https://memos.memtensor.cn/api/openmem/v1\",\n  \"apiKey\": \"YOUR_API_KEY\",\n  \"userId\": \"memos_user_123\",\n  \"conversationId\": \"openclaw-main\",\n  \"queryPrefix\": \"important user context preferences decisions \",\n  \"recallEnabled\": true,\n  \"recallGlobal\": true,\n  \"addEnabled\": true,\n  \"captureStrategy\": \"last_turn\",\n  \"maxItemChars\": 8000,\n  \"includeAssistant\": true,\n  \"conversationIdPrefix\": \"\",\n  \"conversationIdSuffix\": \"\",\n  \"conversationSuffixMode\": \"none\",\n  \"resetOnNew\": true,\n  \"knowledgebaseIds\": [],\n  \"memoryLimitNumber\": 6,\n  \"preferenceLimitNumber\": 6,\n  \"includePreference\": true,\n  \"includeToolMemory\": false,\n  \"toolMemoryLimitNumber\": 6,\n  \"relativity\": 0.45,\n  \"tags\": [\"openclaw\"],\n  \"agentId\": \"\",\n  \"multiAgentMode\": false,\n  \"asyncMode\": true,\n  \"recallFilterEnabled\": false,\n  \"recallFilterBaseUrl\": \"http://127.0.0.1:11434/v1\",\n  \"recallFilterApiKey\": \"\",\n  \"recallFilterModel\": \"qwen2.5:7b\",\n  \"recallFilterTimeoutMs\": 6000,\n  \"recallFilterRetries\": 0,\n  \"recallFilterCandidateLimit\": 30,\n  \"recallFilterMaxItemChars\": 500,\n  \"recallFilterFailOpen\": true\n}\n```\n\n## How it Works\n- **Recall** (`before_agent_start`)\n  - Builds a `/search/memory` request using `user_id`, `query` (= prompt + optional prefix), and optional filters.\n  - Default **global recall**: when `recallGlobal=true`, it does **not** pass `conversation_id`.\n  - Optional second-pass filtering: if `recallFilterEnabled=true`, candidates are sent to your configured model and only returned `keep` items are injected.\n  - Injects a stable MemOS recall protocol via `appendSystemContext`, while the retrieved `\u003cmemories\u003e` block remains in `prependContext`.\n\n- **Add** (`agent_end`)\n  - Builds a `/add/message` request with the **last turn** by default (user + assistant).\n  - Sends `messages` with `user_id`, `conversation_id`, and optional `tags/info/agent_id/app_id`.\n\n## Multi-Agent Support\nThe plugin provides native support for multi-agent architectures (via the `agent_id` parameter):\n- **Enable Mode**: Set `\"multiAgentMode\": true` in config or `MEMOS_MULTI_AGENT_MODE=true` in env variables (default is `false`).\n- **Dynamic Context**: When enabled, it automatically captures `ctx.agentId` during OpenClaw lifecycle hooks. (Note: the default OpenClaw agent `\"main\"` is ignored to preserve backwards compatibility for single-agent users).\n- **Data Isolation**: The `agent_id` is automatically injected into both `/search/memory` and `/add/message` requests. This ensures completely isolated memory and message histories for different agents, even under the same user or session.\n- **Static Override**: You can also force a specific agent ID by setting `\"agentId\": \"your_agent_id\"` in the plugin's `config`.\n\n## Notes\n- `conversation_id` defaults to OpenClaw `sessionKey` (unless `conversationId` is provided). **TODO**: consider binding to OpenClaw `sessionId` directly.\n- Optional **prefix/suffix** via env or config; `conversationSuffixMode=counter` increments on `/new` (requires `hooks.internal.enabled`).\n\n## Acknowledgements\n- Thanks to @anatolykoptev (Contributor) — LinkedIn: https://www.linkedin.com/in/koptev?utm_source=share\u0026utm_campaign=share_via\u0026utm_content=profile\u0026utm_medium=ios_app\n","funding_links":[],"categories":["Skills vs Plugins: What's the Difference?","Plugins und Integrationen"],"sub_categories":["Bundled Plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMemTensor%2FMemOS-Cloud-OpenClaw-Plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMemTensor%2FMemOS-Cloud-OpenClaw-Plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMemTensor%2FMemOS-Cloud-OpenClaw-Plugin/lists"}