claude-memory-layer 1.0.20 → 1.0.21

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": "claude-memory-layer",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Claude Code plugin that learns from conversations to provide personalized assistance",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@hono/node-server": "^1.13.0",
40
40
  "@lancedb/lancedb": "^0.5.0",
41
- "@xenova/transformers": "^2.17.0",
41
+ "@huggingface/transformers": "^3.8.1",
42
42
  "better-sqlite3": "^12.6.2",
43
43
  "commander": "^12.0.0",
44
44
  "duckdb": "^0.10.0",
package/scripts/build.ts CHANGED
@@ -29,6 +29,7 @@ const commonOptions: esbuild.BuildOptions = {
29
29
  '@hono/node-server/serve-static',
30
30
  '@lancedb/lancedb',
31
31
  '@xenova/transformers',
32
+ '@huggingface/transformers',
32
33
  'duckdb',
33
34
  'better-sqlite3',
34
35
  'commander',
package/src/cli/index.ts CHANGED
@@ -814,7 +814,7 @@ program
814
814
  .option('-a, --all', 'Import all sessions from all projects')
815
815
  .option('-l, --limit <number>', 'Limit messages per session')
816
816
  .option('-f, --force', 'Force reimport: delete existing events and reimport with turn_id grouping')
817
- .option('--embedding-model <name>', 'Embedding model override (default: jinaai/jina-embeddings-v5-text-nano, or env CLAUDE_MEMORY_EMBEDDING_MODEL)')
817
+ .option('--embedding-model <name>', 'Embedding model override (default: jinaai/jina-embeddings-v5-text-nano-text-matching, or env CLAUDE_MEMORY_EMBEDDING_MODEL; fallback env: CLAUDE_MEMORY_EMBEDDING_FALLBACK_MODEL)')
818
818
  .option('-v, --verbose', 'Show detailed progress')
819
819
  .action(async (options) => {
820
820
  const startTime = Date.now();
@@ -3,7 +3,7 @@
3
3
  * AXIOMMIND Principle 7: Standard JSON format for vectors
4
4
  */
5
5
 
6
- import { pipeline, Pipeline } from '@xenova/transformers';
6
+ import { pipeline, Pipeline } from '@huggingface/transformers';
7
7
 
8
8
  export interface EmbeddingResult {
9
9
  vector: number[];
@@ -14,10 +14,12 @@ export interface EmbeddingResult {
14
14
  export class Embedder {
15
15
  private pipeline: Pipeline | null = null;
16
16
  private readonly modelName: string;
17
+ private activeModelName: string;
17
18
  private initialized = false;
18
19
 
19
- constructor(modelName: string = 'jinaai/jina-embeddings-v5-text-nano') {
20
+ constructor(modelName: string = 'jinaai/jina-embeddings-v5-text-nano-text-matching') {
20
21
  this.modelName = modelName;
22
+ this.activeModelName = modelName;
21
23
  }
22
24
 
23
25
  /**
@@ -26,8 +28,22 @@ export class Embedder {
26
28
  async initialize(): Promise<void> {
27
29
  if (this.initialized) return;
28
30
 
29
- this.pipeline = await pipeline('feature-extraction', this.modelName);
30
- this.initialized = true;
31
+ try {
32
+ this.pipeline = await pipeline('feature-extraction', this.modelName);
33
+ this.activeModelName = this.modelName;
34
+ this.initialized = true;
35
+ return;
36
+ } catch (primaryError) {
37
+ const fallbackModel = process.env.CLAUDE_MEMORY_EMBEDDING_FALLBACK_MODEL || 'onnx-community/embeddinggemma-300m-ONNX';
38
+ if (fallbackModel === this.modelName) {
39
+ throw primaryError;
40
+ }
41
+
42
+ console.warn(`[Embedder] Primary model failed (${this.modelName}). Falling back to ${fallbackModel}`);
43
+ this.pipeline = await pipeline('feature-extraction', fallbackModel);
44
+ this.activeModelName = fallbackModel;
45
+ this.initialized = true;
46
+ }
31
47
  }
32
48
 
33
49
  /**
@@ -49,7 +65,7 @@ export class Embedder {
49
65
 
50
66
  return {
51
67
  vector,
52
- model: this.modelName,
68
+ model: this.activeModelName,
53
69
  dimensions: vector.length
54
70
  };
55
71
  }
@@ -81,7 +97,7 @@ export class Embedder {
81
97
 
82
98
  results.push({
83
99
  vector,
84
- model: this.modelName,
100
+ model: this.activeModelName,
85
101
  dimensions: vector.length
86
102
  });
87
103
  }
@@ -109,7 +125,7 @@ export class Embedder {
109
125
  * Get model name
110
126
  */
111
127
  getModelName(): string {
112
- return this.modelName;
128
+ return this.activeModelName;
113
129
  }
114
130
  }
115
131
 
package/src/core/types.ts CHANGED
@@ -152,8 +152,8 @@ export const ConfigSchema = z.object({
152
152
  }).default({}),
153
153
  embedding: z.object({
154
154
  provider: z.enum(['local', 'openai']).default('local'),
155
- model: z.string().default('jinaai/jina-embeddings-v5-text-nano'),
156
- openaiModel: z.string().default('jinaai/jina-embeddings-v5-text-nano'),
155
+ model: z.string().default('jinaai/jina-embeddings-v5-text-nano-text-matching'),
156
+ openaiModel: z.string().default('jinaai/jina-embeddings-v5-text-nano-text-matching'),
157
157
  batchSize: z.number().default(32)
158
158
  }).default({}),
159
159
  retrieval: z.object({