@xdarkicex/openclaw-memory-libravdb 1.4.3 → 1.4.4

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/src/scoring.ts CHANGED
@@ -334,8 +334,10 @@ export function rankRawUserRecoveryCandidates(
334
334
  );
335
335
  const intentAlignmentBonus = computeIntentAlignmentBonus(item.text, intentPhrases);
336
336
  const finalScore = clamp01(
337
- (0.30 * semanticScore) +
338
- (0.60 * lexicalCoverage) +
337
+ // Raw recovery is a precision-sensitive fallback: exact-turn recall is
338
+ // usually better served by lexical overlap than by broad semantic drift.
339
+ (0.20 * semanticScore) +
340
+ (0.70 * lexicalCoverage) +
339
341
  (0.10 * recencyScore) +
340
342
  intentAlignmentBonus,
341
343
  );
@@ -515,7 +517,8 @@ function computeIntentAlignmentBonus(text: string, intentPhrases: string[]): num
515
517
  if (matched === 0) {
516
518
  return 0;
517
519
  }
518
- return Math.min(0.08, matched * 0.02);
520
+ // Keep this a small nudge so phrase overlap cannot overwhelm lexical precision.
521
+ return Math.min(0.04, matched * 0.01);
519
522
  }
520
523
 
521
524
  function extractIntentPhrases(text: string): string[] {