{"_id":"@dangvv/openclaw-mem0","_rev":"4-31ce4dbf27b6d5ff212d7ca891e9f811","name":"@dangvv/openclaw-mem0","dist-tags":{"latest":"0.3.3"},"versions":{"0.3.0":{"name":"@dangvv/openclaw-mem0","version":"0.3.0","keywords":["openclaw","plugin","memory","mem0","long-term-memory"],"license":"Apache-2.0","_id":"@dangvv/openclaw-mem0@0.3.0","maintainers":[{"name":"dangvv","email":"devops95nd@gmail.com"}],"dist":{"shasum":"d51b11a9e3b91fc1600c44934ba4b80bbac0ea1f","tarball":"https://registry.npmjs.org/@dangvv/openclaw-mem0/-/openclaw-mem0-0.3.0.tgz","fileCount":6,"integrity":"sha512-fl16Gnjz5UfX7qc73u2dhKRTdFu6cC6y1p1s40aSEVLACQ4X3tieoxhw1t/kFgXva//EuRUQ1vONvy4HoEEakA==","signatures":[{"sig":"MEYCIQCOzBMMRlHUzQZdNnJqAVn5e+8sj4wXNmEh6hP0vrw8rgIhAM7Wr7g0je/UN2aBUqmg3oZcl8V+gLq4DUI309aezKZW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74690},"type":"module","scripts":{"test":"vitest run","postinstall":"patch-package"},"_npmUser":{"name":"dangvv","email":"devops95nd@gmail.com"},"openclaw":{"extensions":["./index.ts"]},"_npmVersion":"10.9.4","description":"Mem0 memory backend for OpenClaw — platform or self-hosted open-source","directories":{},"_nodeVersion":"22.22.1","dependencies":{"mem0ai":"^2.2.1","@sinclair/typebox":"0.34.47"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18","patch-package":"^8.0.1"},"_npmOperationalInternal":{"tmp":"tmp/openclaw-mem0_0.3.0_1773203527732_0.337279387854476","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@dangvv/openclaw-mem0","version":"0.3.1","keywords":["openclaw","plugin","memory","mem0","long-term-memory"],"license":"Apache-2.0","_id":"@dangvv/openclaw-mem0@0.3.1","maintainers":[{"name":"dangvv","email":"devops95nd@gmail.com"}],"dist":{"shasum":"39a1e67de6f2669669b97d46d113528c874d529a","tarball":"https://registry.npmjs.org/@dangvv/openclaw-mem0/-/openclaw-mem0-0.3.1.tgz","fileCount":6,"integrity":"sha512-TY4ZM9geFX9eNrdtqVlfjysVTuABUsvXiWlTLP6/cOjr/1d5f0ldFp/APfY2o/otaNolvz15BHL5l4X7ujOyDQ==","signatures":[{"sig":"MEUCIGvWBO5SLMpFhgH5qoZAdB6revtY0++NKX82J0oW23o7AiEAx7aicFo2pa4hcmCLcST+EG4Ys25eSy5fSbe/on1lDVM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":75170},"type":"module","scripts":{"test":"vitest run","postinstall":"patch-package"},"_npmUser":{"name":"dangvv","email":"devops95nd@gmail.com"},"openclaw":{"extensions":["./index.ts"]},"_npmVersion":"10.9.4","description":"Mem0 memory backend for OpenClaw — platform or self-hosted open-source","directories":{},"_nodeVersion":"22.22.1","dependencies":{"pg":"8.11.3","redis":"^4.6.13","mem0ai":"^2.2.1","ollama":"^0.5.14","groq-sdk":"0.3.0","cloudflare":"^4.2.0","neo4j-driver":"^5.28.1","@google/genai":"^1.2.0","patch-package":"^8.0.1","better-sqlite3":"^12.6.2","@azure/identity":"^4.0.0","@langchain/core":"^0.3.44","@anthropic-ai/sdk":"^0.40.1","@sinclair/typebox":"0.34.47","@mistralai/mistralai":"^1.5.2","@supabase/supabase-js":"^2.49.1","@qdrant/js-client-rest":"1.13.0","@azure/search-documents":"^12.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/openclaw-mem0_0.3.1_1773222283453_0.006919936404033766","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@dangvv/openclaw-mem0","version":"0.3.2","keywords":["openclaw","plugin","memory","mem0","long-term-memory"],"license":"Apache-2.0","_id":"@dangvv/openclaw-mem0@0.3.2","maintainers":[{"name":"dangvv","email":"devops95nd@gmail.com"}],"dist":{"shasum":"d2c6e57cd37aea828a6ef8f1f8ffe8430ff67baf","tarball":"https://registry.npmjs.org/@dangvv/openclaw-mem0/-/openclaw-mem0-0.3.2.tgz","fileCount":6,"integrity":"sha512-gX5j9YOx4oujZQGPcDIQrchNTlHeXW+zB1YZCaiGdjfCQwV1ESeP2QALtXgjNEitdmmPdyG5zSuFvyxQGCjSgQ==","signatures":[{"sig":"MEUCIQCvArj6UoAvd6J/HLHNwwx/0c65rCxS0P3g2Sa9xRaB1gIgSFbEBwCnHzIAKYKrz7aZ1h+ZkHaYEND2kJwv8QKYfo0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":75741},"type":"module","scripts":{"test":"vitest run","postinstall":"patch-package"},"_npmUser":{"name":"dangvv","email":"devops95nd@gmail.com"},"openclaw":{"extensions":["./index.ts"]},"_npmVersion":"10.9.4","description":"Mem0 memory backend for OpenClaw — platform or self-hosted open-source","directories":{},"_nodeVersion":"22.22.1","dependencies":{"pg":"8.11.3","redis":"^4.6.13","mem0ai":"^2.2.1","ollama":"^0.5.14","groq-sdk":"0.3.0","cloudflare":"^4.2.0","neo4j-driver":"^5.28.1","@google/genai":"^1.2.0","patch-package":"^8.0.1","better-sqlite3":"^12.6.2","@azure/identity":"^4.0.0","@langchain/core":"^0.3.44","@anthropic-ai/sdk":"^0.40.1","@sinclair/typebox":"0.34.47","@mistralai/mistralai":"^1.5.2","@supabase/supabase-js":"^2.49.1","@qdrant/js-client-rest":"1.13.0","@azure/search-documents":"^12.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/openclaw-mem0_0.3.2_1773223123096_0.262686372353937","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@dangvv/openclaw-mem0","version":"0.3.3","type":"module","description":"Mem0 memory backend for OpenClaw — platform or self-hosted open-source","license":"Apache-2.0","keywords":["openclaw","plugin","memory","mem0","long-term-memory"],"scripts":{"postinstall":"patch-package","test":"vitest run"},"dependencies":{"@anthropic-ai/sdk":"^0.40.1","@azure/identity":"^4.0.0","@azure/search-documents":"^12.0.0","@sinclair/typebox":"0.34.47","@google/genai":"^1.2.0","@langchain/core":"^0.3.44","@mistralai/mistralai":"^1.5.2","@qdrant/js-client-rest":"1.13.0","@supabase/supabase-js":"^2.49.1","better-sqlite3":"^12.6.2","cloudflare":"^4.2.0","groq-sdk":"0.3.0","mem0ai":"^2.2.1","neo4j-driver":"^5.28.1","ollama":"^0.5.14","patch-package":"^8.0.1","pg":"8.11.3","redis":"^4.6.13"},"openclaw":{"extensions":["./index.ts"]},"devDependencies":{"vitest":"^4.0.18"},"_id":"@dangvv/openclaw-mem0@0.3.3","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-zQ5Qg7upXFPJpoVK7gAEPoCcpsEf+TGZjTy1SsbhKFaoZBm7aEYsRG0rer73GnhsPzCGAZzukl2PeiClY8Q3PA==","shasum":"956b7d80a71d24355266f760b9cc9b4a9ea406c2","tarball":"https://registry.npmjs.org/@dangvv/openclaw-mem0/-/openclaw-mem0-0.3.3.tgz","fileCount":6,"unpackedSize":76632,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBJ0GD5WnwT3SDj0sYiLxeUlwtjRDfxLOxpRjUqeID2pAiEAh0tH4Q3Sz8ze6HO2nARHwbi/lYSHYlC5dtW1eyTmTas="}]},"_npmUser":{"name":"dangvv","email":"devops95nd@gmail.com"},"directories":{},"maintainers":[{"name":"dangvv","email":"devops95nd@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openclaw-mem0_0.3.3_1773228204615_0.91523449339419"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-11T04:32:07.585Z","modified":"2026-03-11T11:23:24.871Z","0.3.0":"2026-03-11T04:32:07.929Z","0.3.1":"2026-03-11T09:44:43.612Z","0.3.2":"2026-03-11T09:58:43.233Z","0.3.3":"2026-03-11T11:23:24.757Z"},"license":"Apache-2.0","keywords":["openclaw","plugin","memory","mem0","long-term-memory"],"description":"Mem0 memory backend for OpenClaw — platform or self-hosted open-source","maintainers":[{"name":"dangvv","email":"devops95nd@gmail.com"}],"readme":"# @mem0/openclaw-mem0\n\nLong-term memory for [OpenClaw](https://github.com/openclaw/openclaw) agents, powered by [Mem0](https://mem0.ai).\n\nYour agent forgets everything between sessions. This plugin fixes that. It watches conversations, extracts what matters, and brings it back when relevant — automatically.\n\n## How it works\n\n<p align=\"center\">\n  <img src=\"../docs/images/openclaw-architecture.png\" alt=\"Architecture\" width=\"800\" />\n</p>\n\n**Auto-Recall** — Before the agent responds, the plugin searches Mem0 for memories that match the current message and injects them into context.\n\n**Auto-Capture** — After the agent responds, the plugin sends the exchange to Mem0. Mem0 decides what's worth keeping — new facts get stored, stale ones updated, duplicates merged.\n\nBoth run silently. No prompting, no configuration, no manual calls.\n\n### Short-term vs long-term memory\n\nMemories are organized into two scopes:\n\n- **Session (short-term)** — Auto-capture stores memories scoped to the current session via Mem0's `run_id` / `runId` parameter. These are contextual to the ongoing conversation and automatically recalled alongside long-term memories.\n\n- **User (long-term)** — The agent can explicitly store long-term memories using the `memory_store` tool (with `longTerm: true`, the default). These persist across all sessions for the user.\n\nDuring **auto-recall**, the plugin searches both scopes and presents them separately — long-term memories first, then session memories — so the agent has full context.\n\nThe agent tools (`memory_search`, `memory_list`) accept a `scope` parameter (`\"session\"`, `\"long-term\"`, or `\"all\"`) to control which memories are queried. The `memory_store` tool accepts a `longTerm` boolean (default: `true`) to choose where to store.\n\nAll new parameters are optional and backward-compatible — existing configurations work without changes.\n\n### Per-agent memory isolation\n\nIn multi-agent setups, each agent automatically gets its own memory namespace. Session keys following the pattern `agent:<agentId>:<uuid>` are parsed to derive isolated namespaces (`${userId}:agent:${agentId}`). Single-agent deployments are unaffected — plain session keys and `agent:main:*` keys resolve to the configured `userId`.\n\n**How it works:**\n\n- The agent's session key is inspected on every recall/capture cycle\n- If the key matches `agent:<name>:<uuid>`, memories are stored under `userId:agent:<name>`\n- Different agents never see each other's memories unless explicitly queried\n\n**Explicit cross-agent queries:**\n\nAll memory tools (`memory_search`, `memory_store`, `memory_list`, `memory_forget`) accept an optional `agentId` parameter to query another agent's namespace:\n\n```\nmemory_search({ query: \"user's tech stack\", agentId: \"researcher\" })\n```\n\nResolution priority: explicit `agentId` > explicit `userId` > session-derived > configured default.\n\n## Setup\n\n```bash\nopenclaw plugins install @mem0/openclaw-mem0\n```\n\n### Understanding `userId`\n\nThe `userId` field is a **string you choose** to uniquely identify the user whose memories are being stored. It is **not** something you look up in the Mem0 dashboard — you define it yourself.\n\nPick any stable, unique identifier for the user. Common choices:\n\n- Your application's internal user ID (e.g. `\"user_123\"`, `\"alice@example.com\"`)\n- A UUID (e.g. `\"550e8400-e29b-41d4-a716-446655440000\"`)\n- A simple username (e.g. `\"alice\"`)\n\nAll memories are scoped to this `userId` — different values create separate memory namespaces. If you don't set it, it defaults to `\"default\"`, which means all users share the same memory space.\n\n> **Tip:** In a multi-user application, set `userId` dynamically per user (e.g. from your auth system) rather than hardcoding a single value.\n\n### Platform (Mem0 Cloud)\n\nGet an API key from [app.mem0.ai](https://app.mem0.ai), then add to your `openclaw.json`:\n\n```json5\n// plugins.entries\n\"openclaw-mem0\": {\n  \"enabled\": true,\n  \"config\": {\n    \"apiKey\": \"${MEM0_API_KEY}\",\n    \"userId\": \"alice\"  // any unique identifier you choose for this user\n  }\n}\n```\n\n### Open-Source (Self-hosted)\n\nNo Mem0 key needed. Requires `OPENAI_API_KEY` for default embeddings/LLM.\n\n```json5\n\"openclaw-mem0\": {\n  \"enabled\": true,\n  \"config\": {\n    \"mode\": \"open-source\",\n    \"userId\": \"alice\"  // any unique identifier you choose for this user\n  }\n}\n```\n\nSensible defaults out of the box. To customize the embedder, vector store, or LLM:\n\n```json5\n\"config\": {\n  \"mode\": \"open-source\",\n  \"userId\": \"your-user-id\",\n  \"oss\": {\n    \"embedder\": { \"provider\": \"openai\", \"config\": { \"model\": \"text-embedding-3-small\" } },\n    \"vectorStore\": { \"provider\": \"qdrant\", \"config\": { \"host\": \"localhost\", \"port\": 6333 } },\n    \"llm\": { \"provider\": \"openai\", \"config\": { \"model\": \"gpt-4o\" } }\n  }\n}\n```\n\nTo enable graph memory in open-source mode, set `enableGraph: true` and provide a graph backend in `oss.graphStore`:\n\n```json5\n\"config\": {\n  \"mode\": \"open-source\",\n  \"userId\": \"your-user-id\",\n  \"enableGraph\": true,\n  \"oss\": {\n    \"graphStore\": {\n      \"provider\": \"neo4j\",\n      \"config\": {\n        \"url\": \"${NEO4J_URL}\",\n        \"username\": \"${NEO4J_USERNAME}\",\n        \"password\": \"${NEO4J_PASSWORD}\",\n        \"database\": \"neo4j\"\n      }\n    }\n  }\n}\n```\n\nWhen graph memory is enabled in OSS mode, Mem0 search returns normal vector hits plus related entities in a `relations` payload. This plugin includes those relations in `memory_search` output and auto-recall context.\n\nIf your environment cannot load `better-sqlite3` native bindings, disable the default SQLite-backed history store:\n\n```json5\n\"config\": {\n  \"mode\": \"open-source\",\n  \"userId\": \"your-user-id\",\n  \"oss\": {\n    \"disableHistory\": true\n  }\n}\n```\n\nAll `oss` fields are optional. See [Mem0 OSS docs](https://docs.mem0.ai/open-source/node-quickstart) for providers.\n\n## Agent tools\n\nThe agent gets five tools it can call during conversations:\n\n| Tool | Description |\n|------|-------------|\n| `memory_search` | Search memories by natural language. Optional `agentId` to scope to a specific agent. |\n| `memory_list` | List all stored memories for a user. Optional `agentId` to scope to a specific agent. |\n| `memory_store` | Explicitly save a fact. Optional `agentId` to store under a specific agent's namespace. |\n| `memory_get` | Retrieve a memory by ID |\n| `memory_forget` | Delete by ID or by query. Optional `agentId` to scope deletion to a specific agent. |\n\n## CLI\n\n```bash\n# Search all memories (long-term + session)\nopenclaw mem0 search \"what languages does the user know\"\n\n# Search only long-term memories\nopenclaw mem0 search \"what languages does the user know\" --scope long-term\n\n# Search only session/short-term memories\nopenclaw mem0 search \"what languages does the user know\" --scope session\n\n# Stats\nopenclaw mem0 stats\n\n# Search a specific agent's memories\nopenclaw mem0 search \"user preferences\" --agent researcher\n\n# Stats for a specific agent\nopenclaw mem0 stats --agent researcher\n```\n\n## Options\n\n### General\n\n| Key | Type | Default | |\n|-----|------|---------|---|\n| `mode` | `\"platform\"` \\| `\"open-source\"` | `\"platform\"` | Which backend to use |\n| `userId` | `string` | `\"default\"` | Any unique identifier you choose for the user (e.g. `\"alice\"`, `\"user_123\"`). All memories are scoped to this value. Not found in any dashboard — you define it yourself. |\n| `autoRecall` | `boolean` | `true` | Inject memories before each turn |\n| `autoCapture` | `boolean` | `true` | Store facts after each turn |\n| `topK` | `number` | `5` | Max memories per recall |\n| `searchThreshold` | `number` | `0.3` | Min similarity (0–1) |\n\n### Platform mode\n\n| Key | Type | Default | |\n|-----|------|---------|---|\n| `apiKey` | `string` | — | **Required.** Mem0 API key (supports `${MEM0_API_KEY}`) |\n| `orgId` | `string` | — | Organization ID |\n| `projectId` | `string` | — | Project ID |\n| `enableGraph` | `boolean` | `false` | Entity graph for relationships. In open-source mode, requires `oss.graphStore`. |\n| `customInstructions` | `string` | *(built-in)* | Extraction rules — what to store, how to format |\n| `customCategories` | `object` | *(12 defaults)* | Category name → description map for tagging |\n\n### Open-source mode\n\nWorks with zero extra config. The `oss` block lets you swap out any component:\n\n| Key | Type | Default | |\n|-----|------|---------|---|\n| `customPrompt` | `string` | *(built-in)* | Extraction prompt for memory processing |\n| `oss.embedder.provider` | `string` | `\"openai\"` | Embedding provider (`\"openai\"`, `\"ollama\"`, etc.) |\n| `oss.embedder.config` | `object` | — | Provider config: `apiKey`, `model`, `baseURL` |\n| `oss.vectorStore.provider` | `string` | `\"memory\"` | Vector store (`\"memory\"`, `\"qdrant\"`, `\"chroma\"`, etc.) |\n| `oss.vectorStore.config` | `object` | — | Provider config: `host`, `port`, `collectionName`, `dimension` |\n| `oss.llm.provider` | `string` | `\"openai\"` | LLM provider (`\"openai\"`, `\"anthropic\"`, `\"ollama\"`, etc.) |\n| `oss.llm.config` | `object` | — | Provider config: `apiKey`, `model`, `baseURL`, `temperature` |\n| `oss.disableHistory` | `boolean` | `false` | Disable the default SQLite-backed history manager to avoid `better-sqlite3` native bindings |\n| `oss.graphStore.provider` | `string` | — | Graph backend (`\"neo4j\"`, `\"memgraph\"`, `\"neptune\"`, `\"kuzu\"`, etc.) |\n| `oss.graphStore.config` | `object` | — | Provider config: backend connection details such as `url`, `username`, `password`, `database` |\n| `oss.graphStore.customPrompt` | `string` | — | Optional graph extraction prompt override |\n| `oss.graphStore.threshold` | `number` | provider default | Optional graph matching threshold |\n| `oss.historyDbPath` | `string` | — | SQLite path for memory edit history |\n\nEverything inside `oss` is optional — defaults use OpenAI embeddings (`text-embedding-3-small`), in-memory vector store, and OpenAI LLM. Override only what you need.\n\n## License\n\nApache 2.0\n","readmeFilename":"README.md"}