mr-memory 2.20.0 → 2.20.2
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 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -499,12 +499,16 @@ const memoryRouterPlugin = {
|
|
|
499
499
|
memory_tokens?: number;
|
|
500
500
|
};
|
|
501
501
|
|
|
502
|
+
log(`memoryrouter: prepare response — memories_found=${data.memories_found || 0}, context_length=${data.context?.length || 0}, tokens=${data.memory_tokens || 0}, embeddings=${embeddings || 'bge'}`);
|
|
503
|
+
|
|
502
504
|
if (data.context) {
|
|
503
505
|
log(
|
|
504
506
|
`memoryrouter: injected ${data.memories_found || 0} memories (${data.memory_tokens || 0} tokens)`,
|
|
505
507
|
);
|
|
506
508
|
const wrapped = wrapForInjection(data.context);
|
|
507
509
|
return { prependContext: wrapped };
|
|
510
|
+
} else {
|
|
511
|
+
log(`memoryrouter: prepare returned no context (memories_found=${data.memories_found || 0})`);
|
|
508
512
|
}
|
|
509
513
|
} catch (err) {
|
|
510
514
|
log(
|
|
@@ -886,6 +890,7 @@ const memoryRouterPlugin = {
|
|
|
886
890
|
headers: {
|
|
887
891
|
Authorization: `Bearer ${memoryKey}`,
|
|
888
892
|
"Content-Type": "application/json",
|
|
893
|
+
...(embeddings && { "X-Embedding-Model": embeddings }),
|
|
889
894
|
},
|
|
890
895
|
body: JSON.stringify({ query, limit }),
|
|
891
896
|
});
|