mr-memory 2.20.1 → 2.21.0
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/index.ts +5 -4
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -364,7 +364,6 @@ const memoryRouterPlugin = {
|
|
|
364
364
|
},
|
|
365
365
|
body: JSON.stringify({
|
|
366
366
|
messages: contextPayload,
|
|
367
|
-
session_id: ctx.sessionKey,
|
|
368
367
|
density,
|
|
369
368
|
...(embeddings && { embeddings }),
|
|
370
369
|
}),
|
|
@@ -466,7 +465,7 @@ const memoryRouterPlugin = {
|
|
|
466
465
|
contextPayload.push({ role: "user", content: cleanedPrompt });
|
|
467
466
|
}
|
|
468
467
|
|
|
469
|
-
// 4. Call /v1/memory/prepare
|
|
468
|
+
// 4. Call /v1/memory/prepare (no session_id — always search core vault)
|
|
470
469
|
|
|
471
470
|
const res = await fetch(`${endpoint}/v1/memory/prepare`, {
|
|
472
471
|
method: "POST",
|
|
@@ -476,7 +475,6 @@ const memoryRouterPlugin = {
|
|
|
476
475
|
},
|
|
477
476
|
body: JSON.stringify({
|
|
478
477
|
messages: contextPayload,
|
|
479
|
-
session_id: ctx.sessionKey,
|
|
480
478
|
density,
|
|
481
479
|
...(embeddings && { embeddings }),
|
|
482
480
|
}),
|
|
@@ -499,12 +497,16 @@ const memoryRouterPlugin = {
|
|
|
499
497
|
memory_tokens?: number;
|
|
500
498
|
};
|
|
501
499
|
|
|
500
|
+
log(`memoryrouter: prepare response — memories_found=${data.memories_found || 0}, context_length=${data.context?.length || 0}, tokens=${data.memory_tokens || 0}, embeddings=${embeddings || 'bge'}`);
|
|
501
|
+
|
|
502
502
|
if (data.context) {
|
|
503
503
|
log(
|
|
504
504
|
`memoryrouter: injected ${data.memories_found || 0} memories (${data.memory_tokens || 0} tokens)`,
|
|
505
505
|
);
|
|
506
506
|
const wrapped = wrapForInjection(data.context);
|
|
507
507
|
return { prependContext: wrapped };
|
|
508
|
+
} else {
|
|
509
|
+
log(`memoryrouter: prepare returned no context (memories_found=${data.memories_found || 0})`);
|
|
508
510
|
}
|
|
509
511
|
} catch (err) {
|
|
510
512
|
log(
|
|
@@ -595,7 +597,6 @@ const memoryRouterPlugin = {
|
|
|
595
597
|
},
|
|
596
598
|
body: JSON.stringify({
|
|
597
599
|
messages: toStore,
|
|
598
|
-
session_id: ctx.sessionKey,
|
|
599
600
|
model: "unknown",
|
|
600
601
|
...(embeddings && { embeddings }),
|
|
601
602
|
}),
|