@xdarkicex/openclaw-memory-libravdb 1.4.4 → 1.4.5
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/context-engine.ts +12 -12
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/src/context-engine.ts
CHANGED
|
@@ -279,7 +279,7 @@ export function buildContextEngineFactory(
|
|
|
279
279
|
comparisonExperiment,
|
|
280
280
|
emitComparisonProfile,
|
|
281
281
|
sessionId,
|
|
282
|
-
|
|
282
|
+
durableNamespace,
|
|
283
283
|
visibleMessages: originalMessages,
|
|
284
284
|
messages: normalizedMessages,
|
|
285
285
|
tokenBudget,
|
|
@@ -319,7 +319,7 @@ export function buildContextEngineFactory(
|
|
|
319
319
|
comparisonExperiment,
|
|
320
320
|
emitComparisonProfile,
|
|
321
321
|
sessionId,
|
|
322
|
-
|
|
322
|
+
durableNamespace,
|
|
323
323
|
visibleMessages,
|
|
324
324
|
messages,
|
|
325
325
|
tokenBudget,
|
|
@@ -341,7 +341,7 @@ export function buildContextEngineFactory(
|
|
|
341
341
|
comparisonExperiment: ReturnType<typeof resolveComparisonExperimentConfig>;
|
|
342
342
|
emitComparisonProfile: boolean;
|
|
343
343
|
sessionId: string;
|
|
344
|
-
|
|
344
|
+
durableNamespace: string;
|
|
345
345
|
visibleMessages: MemoryMessage[];
|
|
346
346
|
messages: Array<{ role: string; content: string }>;
|
|
347
347
|
tokenBudget: number;
|
|
@@ -352,7 +352,7 @@ export function buildContextEngineFactory(
|
|
|
352
352
|
const hardItems = authoredHard;
|
|
353
353
|
const hardUsed = tokenCostSum(hardItems);
|
|
354
354
|
const dreamMode = dreamQuery.active;
|
|
355
|
-
const dreamCollection = resolveDreamCollection(
|
|
355
|
+
const dreamCollection = resolveDreamCollection(durableNamespace);
|
|
356
356
|
|
|
357
357
|
if (dreamMode) {
|
|
358
358
|
const authoredSoftTarget = Math.max(0, memoryBudget * (cfg.authoredSoftBudgetFraction ?? 0.3));
|
|
@@ -382,7 +382,7 @@ export function buildContextEngineFactory(
|
|
|
382
382
|
authorityFrequencyWeight: cfg.section7AuthorityFrequencyWeight,
|
|
383
383
|
authorityAuthoredWeight: cfg.section7AuthorityAuthoredWeight,
|
|
384
384
|
sessionId,
|
|
385
|
-
userId,
|
|
385
|
+
userId: durableNamespace,
|
|
386
386
|
},
|
|
387
387
|
);
|
|
388
388
|
const dreamItems = fitPromptBudget(rankedDream, remainingBudget);
|
|
@@ -507,7 +507,7 @@ export function buildContextEngineFactory(
|
|
|
507
507
|
: cached?.userHits
|
|
508
508
|
? Promise.resolve({ results: cached.userHits })
|
|
509
509
|
: rpc.call<{ results: SearchResult[] }>("search_text", {
|
|
510
|
-
collection: `user:${
|
|
510
|
+
collection: `user:${durableNamespace}`,
|
|
511
511
|
text: queryText,
|
|
512
512
|
k: Math.ceil((cfg.topK ?? 8) / 2),
|
|
513
513
|
}),
|
|
@@ -524,7 +524,7 @@ export function buildContextEngineFactory(
|
|
|
524
524
|
|
|
525
525
|
if (!cached && !dreamMode) {
|
|
526
526
|
recallCache.put({
|
|
527
|
-
userId,
|
|
527
|
+
userId: durableNamespace,
|
|
528
528
|
queryText,
|
|
529
529
|
durableVariantHits: [],
|
|
530
530
|
userHits: userHits.results,
|
|
@@ -552,7 +552,7 @@ export function buildContextEngineFactory(
|
|
|
552
552
|
|
|
553
553
|
profiler?.mark("recall_elevated");
|
|
554
554
|
const elevatedGeneration = elevatedRecallGeneration.get(sessionId) ?? 0;
|
|
555
|
-
const elevatedKey = `${sessionId}\n${elevatedGeneration}\n${
|
|
555
|
+
const elevatedKey = `${sessionId}\n${elevatedGeneration}\n${durableNamespace}\n${queryText}`;
|
|
556
556
|
const cachedElevated = elevatedRecallCache.get(elevatedKey);
|
|
557
557
|
const [elevatedHits] = await Promise.all([
|
|
558
558
|
dreamMode
|
|
@@ -561,7 +561,7 @@ export function buildContextEngineFactory(
|
|
|
561
561
|
? Promise.resolve({ results: cachedElevated })
|
|
562
562
|
: rpc.call<{ results: SearchResult[] }>("search_text_collections", {
|
|
563
563
|
collections: [
|
|
564
|
-
`${ELEVATED_USER_COLLECTION_PREFIX}${
|
|
564
|
+
`${ELEVATED_USER_COLLECTION_PREFIX}${durableNamespace}`,
|
|
565
565
|
`${ELEVATED_SESSION_COLLECTION_PREFIX}${sessionId}`,
|
|
566
566
|
],
|
|
567
567
|
text: queryText,
|
|
@@ -593,7 +593,7 @@ export function buildContextEngineFactory(
|
|
|
593
593
|
authorityFrequencyWeight: cfg.section7AuthorityFrequencyWeight,
|
|
594
594
|
authorityAuthoredWeight: cfg.section7AuthorityAuthoredWeight,
|
|
595
595
|
sessionId,
|
|
596
|
-
userId,
|
|
596
|
+
userId: durableNamespace,
|
|
597
597
|
},
|
|
598
598
|
);
|
|
599
599
|
|
|
@@ -706,12 +706,12 @@ export function buildContextEngineFactory(
|
|
|
706
706
|
// coarse for exact-turn recall. Search the immutable per-user raw turn index instead of
|
|
707
707
|
// widening topK so precise historical turns still have a bounded path back into context.
|
|
708
708
|
const rawUserResults = await rpc.call<{ results: SearchResult[] }>("search_text", {
|
|
709
|
-
collection: `turns:${
|
|
709
|
+
collection: `turns:${durableNamespace}`,
|
|
710
710
|
text: queryText,
|
|
711
711
|
k: Math.max((cfg.topK ?? 8) * 4, 8),
|
|
712
712
|
excludeIds: recoveryExcludeIDs,
|
|
713
713
|
});
|
|
714
|
-
const annotatedUserResults = annotateCollection(rawUserResults.results ?? [], `turns:${
|
|
714
|
+
const annotatedUserResults = annotateCollection(rawUserResults.results ?? [], `turns:${durableNamespace}`);
|
|
715
715
|
temporalRecoveryResult = temporalSelectorGuard.shouldApply
|
|
716
716
|
? rankTemporalRecoveryCandidates(annotatedUserResults, {
|
|
717
717
|
queryText,
|