mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[PR #1472] [MERGED] fix(long-term-memory): fast keyword lane, recall one distinctive keyword BM25 agrees with (1.4.54) #1478
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#1478
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1472
Author: @SpicyMarinara
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/ltm-keyword-lane-1467-1465📝 Commits (2)
e3db751perf(long-term-memory): scan keyword tokens without a regex per call (#1467)e565255fix(long-term-memory): recall one distinctive keyword when BM25 agrees (#1465)📊 Changes
14 files changed (+337 additions, -90 deletions)
View changed files
➕
artifacts/long-term-memory-1.4.54.zip(+0 -0)📝
catalog/catalog.json(+6 -6)📝
catalog/notes.json(+6 -6)📝
catalog/v2/catalog.json(+6 -6)📝
catalog/v2/notes.json(+6 -6)📝
catalog/v3/catalog.json(+6 -6)📝
catalog/v3/notes.json(+6 -6)📝
packages/long-term-memory/CHANGELOG.md(+5 -0)📝
packages/long-term-memory/manifest.json(+3 -3)📝
packages/long-term-memory/server.mjs(+39 -39)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/recall/keyword-index.ts(+47 -6)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/recall/retrieval.ts(+12 -2)📝
scripts/build-feature-packages.mjs(+1 -1)📝
tests/long-term-memory-index-keys.regression.ts(+194 -3)📄 Description
Pull request
Linked issue
Closes #1467
Closes #1465
Both issues and their measurements are by @Promansis. The maintainer asked for both to land in this release. They touch the same two files, so they land one after the other in one PR, as #1467 asks: two commits, one patch release.
Why this change
What changed
S=packages/long-term-memory/src/engine/packages/server/src/services/long-term-memoryCommit 1: #1467
S/recall/keyword-index.ts:containsKeywordTokenis anindexOfscan over every occurrence, with one module-level/[\p{L}\p{N}]/utest on the code point before and after. It keeps the old rule exactly. A whole occurrence after one inside a word still counts. An empty needle stops at the end of the string (indexOfclamps it there, so the loop needs that stop). A surrogate pair before the match is read as one code point, and a match never starts or ends inside a pair, like theuregex.S/recall/retrieval.ts:searchLtmKeywordIndexruns only when(input.keywordWeight ?? 1) > 0.Commit 2: #1465
S/recall/keyword-index.ts:searchLtmKeywordIndextakes an optionallexicalScoresmap (chunk id to BM25 normalized score). In the #1264 cap loop, a single exact keyword hit that the cap would cut (score at or aboveLTM_KEYWORD_MAX_SCORE / 2) and whose lexical score is at least the new exportedLTM_SINGLE_KEYWORD_BM25_AGREEMENT(0.2) scoresLTM_KEYWORD_MAX_SCORE * 0.75instead. Names, phrases, two-keyword hits, and keywords the cap does not cut are unchanged.S/recall/retrieval.ts: passes the BM25 normalized scores it already computes.Release
long-term-memory1.4.54 (1.4.53 was the highest published version), withCHANGELOG.md, version, manifest, rebuiltserver.mjs, artifact, catalog entries and notes.client.jsis unchanged.## Unreleased. The bullets went under## 1.4.54 — 2026-10-19instead, because the notes build drops an undated heading and would then fail: "CHANGELOG leads with 1.4.53 but the catalog publishes 1.4.54".MARINARA_ENGINE_ROOTpinned to Enginea2e3f13d8(current Enginestaging). Before any change, it rebuilt the unchanged 1.4.53 byte for byte (git statusclean).For reviewers
retrieveLongTermMemorycaller, not only chat recall. Source extraction context and candidate reconciliation use no threshold, but they rank by fused score, so a lifted chunk can move up a little there too. Their regressions pass unchanged.Package and security impact
long-term-memoryValidation
node scripts/validate-catalog.mjspasses locallygit diff --checkpasses locallyCONTRIBUTING.mdRun by the coding agent, not by a person, on Node v24.16.0:
npm run test:security: passes (catalog path safety, then the Long-Term Memory index-keys regression with every new case).ltm-browser.yml, run through the Engine worktree ata2e3f13d8withMARINARA_ENGINE_ROOTset: candidate-reconciliation, conversation-summary-import, debug-log, delta-review, extraction-graph, engine-fields, extraction-reliability, index-keys, local-characters, reconciliation-recall, branch-recall, storage, routes, routes-imports, routes-drafts, routes-scope-identity, routes-backup, runtime, installation and host-styles all pass, plusnode tests/long-term-memory-loading.regression.mjs. The browser regression was not run.pull-request-checks.yml(scope-targets, scope-fallback-labels, tab-keys, review-queue-ambiguous-link, source-task, source-pagination, debug-activity, feedback-clarity-ui): all pass.npm run check: Prettier clean; ESLint 0 errors. Its 811 warnings are pre-existing, and none are in the changed files.node scripts/test-catalog-lanes.mjs,node scripts/validate-package-locales.mjs,node scripts/validate-catalog.mjs,node scripts/tests/catalog-release-notes.regression.mjs,git diff --check: all pass.origin/staging, every containment case passes and only thekeywordWeight: 0check fails, which shows the cases pin the existing rule. On commit 1, the #1465 unit case fails. With the newkeyword-index.tsbut the oldretrieval.ts, the violin retrieval case fails.Manual verification notes
Not done by the agent: an install through Marinara Engine, or a live recall.
Documentation impact
The agent changed no documentation: recall settings, catalog membership and setup are unchanged.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.