From 7482c4869212a892debb36ab9de3421a9cc1ffb9 Mon Sep 17 00:00:00 2001 From: Utkarsh Date: Mon, 9 Mar 2026 22:18:55 +0530 Subject: [PATCH] fix(openclaw): migrate platform search to mem0 v2 API (#4276) --- openclaw/CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ openclaw/index.ts | 12 ++++++++---- openclaw/package.json | 2 +- 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 openclaw/CHANGELOG.md diff --git a/openclaw/CHANGELOG.md b/openclaw/CHANGELOG.md new file mode 100644 index 000000000..55edccb25 --- /dev/null +++ b/openclaw/CHANGELOG.md @@ -0,0 +1,33 @@ +# Changelog + +All notable changes to the `@mem0/openclaw-mem0` plugin will be documented in this file. + +## [0.2.0] - 2026-03-09 + +### Added +- "Understanding userId" section in docs clarifying that `userId` is user-defined +- Per-agent memory isolation for multi-agent setups via `agentId` +- Regression tests for per-agent isolation helpers + +### Changed +- Updated config examples to use concrete `userId` values instead of placeholders + +### Fixed +- Migrated platform search to Mem0 v2 API + +## [0.1.2] - 2026-02-19 + +### Added +- Source field for openclaw memory entries + +### Fixed +- Auto-recall injection and auto-capture message drop + +## [0.1.0] - 2026-02-02 + +### Added +- Initial release of the OpenClaw Mem0 plugin +- Platform mode (Mem0 Cloud) and open-source mode support +- Auto-recall: inject relevant memories before each turn +- Auto-capture: store facts after each turn +- Configurable `topK`, `threshold`, and `apiVersion` options diff --git a/openclaw/index.ts b/openclaw/index.ts index 74c9d4c2b..7fd1535a0 100644 --- a/openclaw/index.ts +++ b/openclaw/index.ts @@ -165,13 +165,17 @@ class PlatformProvider implements Mem0Provider { async search(query: string, options: SearchOptions): Promise { await this.ensureClient(); - const opts: Record = { user_id: options.user_id }; - if (options.run_id) opts.run_id = options.run_id; + const filters: Record = { user_id: options.user_id }; + if (options.run_id) filters.run_id = options.run_id; + + const opts: Record = { + api_version: "v2", + filters, + }; if (options.top_k != null) opts.top_k = options.top_k; if (options.threshold != null) opts.threshold = options.threshold; if (options.keyword_search != null) opts.keyword_search = options.keyword_search; - if (options.reranking != null) opts.reranking = options.reranking; - if (options.source) opts.source = options.source; + if (options.reranking != null) opts.rerank = options.reranking; const results = await this.client.search(query, opts); return normalizeSearchResults(results); diff --git a/openclaw/package.json b/openclaw/package.json index 9ee6e9947..5639f1607 100644 --- a/openclaw/package.json +++ b/openclaw/package.json @@ -1,6 +1,6 @@ { "name": "@mem0/openclaw-mem0", - "version": "0.1.2", + "version": "0.2.0", "type": "module", "description": "Mem0 memory backend for OpenClaw — platform or self-hosted open-source", "license": "Apache-2.0",