@byte5ai/palaia 2.0.2 → 2.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/hooks.ts +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byte5ai/palaia",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Palaia memory backend for OpenClaw",
5
5
  "main": "index.ts",
6
6
  "openclaw": {
package/src/hooks.ts CHANGED
@@ -1416,8 +1416,13 @@ export function registerHooks(api: any, config: PalaiaPluginConfig): void {
1416
1416
  }
1417
1417
 
1418
1418
  // Track recall in session-isolated turn state for emoji reactions
1419
+ // Only flag recall as meaningful if at least one result scores above threshold
1420
+ const RECALL_RELEVANCE_THRESHOLD = 0.7;
1421
+ const hasRelevantRecall = entries.some(
1422
+ (e) => typeof e.score === "number" && e.score >= RECALL_RELEVANCE_THRESHOLD,
1423
+ );
1419
1424
  const sessionKey = resolveSessionKeyFromCtx(ctx);
1420
- if (sessionKey) {
1425
+ if (sessionKey && hasRelevantRecall) {
1421
1426
  const turnState = getOrCreateTurnState(sessionKey);
1422
1427
  turnState.recallOccurred = true;
1423
1428