mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7701] [MERGED] feat(memory): Decision recall shortlist by meaning, time sized to the backend #7888
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7888
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-Engine/pull/7701
Author: @SpicyMarinara
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/memory-recall-shortlist📝 Commits (8)
76a9cfcfeat(memory): Decision recall shortlists by meaning, with time sized to its modela81b5cbdocs(memory): Decision recall shortlist, time limits and continuationsfedc429Merge branch 'staging' into feat/memory-recall-shortlistc47698afix(memory): Decision recall keeps word order until vectors cover the archive2f9ba69feat(memory): recall reads every user message since the responder spoke5205d0bfix(memory): a user message with no text is no recall querybb2713efix(memory): continuations and rejected long turns keep span recall80eb565fix(memory): retry rejected embeddings after a cooldown; image-only last message keeps the word cues📊 Changes
15 files changed (+1451 additions, -124 deletions)
View changed files
📝
docs/agents/memory.md(+6 -4)📝
packages/client/src/components/chat/AdvancedMemoryInspector.tsx(+1 -0)📝
packages/client/src/localization/locales/en.json(+1 -0)📝
packages/server/src/routes/generate.routes.ts(+1 -0)📝
packages/server/src/services/advanced-memory-decisions.ts(+139 -30)📝
packages/server/src/services/advanced-memory-ranking.ts(+86 -2)📝
packages/server/src/services/advanced-memory.ts(+301 -75)📝
packages/server/src/services/decision/decision-default.ts(+21 -0)📝
packages/server/src/services/generation/advanced-memory-context.ts(+7 -1)📝
scripts/regressions/advanced-memory-context.regression.ts(+16 -2)📝
scripts/regressions/advanced-memory-decisions.regression.ts(+25 -8)📝
scripts/regressions/advanced-memory-post-generation.regression.ts(+8 -0)➕
scripts/regressions/advanced-memory-recall-fusion.regression.ts(+833 -0)📝
scripts/regressions/advanced-memory-recall-shortlist.regression.ts(+2 -1)📝
scripts/regressions/advanced-memory-recollections.regression.ts(+4 -1)📄 Description
Linked issue
Closes #7699
Why this change
With the Decision model on, Advanced Memory recall sends only a 24-scene shortlist to the model. Decision mode had embeddings off, so that shortlist came from word matching alone. In long chats the right scene often never reached the model:
The fixed 10 s per pass was also too short for slower Decision backends, so recall fell back. Mari agreed to the plan on 2026-10-15. She asked that waits not get too long and that nothing lag the frontend.
What changed
Measured offline with the real ranking code and the local MiniLM embedder loaded from disk. The corpus is synthetic and themed, with planted target events. No model calls and no user data. The table is the share of trials where the target reaches the Decision shortlist (24 trials per cell, 2 seeds):
prepare()went from 321 to 294 ms at 200 scenes and from 4,862 to 4,659 ms at 800. Reading the records now uses a projected select: 156 → 37 ms at 800 scenes.Group replies (follow-up
2f9ba69ab, Mari's request). Same harness and corpus. The responder spoke, then the user and another character talked: user, other, user, other, user. The new question types put the cue only in the first user message (the latest is small talk), or only in the other character's line. Share of 24 trials where the target reaches the shortlist, latest message only → shipped:Time limits:
Design calls made while measuring:
Known, not changed here:
prepare()itself takes about 4.7 s, mostlyrecordValidrebuilding message maps. That predates this PR and needs its own issue.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-run validation:
check-locales;localization:checkadvanced-memory*,memory-*anddecision*, plusagent-activation*,spatial-contextandopen-issues.pngvs.webp), fails on staging too.2f9ba69aband5205d0b27: tsc for shared, server, client and root, server lint and prettier pass, and so do the 40 regression files matchingadvanced-memory,memory-,decision,agent-activation,spatial-contextandopen-issues. The new group-span, cap, upkeep and Reindex cases fail onc47698a71, and the image-only case fails on2f9ba69ab. Local CodeRabbit on2f9ba69ab: one finding, the docs-i18n follow-up, now #7708. Not rerun for the follow-up: Playwright and the localization checks (no client change).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Translated docs follow-up: #7708 (
[docs-i18n] docs/agents/memory.md).UI evidence (if applicable)
No UI change apart from one receipt reason in the memory inspector.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.