mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
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#1372
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/1261
Author: @Promansis
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @Promansis
Base:
staging← Head:fix(ltm)/recall-calibration-1258📝 Commits (2)
f4dc06afix(long-term-memory): 1.5.0 — calibrate recall lanes and retune presets (#1258)7e574bbfix(long-term-memory): 1.4.13 — scope keyword frequency and let broad keyword hits pass (#1258)📊 Changes
23 files changed (+302 additions, -135 deletions)
View changed files
➕
artifacts/long-term-memory-1.4.13.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(+6 -0)📝
packages/long-term-memory/client.js(+2 -2)📝
packages/long-term-memory/manifest.json(+5 -5)📝
packages/long-term-memory/server.mjs(+44 -44)📝
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(+18 -1)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/keyword-index.ts(+30 -1)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/ranking.ts(+8 -1)📝
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/retrieval.ts(+6 -1)📝
packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/constants.ts(+27 -24)📝
packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/runtime-settings.ts(+6 -5)📝
packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema.ts(+2 -2)📝
scripts/build-feature-packages.mjs(+1 -1)...and 3 more files
📄 Description
Linked issue
Closes #1258
Why this change
x/(x+1)of an unbounded idf sum), keyword relevance summed matches until two generic names reached 1.0, and the presets kept every lane weight well below 1. The score threshold therefore behaved as a cliff: on the labelled fixture,balancedwent from 16.8 memories at 0.25 to 2.8 at 0.30, andexactignored any threshold up to 0.5.roleplay → story,game → exact) never applied, because resolved global settings always carry a style.What changed
bm25.ts,ranking.ts,retrieval.ts: BM25 hits carry an explicitnormalizedScore; fusion prefers it overrawScore/(rawScore+1); raw scores stay inrawLaneScores. Aponytail:note records that the coverage reference is not an upper bound (a short chunk with repeated terms can clamp at 1 beside a full match) and why the true ceilingΣidf·(K1+1)was rejected: it compresses real hits below ~0.3, so no lexical-only memory could pass a threshold.keyword-index.ts: best match per chunk instead of a sum, scaled bylog(1 + N/df) / log(1 + N). Like the #1251 caps,Nanddfcount only the chunks the search may return, so a keyword common in other chats keeps its weight where it is distinctive; counts are computed once per query and keyword.constants.ts,schema.ts,runtime-settings.ts: retuned presets and defaults; balanced is the single fallback style. Graph weights stay at or below 0.6 (graph-only neighbours top out at 0.3, under the default threshold) and keyword weights at or above 0.5 (an exact keyword term, 0.75 × weight, clears it without the semantic lane).locales/en.json: threshold help describes the shared 0–1 scale and the graph lane's half-weight ceiling.index-keysgains the lane-calibration case, a scoped keyword-frequency case, and a guard that every preset's strongest weight is 1, its graph-only floor stays under the default threshold, and an exact keyword term clears it; theruntimethreshold-equality case now pins custom weights below 1, and the strongest-lane threshold case moves from 0.75 to 0.4 because keyword no longer saturates.long-term-memory1.4.13: manifest,client.js,server.mjs,artifacts/long-term-memory-1.4.13.zipand catalog lane entries; CHANGELOG 1.4.13 entry on top of staging's unchanged 1.4.12.Evidence
Labelled 45-note fixture with real all-MiniLM-L6-v2 embeddings, measured against this branch's own retrieval code (168/168 identical selections with
retrieveLongTermMemory), 12 relevant queries.Lane separation (normalized score before weighting, median relevant / non-relevant):
Threshold behaviour, maxChunks 12, both on this PR's lanes:
balancedinjected per query at 0.35 (queries left empty)balanced, semantic lane unavailablebalancedinjected per query, threshold 0.35 → 0.55broad, semantic lane unavailable, at 0.35Regression proof:
index-keysfails on the pre-fix lane sources (a long query must not normalize every BM25 hit above 0.9), on the 1.4.11 presets (balanced: the strongest lane must carry weight 1), on vault-wide keyword frequency (a keyword common only outside the recall scope must keep full weight inside it) and onbroadkeyword 0.3 (broad: an exact keyword term must clear the default threshold), and passes on this branch.Merge danger
Door: two-way. Weights and defaults are constants; reverting restores the old scale. No storage, index or migration change.
Blast radius: recall.
broadnow recalls exact keyword matches only; BM25-only matches stay under 0.35 (lexical 0.4 × BM25 tops out near 0.28). The semantic lane is raw cosine, so a configured embedder other than MiniLM shifts where the threshold bites.Package and security impact
long-term-memoryValidation
node scripts/validate-catalog.mjspasses locallygit diff --checkpasses locallyCONTRIBUTING.mdManual verification notes
On
7e574bb6fae704735274997d43ce90719de33e04(pushed SHA), withMARINARA_AGENTS_ROOTset to the worktree andMARINARA_ENGINE_ROOTto an independent Engine checkout atc5a545857:test-ltm.shforindex-keys,runtime,storage,extraction-graph,extraction-reliability,routes,source-task,browser,debug-activity: pass.candidate-reconciliationandreconciliation-recallrun directly withtsx: pass.test-ltm.sh installation: pass ("Long-Term Memory 1.4.13 installation: install, offline restart, backup inclusion, uninstall, reinstall, and durable-byte preservation ok") against the committed ZIP.test-fast.sh,npm run typecheck:packages,npm run test:security,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: pass.index-keysassertions listed under Evidence fails on the old code and passes on this branch.artifacts/long-term-memory-1.4.12.zipare byte-identical tostaging.Documentation impact
en.jsonis updated with the code.UI evidence (if applicable)
None. The settings form reads the preset table, so it shows the new weights; no layout change.
🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.