@betterdb/memory 0.4.0 → 0.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterdb/memory",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "BetterDB Memory for Claude Code — Valkey-powered persistent memory across sessions",
5
5
  "license": "MIT",
6
6
  "author": "BetterDB Inc. <hello@betterdb.com>",
@@ -28,6 +28,20 @@ export const PRESET_LIGHTWEIGHT: ModelPreset = {
28
28
  embedDim: 384,
29
29
  };
30
30
 
31
+ /**
32
+ * Preset for an explicitly-selected Ollama provider. Unlike auto-detect (which
33
+ * picks a built-in preset whose model is installed), an explicit
34
+ * BETTERDB_*_PROVIDER=ollama must honor the configured model/dim — otherwise a
35
+ * user who set BETTERDB_SUMMARIZE_MODEL is silently overridden by PRESET_CLEAN.
36
+ */
37
+ function ollamaPresetFromConfig(): ModelPreset {
38
+ return {
39
+ embedModel: config.ollama.embedModel,
40
+ summarizeModel: config.ollama.summarizeModel,
41
+ embedDim: config.ollama.embedDim,
42
+ };
43
+ }
44
+
31
45
  // --- ModelClient Interface ---
32
46
 
33
47
  export interface ModelClient {
@@ -219,7 +233,7 @@ function createExplicitEmbedProvider(
219
233
  }
220
234
  case "ollama": {
221
235
  const { OllamaModelClient } = require("./providers/ollama.js");
222
- return new OllamaModelClient(PRESET_CLEAN, config.ollama.url);
236
+ return new OllamaModelClient(ollamaPresetFromConfig(), config.ollama.url);
223
237
  }
224
238
  case "openai": {
225
239
  if (!p.openaiKey) throw new Error("BETTERDB_EMBED_PROVIDER=openai but OPENAI_API_KEY is not set");
@@ -253,7 +267,7 @@ function createExplicitSummarizeProvider(
253
267
  switch (name) {
254
268
  case "ollama": {
255
269
  const { OllamaModelClient } = require("./providers/ollama.js");
256
- return new OllamaModelClient(PRESET_CLEAN, config.ollama.url);
270
+ return new OllamaModelClient(ollamaPresetFromConfig(), config.ollama.url);
257
271
  }
258
272
  case "openai": {
259
273
  if (!p.openaiKey) throw new Error("BETTERDB_SUMMARIZE_PROVIDER=openai but OPENAI_API_KEY is not set");
package/src/index.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  import { existsSync, readFileSync, writeFileSync, mkdirSync, chmodSync, rmSync } from "node:fs";
14
14
  import { join, resolve } from "node:path";
15
15
 
16
- const VERSION = "0.4.0";
16
+ const VERSION = "0.4.1";
17
17
  const HOME = process.env["HOME"] ?? process.env["USERPROFILE"] ?? "";
18
18
  const BETTERDB_DIR = join(HOME, ".betterdb");
19
19
  const BIN_DIR = join(BETTERDB_DIR, "bin");
package/src/mcp/server.ts CHANGED
@@ -15,7 +15,7 @@ const SETUP_MESSAGE =
15
15
 
16
16
  const server = new McpServer({
17
17
  name: "betterdb-memory",
18
- version: "0.4.0",
18
+ version: "0.4.1",
19
19
  });
20
20
 
21
21
  // --- Tool: search_context ---