[PR #1269] [MERGED] fix(long-term-memory): 1.4.16 — calibrate recall signals #1375

Closed
opened 2026-10-21 05:10:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1269
Author: @Promansis
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @Promansis

Base: staging ← Head: fix(ltm)/1264-recall-signal-calibration


📝 Commits (4)

  • 2c29207 fix(long-term-memory): 1.4.16 — calibrate recall signals
  • 42ca1b7 Merge remote-tracking branch 'upstream/staging' into fix(ltm)/1264-recall-signal-calibration
  • 5e65bb6 fix(long-term-memory): align BM25 and name scoring
  • bc1fcd7 fix(long-term-memory): credit BM25 matches beyond the reference terms

📊 Changes

20 files changed (+431 additions, -183 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.16.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/long-term-memory/CHANGELOG.md (+7 -0)
📝 packages/long-term-memory/client.js (+27 -27)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+36 -36)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/MemorySettings.tsx (+2 -1)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+1 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/bm25.ts (+30 -5)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/keyword-index.ts (+53 -20)
📝 packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/constants.ts (+28 -22)
📝 packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/runtime-settings.ts (+6 -1)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-index-keys.regression.ts (+159 -6)
📝 tests/long-term-memory-runtime.regression.ts (+34 -16)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1264

Why this change

On real vaults, one everyday keyword can dominate recall while long chat windows dilute BM25 and fuzzy matching may miss keywords beyond an alphabetical catalog cap. This calibrates these signals while preserving useful name, phrase, and multi-keyword recall.

What changed

  • Long-Term Memory 1.4.16 caps an ordinary single exact keyword at half the keyword lane; names, phrases, and distinct keyword matches retain their intended signal.
  • BM25 normalizes against the eight highest-idf indexed query terms; bounded fuzzy-catalog selection uses query overlap.
  • Recall presets and saved-threshold handling are calibrated; package payloads, manifest, archive, and catalog lanes were rebuilt.

Package and security impact

  • Affected package IDs: long-term-memory 1.4.16.
  • Engine compatibility impact: unchanged (2.4.1 minimum, <4.0.0 maximum).
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: no storage migration or permission change; exact-archive install/lifecycle regressions pass.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated proof on the published HEAD: test-ltm.sh all, test-ltm.sh lifecycle, npm run check, npm run typecheck:packages, catalog-lane, locale, catalog, and catalog-release-notes validators all passed. The new single-exact-plus-multiple-fuzzy regression failed before the cap change and passed afterward. Installation, offline restart, uninstall, reinstall, and browser lifecycle passed against the rebuilt 1.4.16 archive.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

Summary by CodeRabbit

  • Improvements
    • Long-Term Memory 1.4.16 adjusts keyword scoring: a single exact keyword receives less weight unless it is a name or phrase, and fuzzy keyword results are prioritized by relevance to the query.
    • BM25 scores are less affected by adding lower-relevance terms to a query.
    • Recall presets have been rescaled, and the balanced preset has been retuned for the default threshold.
  • Settings
    • Score thresholds above 0.4 are now capped at 0.4. Review custom weights and saved thresholds.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1269 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(ltm)/1264-recall-signal-calibration` --- ### 📝 Commits (4) - [`2c29207`](https://github.com/Pasta-Devs/Marinara-Agents/commit/2c2920744954d9ae74b92e91be17b3e76a2d8631) fix(long-term-memory): 1.4.16 — calibrate recall signals - [`42ca1b7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/42ca1b7df7f24fa81441feedd5d20ff54c5128e8) Merge remote-tracking branch 'upstream/staging' into fix(ltm)/1264-recall-signal-calibration - [`5e65bb6`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5e65bb62ace97be80f5ec44befc8f0cc791b2a80) fix(long-term-memory): align BM25 and name scoring - [`bc1fcd7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/bc1fcd7189956a2e1d4078c22470abc4b2b6acc1) fix(long-term-memory): credit BM25 matches beyond the reference terms ### 📊 Changes **20 files changed** (+431 additions, -183 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.16.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/long-term-memory/CHANGELOG.md` (+7 -0) 📝 `packages/long-term-memory/client.js` (+27 -27) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+36 -36) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/MemorySettings.tsx` (+2 -1) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+1 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/bm25.ts` (+30 -5) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/keyword-index.ts` (+53 -20) 📝 `packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/constants.ts` (+28 -22) 📝 `packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/runtime-settings.ts` (+6 -1) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-index-keys.regression.ts` (+159 -6) 📝 `tests/long-term-memory-runtime.regression.ts` (+34 -16) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1264 ## Why this change On real vaults, one everyday keyword can dominate recall while long chat windows dilute BM25 and fuzzy matching may miss keywords beyond an alphabetical catalog cap. This calibrates these signals while preserving useful name, phrase, and multi-keyword recall. ## What changed - Long-Term Memory 1.4.16 caps an ordinary single exact keyword at half the keyword lane; names, phrases, and distinct keyword matches retain their intended signal. - BM25 normalizes against the eight highest-idf indexed query terms; bounded fuzzy-catalog selection uses query overlap. - Recall presets and saved-threshold handling are calibrated; package payloads, manifest, archive, and catalog lanes were rebuilt. ## Package and security impact - Affected package IDs: `long-term-memory` 1.4.16. - Engine compatibility impact: unchanged (`2.4.1` minimum, `<4.0.0` maximum). - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: no storage migration or permission change; exact-archive install/lifecycle regressions pass. ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Automated proof on the published HEAD: `test-ltm.sh all`, `test-ltm.sh lifecycle`, `npm run check`, `npm run typecheck:packages`, catalog-lane, locale, catalog, and catalog-release-notes validators all passed. The new single-exact-plus-multiple-fuzzy regression failed before the cap change and passed afterward. Installation, offline restart, uninstall, reinstall, and browser lifecycle passed against the rebuilt 1.4.16 archive. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Long-Term Memory 1.4.16 adjusts keyword scoring: a single exact keyword receives less weight unless it is a name or phrase, and fuzzy keyword results are prioritized by relevance to the query. * BM25 scores are less affected by adding lower-relevance terms to a query. * Recall presets have been rescaled, and the balanced preset has been retuned for the default threshold. * **Settings** * Score thresholds above 0.4 are now capped at 0.4. Review custom weights and saved thresholds. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:10:02 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1375
No description provided.