memory-lancedb-pro 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.16
4
+
5
+ - Feat: expand memory capture triggers to support Traditional Chinese (繁體中文) in addition to Simplified Chinese, and improve category detection keywords.
6
+
3
7
  ## 1.0.15
4
8
 
5
9
  - Docs: add troubleshooting note for LanceDB/Arrow returning `BigInt` numeric columns, and confirm the plugin coerces numeric fields via `Number(...)` for compatibility.
package/README_CN.md CHANGED
@@ -156,6 +156,7 @@ Query → BM25 FTS ─────┘
156
156
  ### 8. 自动捕获 & 自动回忆
157
157
 
158
158
  - **Auto-Capture**(`agent_end` hook): 从对话中提取 preference/fact/decision/entity,去重后存储(每次最多 3 条)
159
+ - 触发词支持 **简体中文 + 繁體中文**(例如:记住/記住、偏好/喜好/喜歡、决定/決定 等)
159
160
  - **Auto-Recall**(`before_agent_start` hook): 注入 `<relevant-memories>` 上下文(最多 3 条)
160
161
 
161
162
  ### 不想在对话中“显示长期记忆”?
package/index.ts CHANGED
@@ -111,15 +111,16 @@ const MEMORY_TRIGGERS = [
111
111
  /[\w.-]+@[\w.-]+\.\w+/,
112
112
  /můj\s+\w+\s+je|je\s+můj/i,
113
113
  /my\s+\w+\s+is|is\s+my/i,
114
- /i (like|prefer|hate|love|want|need)/i,
114
+ /i (like|prefer|hate|love|want|need|care)/i,
115
115
  /always|never|important/i,
116
- // Chinese triggers
117
- /记住|记一下|别忘了|备注/,
118
- /偏好|喜欢|讨厌|不喜欢|爱用|习惯/,
119
- /决定|选择了|改用|换成|以后用/,
120
- /我的\S+是|叫我|称呼/,
121
- /总是|从不|一直|每次都/,
122
- /重要|关键|注意|千万别/,
116
+ // Chinese triggers (Traditional & Simplified)
117
+ /記住|记住|記一下|记一下|別忘了|别忘了|備註|备注/,
118
+ /偏好|喜好|喜歡|喜欢|討厭|讨厌|不喜歡|不喜欢|愛用|爱用|習慣|习惯/,
119
+ /決定|决定|選擇了|选择了|改用|換成|换成|以後用|以后用/,
120
+ /我的\S+是|叫我|稱呼|称呼/,
121
+ /老是|講不聽|總是|总是|從不|从不|一直|每次都/,
122
+ /重要|關鍵|关键|注意|千萬別|千万别/,
123
+ /幫我|筆記|存檔|存起來|存一下|重點|原則|底線/,
123
124
  ];
124
125
 
125
126
  export function shouldCapture(text: string): boolean {
@@ -151,16 +152,16 @@ export function shouldCapture(text: string): boolean {
151
152
 
152
153
  export function detectCategory(text: string): "preference" | "fact" | "decision" | "entity" | "other" {
153
154
  const lower = text.toLowerCase();
154
- if (/prefer|radši|like|love|hate|want|偏好|喜欢|讨厌|不喜欢|爱用|习惯/i.test(lower)) {
155
+ if (/prefer|radši|like|love|hate|want|偏好|喜歡|喜欢|討厭|讨厌|不喜歡|不喜欢|愛用|爱用|習慣|习惯/i.test(lower)) {
155
156
  return "preference";
156
157
  }
157
- if (/rozhodli|decided|will use|budeme|决定|选择了|改用|换成|以后用/i.test(lower)) {
158
+ if (/rozhodli|decided|will use|budeme|決定|决定|選擇了|选择了|改用|換成|换成|以後用|以后用|規則|流程|SOP/i.test(lower)) {
158
159
  return "decision";
159
160
  }
160
- if (/\+\d{10,}|@[\w.-]+\.\w+|is called|jmenuje se|我的\S+是|叫我|称呼/i.test(lower)) {
161
+ if (/\+\d{10,}|@[\w.-]+\.\w+|is called|jmenuje se|我的\S+是|叫我|稱呼|称呼/i.test(lower)) {
161
162
  return "entity";
162
163
  }
163
- if (/\b(is|are|has|have|je|má|jsou)\b|总是|从不|一直|每次都/i.test(lower)) {
164
+ if (/\b(is|are|has|have|je|má|jsou)\b|總是|总是|從不|从不|一直|每次都|老是/i.test(lower)) {
164
165
  return "fact";
165
166
  }
166
167
  return "other";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memory-lancedb-pro",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "OpenClaw enhanced LanceDB memory plugin with hybrid retrieval (Vector + BM25), cross-encoder rerank, multi-scope isolation, and management CLI",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -15,7 +15,7 @@ const SKIP_PATTERNS = [
15
15
  // Simple affirmations/negations
16
16
  /^(yes|no|yep|nope|ok|okay|sure|fine|thanks|thank you|thx|ty|got it|understood|cool|nice|great|good|perfect|awesome|👍|👎|✅|❌)\s*[.!]?$/i,
17
17
  // Continuation prompts
18
- /^(go ahead|continue|proceed|do it|start|begin|next|实施|开始|继续|好的|可以|行)\s*[.!]?$/i,
18
+ /^(go ahead|continue|proceed|do it|start|begin|next|实施|實施|开始|開始|继续|繼續|好的|可以|行)\s*[.!]?$/i,
19
19
  // Pure emoji
20
20
  /^[\p{Emoji}\s]+$/u,
21
21
  // Heartbeat/system (match anywhere, not just at start, to handle prefixed formats)
@@ -31,7 +31,7 @@ const FORCE_RETRIEVE_PATTERNS = [
31
31
  /\b(last time|before|previously|earlier|yesterday|ago)\b/i,
32
32
  /\b(my (name|email|phone|address|birthday|preference))\b/i,
33
33
  /\b(what did (i|we)|did i (tell|say|mention))\b/i,
34
- /(你记得|之前|上次|以前|还记得|提到过|说过)/i,
34
+ /(你记得|[你妳]記得|之前|上次|以前|还记得|還記得|提到过|提到過|说过|說過)/i,
35
35
  ];
36
36
 
37
37
  /**
@@ -49,6 +49,9 @@ function normalizeQuery(query: string): string {
49
49
  // Strip OpenClaw cron wrapper prefix.
50
50
  s = s.replace(/^\[cron:[^\]]+\]\s*/i, "");
51
51
 
52
+ // Strip OpenClaw timestamp prefix [Mon 2026-03-02 04:21 GMT+8].
53
+ s = s.replace(/^\[[A-Za-z]{3}\s\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}\s[^\]]+\]\s*/, "");
54
+
52
55
  // Strip OpenClaw injected metadata header used in some transcripts.
53
56
  if (/^Conversation info \(untrusted metadata\):/i.test(s)) {
54
57
  s = s.replace(/^Conversation info \(untrusted metadata\):\s*/i, "");