memory-lancedb-pro 1.0.3 → 1.0.4

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.4
4
+
5
+ - Fix: `embedding.dimensions` is now parsed robustly (number / numeric string / env-var string), so it properly overrides hardcoded model dims (fixes Ollama `nomic-embed-text` dimension mismatch).
6
+
3
7
  ## 1.0.3
4
8
 
5
9
  - Fix: `memory-pro reembed` no longer crashes (missing `clampInt` helper).
package/README.md CHANGED
@@ -326,7 +326,7 @@ This plugin works with **any OpenAI-compatible embedding API**:
326
326
  | **Jina** (recommended) | `jina-embeddings-v5-text-small` | `https://api.jina.ai/v1` | 1024 |
327
327
  | **OpenAI** | `text-embedding-3-small` | `https://api.openai.com/v1` | 1536 |
328
328
  | **Google Gemini** | `gemini-embedding-001` | `https://generativelanguage.googleapis.com/v1beta/openai/` | 3072 |
329
- | **Ollama** (local) | `nomic-embed-text` | `http://localhost:11434/v1` | 768 |
329
+ | **Ollama** (local) | `nomic-embed-text` | `http://localhost:11434/v1` | _provider-specific_ (set `embedding.dimensions` to match your Ollama model output) |
330
330
 
331
331
  ### Rerank Providers
332
332
 
package/index.ts CHANGED
@@ -84,6 +84,20 @@ function resolveEnvVars(value: string): string {
84
84
  });
85
85
  }
86
86
 
87
+ function parsePositiveInt(value: unknown): number | undefined {
88
+ if (typeof value === "number" && Number.isFinite(value) && value > 0) {
89
+ return Math.floor(value);
90
+ }
91
+ if (typeof value === "string") {
92
+ const s = value.trim();
93
+ if (!s) return undefined;
94
+ const resolved = resolveEnvVars(s);
95
+ const n = Number(resolved);
96
+ if (Number.isFinite(n) && n > 0) return Math.floor(n);
97
+ }
98
+ return undefined;
99
+ }
100
+
87
101
  // ============================================================================
88
102
  // Capture & Category Detection (from old plugin)
89
103
  // ============================================================================
@@ -689,7 +703,9 @@ function parsePluginConfig(value: unknown): PluginConfig {
689
703
  apiKey,
690
704
  model: typeof embedding.model === "string" ? embedding.model : "text-embedding-3-small",
691
705
  baseURL: typeof embedding.baseURL === "string" ? resolveEnvVars(embedding.baseURL) : undefined,
692
- dimensions: typeof embedding.dimensions === "number" ? embedding.dimensions : undefined,
706
+ // Accept number, numeric string, or env-var string (e.g. "${EMBED_DIM}").
707
+ // Also accept legacy top-level `dimensions` for convenience.
708
+ dimensions: parsePositiveInt(embedding.dimensions ?? cfg.dimensions),
693
709
  taskQuery: typeof embedding.taskQuery === "string" ? embedding.taskQuery : undefined,
694
710
  taskPassage: typeof embedding.taskPassage === "string" ? embedding.taskPassage : undefined,
695
711
  normalized: typeof embedding.normalized === "boolean" ? embedding.normalized : undefined,
@@ -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, and management CLI",
5
- "version": "1.0.3",
5
+ "version": "1.0.4",
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.3",
3
+ "version": "1.0.4",
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",