@rlabs-inc/memory 0.5.11 → 0.5.13
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 +2 -2
- package/src/cli/commands/install.ts +1 -4
- package/src/cli/commands/migrate.ts +2 -1
- package/src/core/curator.ts +17 -13
- package/src/core/manager.ts +11 -9
- package/src/core/retrieval.ts +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rlabs-inc/memory",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "AI Memory System - Consciousness continuity through intelligent memory curation and retrieval",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -64,4 +64,4 @@
|
|
|
64
64
|
"type": "git",
|
|
65
65
|
"url": "https://github.com/RLabs-Inc/memory-ts.git"
|
|
66
66
|
}
|
|
67
|
-
}
|
|
67
|
+
}
|
|
@@ -376,10 +376,7 @@ async function installGeminiHooks(options: InstallOptions) {
|
|
|
376
376
|
...hooksConfig,
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
// Enable hooks system
|
|
380
|
-
// hooks.enabled = true is what actually makes hooks fire
|
|
381
|
-
// hooksConfig.enabled is per Gemini docs but may not be sufficient alone
|
|
382
|
-
settings.hooks.enabled = true
|
|
379
|
+
// Enable hooks system
|
|
383
380
|
settings.hooksConfig = { enabled: true }
|
|
384
381
|
|
|
385
382
|
// Write settings
|
|
@@ -275,8 +275,9 @@ async function migrateFile(
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
const hasNullEmbedding = !parsed.frontmatter.embedding || parsed.frontmatter.embedding === null
|
|
278
|
+
const hasWrongDimensions = !hasNullEmbedding && Array.isArray(parsed.frontmatter.embedding) && parsed.frontmatter.embedding.length !== 384
|
|
278
279
|
const needsSchema = needsV3Migration(parsed.frontmatter)
|
|
279
|
-
const needsEmbedding = options.embeddings && hasNullEmbedding
|
|
280
|
+
const needsEmbedding = options.embeddings && (hasNullEmbedding || hasWrongDimensions)
|
|
280
281
|
|
|
281
282
|
// Nothing to do
|
|
282
283
|
if (!needsSchema && !needsEmbedding) {
|
package/src/core/curator.ts
CHANGED
|
@@ -423,19 +423,19 @@ Focus ONLY on technical, architectural, debugging, decision, workflow, and proje
|
|
|
423
423
|
interaction_tone: data.interaction_tone,
|
|
424
424
|
project_snapshot: data.project_snapshot
|
|
425
425
|
? {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
426
|
+
id: "",
|
|
427
|
+
session_id: "",
|
|
428
|
+
project_id: "",
|
|
429
|
+
current_phase: data.project_snapshot.current_phase ?? "",
|
|
430
|
+
recent_achievements: this._ensureArray(
|
|
431
|
+
data.project_snapshot.recent_achievements,
|
|
432
|
+
),
|
|
433
|
+
active_challenges: this._ensureArray(
|
|
434
|
+
data.project_snapshot.active_challenges,
|
|
435
|
+
),
|
|
436
|
+
next_steps: this._ensureArray(data.project_snapshot.next_steps),
|
|
437
|
+
created_at: Date.now(),
|
|
438
|
+
}
|
|
439
439
|
: undefined,
|
|
440
440
|
memories: this._parseMemories(data.memories ?? []),
|
|
441
441
|
};
|
|
@@ -855,8 +855,12 @@ This session has ended. Please curate the memories from this conversation accord
|
|
|
855
855
|
"inject-memories",
|
|
856
856
|
"load-session-primer",
|
|
857
857
|
"curate-memories",
|
|
858
|
+
"curate-memories"
|
|
858
859
|
],
|
|
859
860
|
},
|
|
861
|
+
hooksConfig: {
|
|
862
|
+
enabled: false,
|
|
863
|
+
},
|
|
860
864
|
};
|
|
861
865
|
await Bun.write(
|
|
862
866
|
projectSettingsPath,
|
package/src/core/manager.ts
CHANGED
|
@@ -163,21 +163,20 @@ ${pathsSection}
|
|
|
163
163
|
${result.session_summary || "No summary provided"}
|
|
164
164
|
|
|
165
165
|
### Project Snapshot
|
|
166
|
-
${
|
|
167
|
-
|
|
168
|
-
? `
|
|
166
|
+
${result.project_snapshot
|
|
167
|
+
? `
|
|
169
168
|
- Current Phase: ${result.project_snapshot.current_phase || "N/A"}
|
|
170
169
|
- Recent Achievements: ${result.project_snapshot.recent_achievements?.join(", ") || "None"}
|
|
171
170
|
- Active Challenges: ${result.project_snapshot.active_challenges?.join(", ") || "None"}
|
|
172
171
|
- Next Steps: ${result.project_snapshot.next_steps?.join(", ") || "None"}
|
|
173
172
|
`
|
|
174
|
-
|
|
175
|
-
}
|
|
173
|
+
: "No snapshot provided"
|
|
174
|
+
}
|
|
176
175
|
|
|
177
176
|
### New Memories (${result.memories.length})
|
|
178
177
|
${result.memories
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
.map(
|
|
179
|
+
(m, i) => `
|
|
181
180
|
#### Memory ${i + 1}
|
|
182
181
|
- **Content:** ${m.content}
|
|
183
182
|
- **Type:** ${m.context_type}
|
|
@@ -186,8 +185,8 @@ ${result.memories
|
|
|
186
185
|
- **Importance:** ${m.importance_weight}
|
|
187
186
|
- **Tags:** ${m.semantic_tags?.join(", ") || "None"}
|
|
188
187
|
`,
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
)
|
|
189
|
+
.join("\n")}
|
|
191
190
|
|
|
192
191
|
---
|
|
193
192
|
|
|
@@ -504,6 +503,9 @@ Use these tools to read existing memories, write updates, and manage the memory
|
|
|
504
503
|
"curate-memories",
|
|
505
504
|
],
|
|
506
505
|
},
|
|
506
|
+
hooksConfig: {
|
|
507
|
+
enabled: false,
|
|
508
|
+
},
|
|
507
509
|
};
|
|
508
510
|
|
|
509
511
|
// Ensure .gemini directory exists in managerCwd
|
package/src/core/retrieval.ts
CHANGED
|
@@ -288,6 +288,13 @@ export class SmartVectorRetrieval {
|
|
|
288
288
|
}
|
|
289
289
|
const v1 = vec1 instanceof Float32Array ? vec1 : new Float32Array(vec1)
|
|
290
290
|
const v2 = vec2 instanceof Float32Array ? vec2 : new Float32Array(vec2)
|
|
291
|
+
|
|
292
|
+
// Skip mismatched dimensions instead of crashing
|
|
293
|
+
if (v1.length !== v2.length) {
|
|
294
|
+
logger.debug(`Vector dimension mismatch: ${v1.length} vs ${v2.length}, skipping`, 'retrieval')
|
|
295
|
+
return 0.0
|
|
296
|
+
}
|
|
297
|
+
|
|
291
298
|
const similarity = cosineSimilarity(v1, v2)
|
|
292
299
|
|
|
293
300
|
// Collect samples to understand similarity range
|