From aa4a944b519e376d184711c6648fe17fad754df5 Mon Sep 17 00:00:00 2001 From: "mem0-bot[bot]" <263214695+mem0-bot[bot]@users.noreply.github.com> Date: Sun, 22 Feb 2026 18:44:11 -0800 Subject: [PATCH] fix: Bug: Openclaw Extension OSS Mode lacks threshold restrictions (#4106) (#4115) --- openclaw/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openclaw/index.ts b/openclaw/index.ts index f895ce5f0..1879edba2 100644 --- a/openclaw/index.ts +++ b/openclaw/index.ts @@ -268,9 +268,17 @@ class OSSProvider implements Mem0Provider { 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.threshold != null) opts.threshold = options.threshold; const results = await this.memory.search(query, opts); - return normalizeSearchResults(results); + const normalized = normalizeSearchResults(results); + + // Filter results by threshold if specified (client-side filtering as fallback) + if (options.threshold != null) { + return normalized.filter(item => (item.score ?? 0) >= options.threshold!); + } + + return normalized; } async get(memoryId: string): Promise {