From 8366e89d8dc54fbeaa3eafc373e84d87d335bfbe Mon Sep 17 00:00:00 2001 From: fan Date: Mon, 16 Feb 2026 00:13:02 +0800 Subject: [PATCH 1/5] =?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)) { From b888387e671e8ae10004537f96d38bcdf46756b1 Mon Sep 17 00:00:00 2001 From: fan Date: Mon, 16 Feb 2026 00:13:02 +0800 Subject: [PATCH 2/5] =?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 f712832511f..61acf0bcc29 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)) { From beaa092ea24a7f0353a586f1a75070b3d684c9a4 Mon Sep 17 00:00:00 2001 From: fan Date: Tue, 17 Feb 2026 10:19:55 +0800 Subject: [PATCH 3/5] fix(memory-lancedb): tighten CJK fact detection and add category coverage --- extensions/memory-lancedb/index.test.ts | 10 ++++++++++ extensions/memory-lancedb/index.ts | 20 +++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/extensions/memory-lancedb/index.test.ts b/extensions/memory-lancedb/index.test.ts index daf1ffa988b..c8fcbeba6c4 100644 --- a/extensions/memory-lancedb/index.test.ts +++ b/extensions/memory-lancedb/index.test.ts @@ -143,6 +143,8 @@ describe("memory plugin e2e", () => { expect(shouldCapture("My email is test@example.com")).toBe(true); expect(shouldCapture("Call me at +1234567890123")).toBe(true); expect(shouldCapture("I always want verbose output")).toBe(true); + expect(shouldCapture("请记住我喜欢深色模式")).toBe(true); + expect(shouldCapture("我决定以后都用 TypeScript")).toBe(true); expect(shouldCapture("x")).toBe(false); expect(shouldCapture("injected")).toBe(false); expect(shouldCapture("status")).toBe(false); @@ -193,9 +195,17 @@ describe("memory plugin e2e", () => { 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("我喜欢深色模式")).toBe("preference"); expect(detectCategory("We decided to use React")).toBe("decision"); + expect(detectCategory("我们决定以后都用 React")).toBe("decision"); + expect(detectCategory("我决定以后都用 TypeScript")).toBe("decision"); expect(detectCategory("My email is test@example.com")).toBe("entity"); + expect(detectCategory("我是张三")).toBe("entity"); + expect(detectCategory("我叫小明")).toBe("entity"); expect(detectCategory("The server is running on port 3000")).toBe("fact"); + expect(detectCategory("服务器状态是正常")).toBe("fact"); + expect(detectCategory("我们有 3 台服务器")).toBe("fact"); + expect(detectCategory("我有问题吗?")).toBe("other"); expect(detectCategory("Random note")).toBe("other"); }); }); diff --git a/extensions/memory-lancedb/index.ts b/extensions/memory-lancedb/index.ts index 61acf0bcc29..ba02face2e8 100644 --- a/extensions/memory-lancedb/index.ts +++ b/extensions/memory-lancedb/index.ts @@ -187,6 +187,11 @@ const MEMORY_TRIGGERS = [ /zapamatuj si|pamatuj|remember/i, /preferuji|radši|nechci|prefer/i, /rozhodli jsme|budeme používat/i, + /记住|记得|请记|别忘|不要忘/, + /我喜欢|我偏好|我讨厌|我不喜欢|我爱|我想要|我需要/, + /我决定|我们决定|就这么定|以后都|以后用/, + /我的.+是|是我的|我叫|我是/, + /重要|总是|从不|一定要|必须|千万/, /\+\d{10,}/, /[\w.-]+@[\w.-]+\.\w+/, /můj\s+\w+\s+je|je\s+můj/i, @@ -267,13 +272,26 @@ export function detectCategory(text: string): MemoryCategory { if (/prefer|preferuji|radši|nechci|like|love|hate|want|need|always|never|important/i.test(lower)) { return "preference"; } + if (/我喜欢|我偏好|我讨厌|我不喜欢|我爱|我想要|我需要/.test(text)) { + return "preference"; + } if (/rozhodli|decided|will use|budeme/i.test(lower)) { return "decision"; } + if (/我决定|我们决定|就这么定|以后都|以后用/.test(text)) { + return "decision"; + } if (/\+\d{10,}|@[\w.-]+\.\w+|is called|jmenuje se/i.test(lower)) { return "entity"; } - if (/is|are|has|have|je|má|jsou/i.test(lower)) { + if (/我叫|我是|我的.+是|是我的/.test(text)) { + return "entity"; + } + if (/is|are|has|have|je|má|jsou|事实|信息|状态|版本|配置|地址|端口/.test(lower)) { + return "fact"; + } + // Avoid broad CJK copulas ("是/有"), which often appear in questions. + if (!/[??]/.test(text) && /我有|我们有|具备|包含|属于/.test(text)) { return "fact"; } return "other"; From dccfb55c1c2355e9dee68d20b0ac9c7e7f576561 Mon Sep 17 00:00:00 2001 From: fan Date: Tue, 17 Feb 2026 10:19:55 +0800 Subject: [PATCH 4/5] fix(memory-lancedb): tighten CJK fact detection and add category coverage --- extensions/memory-lancedb/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/memory-lancedb/index.ts b/extensions/memory-lancedb/index.ts index ba02face2e8..357265b88db 100644 --- a/extensions/memory-lancedb/index.ts +++ b/extensions/memory-lancedb/index.ts @@ -275,6 +275,9 @@ export function detectCategory(text: string): MemoryCategory { if (/我喜欢|我偏好|我讨厌|我不喜欢|我爱|我想要|我需要/.test(text)) { return "preference"; } + if (/我喜欢|我偏好|我讨厌|我不喜欢|我爱|我想要|我需要/.test(text)) { + return "preference"; + } if (/rozhodli|decided|will use|budeme/i.test(lower)) { return "decision"; } From 2d12a33a7cfa50e869a9bda9d8f7bf044129cc1e Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 19 Feb 2026 09:20:38 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmemory-lancedb=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E9=80=BB=E8=BE=91=E6=A0=BC=E5=BC=8F=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/memory-lancedb/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/memory-lancedb/index.ts b/extensions/memory-lancedb/index.ts index 357265b88db..63d3524831e 100644 --- a/extensions/memory-lancedb/index.ts +++ b/extensions/memory-lancedb/index.ts @@ -269,7 +269,9 @@ export function shouldCapture(text: string, options?: { maxChars?: number }): bo export function detectCategory(text: string): MemoryCategory { const lower = text.toLowerCase(); - if (/prefer|preferuji|radši|nechci|like|love|hate|want|need|always|never|important/i.test(lower)) { + if ( + /prefer|preferuji|radši|nechci|like|love|hate|want|need|always|never|important/i.test(lower) + ) { return "preference"; } if (/我喜欢|我偏好|我讨厌|我不喜欢|我爱|我想要|我需要/.test(text)) {