memory-lancedb-pro 1.0.31 → 1.0.32

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.32
4
+
5
+ - Fix: strip OpenClaw `Conversation info` / `Sender` metadata noise before auto-capture matching and adaptive retrieval normalization, reducing false captures and noisy retrieval triggers.
6
+ - Fix: parse `autoRecallMinRepeated` from plugin config so repeated-memory suppression works when configured.
7
+
8
+ PR: #50
9
+
10
+ ---
11
+
12
+
3
13
  ## 1.0.31
4
14
 
5
15
  - Fix: `memory-pro import` now preserves provided IDs and is idempotent (skips if ID already exists).
package/index.ts CHANGED
@@ -40,6 +40,7 @@ interface PluginConfig {
40
40
  autoCapture?: boolean;
41
41
  autoRecall?: boolean;
42
42
  autoRecallMinLength?: number;
43
+ autoRecallMinRepeated?: number;
43
44
  captureAssistant?: boolean;
44
45
  retrieval?: {
45
46
  mode?: "hybrid" | "vector";
@@ -140,7 +141,11 @@ const CAPTURE_EXCLUDE_PATTERNS = [
140
141
  ];
141
142
 
142
143
  export function shouldCapture(text: string): boolean {
143
- const s = text.trim();
144
+ let s = text.trim();
145
+
146
+ // Strip OpenClaw metadata headers (Conversation info or Sender)
147
+ const metadataPattern = /^(Conversation info|Sender) \(untrusted metadata\):[\s\S]*?\n\s*\n/gim;
148
+ s = s.replace(metadataPattern, "");
144
149
 
145
150
  // CJK characters carry more meaning per character, use lower minimum threshold
146
151
  const hasCJK = /[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/.test(
@@ -1098,6 +1103,7 @@ function parsePluginConfig(value: unknown): PluginConfig {
1098
1103
  // Default OFF: only enable when explicitly set to true.
1099
1104
  autoRecall: cfg.autoRecall === true,
1100
1105
  autoRecallMinLength: parsePositiveInt(cfg.autoRecallMinLength),
1106
+ autoRecallMinRepeated: parsePositiveInt(cfg.autoRecallMinRepeated),
1101
1107
  captureAssistant: cfg.captureAssistant === true,
1102
1108
  retrieval:
1103
1109
  typeof cfg.retrieval === "object" && cfg.retrieval !== null
@@ -2,7 +2,7 @@
2
2
  "id": "memory-lancedb-pro",
3
3
  "name": "Memory (LanceDB Pro)",
4
4
  "description": "Enhanced LanceDB-backed long-term memory with hybrid retrieval, multi-scope isolation, long-context chunking, and management CLI",
5
- "version": "1.0.31",
5
+ "version": "1.0.32",
6
6
  "kind": "memory",
7
7
  "configSchema": {
8
8
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memory-lancedb-pro",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "OpenClaw enhanced LanceDB memory plugin with hybrid retrieval (Vector + BM25), cross-encoder rerank, multi-scope isolation, long-context chunking, and management CLI",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -46,15 +46,10 @@ const FORCE_RETRIEVE_PATTERNS = [
46
46
  function normalizeQuery(query: string): string {
47
47
  let s = query.trim();
48
48
 
49
- // 1. Strip OpenClaw injected metadata header (Conversation info or Sender).
50
- if (/^(Conversation info|Sender) \(untrusted metadata\):/i.test(s)) {
51
- s = s.replace(/^(Conversation info|Sender) \(untrusted metadata\):\s*/i, "");
52
- // If there is a blank-line separator (after JSON block), keep only the part after it.
53
- const parts = s.split(/\n\s*\n/, 2);
54
- if (parts.length === 2) {
55
- s = parts[1].trim();
56
- }
57
- }
49
+ // 1. Strip OpenClaw injected metadata headers (Conversation info or Sender).
50
+ // Use a global regex to strip all metadata blocks including following blank lines.
51
+ const metadataPattern = /^(Conversation info|Sender) \(untrusted metadata\):[\s\S]*?\n\s*\n/gim;
52
+ s = s.replace(metadataPattern, "");
58
53
 
59
54
  // 2. Strip OpenClaw cron wrapper prefix.
60
55
  s = s.trim().replace(/^\[cron:[^\]]+\]\s*/i, "");