From 8366e89d8dc54fbeaa3eafc373e84d87d335bfbe Mon Sep 17 00:00:00 2001 From: fan Date: Mon, 16 Feb 2026 00:13:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmemory-lancedb=E5=AF=B9?= =?UTF-8?q?=E9=BD=90preference=E5=88=86=E7=B1=BB=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/memory-lancedb/index.test.ts | 6 ++++++ extensions/memory-lancedb/index.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/extensions/memory-lancedb/index.test.ts b/extensions/memory-lancedb/index.test.ts index 4ab80117c3a..daf1ffa988b 100644 --- a/extensions/memory-lancedb/index.test.ts +++ b/extensions/memory-lancedb/index.test.ts @@ -187,6 +187,12 @@ describe("memory plugin e2e", () => { const { detectCategory } = await import("./index.js"); expect(detectCategory("I prefer dark mode")).toBe("preference"); + expect(detectCategory("I need dark mode")).toBe("preference"); + expect(detectCategory("I always use dark mode")).toBe("preference"); + expect(detectCategory("I never use emojis")).toBe("preference"); + expect(detectCategory("This is important for me")).toBe("preference"); + expect(detectCategory("Preferuji tmavý režim")).toBe("preference"); + expect(detectCategory("Nechci používat světlý režim")).toBe("preference"); expect(detectCategory("We decided to use React")).toBe("decision"); expect(detectCategory("My email is test@example.com")).toBe("entity"); expect(detectCategory("The server is running on port 3000")).toBe("fact"); diff --git a/extensions/memory-lancedb/index.ts b/extensions/memory-lancedb/index.ts index f9ba0b98de1..6c883ec996c 100644 --- a/extensions/memory-lancedb/index.ts +++ b/extensions/memory-lancedb/index.ts @@ -264,7 +264,7 @@ export function shouldCapture(text: string, options?: { maxChars?: number }): bo export function detectCategory(text: string): MemoryCategory { const lower = text.toLowerCase(); - if (/prefer|radši|like|love|hate|want/i.test(lower)) { + if (/prefer|preferuji|radši|nechci|like|love|hate|want|need|always|never|important/i.test(lower)) { return "preference"; } if (/rozhodli|decided|will use|budeme/i.test(lower)) {