[GH-ISSUE #7699] Advanced Memory recall: meaning-aware shortlist for the Decision model, time sized to the backend #4251

Closed
opened 2026-10-21 06:13:32 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7699

Originally assigned to: @SpicyMarinara on GitHub.

Agreed with Mari on 2026-10-15, after a code study of Advanced Memory recall.

Problem: with the Decision model on, only the top 24 scenes of a word-match shortlist ever reach the model, and Decision mode turns embeddings off. In long chats, the right scene often never reaches the model. An offline measurement on synthetic chats of whether the target scene reaches the 24:

Kind of question 200 scenes 800 scenes
A character who appears in 30% of scenes 8–50% 0–8%
"What happened after X" 17–25% 0–8%
A paraphrase with no shared words 67–100% 42–75%

The Decision step's 10 s limit is also too short for slower backends (the local 9B model), so it falls back.

Planned:

  1. Turn embeddings back on in Decision mode, and fuse the word and meaning rankings for the shortlist. The embedding query leads with the latest user message. Missing vectors are filled in gradually after replies, with no manual reindex and no lag.
  2. Give each Decision pass a time limit sized to the backend's speed and to the number of items it judges, with a reasonable cap.
  3. Small fixes:
    • Each candidate carries a compact date and participants line.
    • The scene after a strong match joins the shortlist ("after X").
    • One failed batch keeps the answers from the batches that succeeded.
    • Chinese and Japanese text is split into words.
    • The docs say continuations rerun recall, which is what the code does.
  4. Proof: deterministic regressions, plus a before/after measurement at 60/200/800 synthetic scenes, reported in the PR.

Rejected: a "summaries of summaries → Decision model picks X" stage. The Decision model answers one yes/no per item, so judging every gist at 800 scenes needs about 34 requests (minutes on local models), and gists drop details that message matching finds today.

Originally created by @SpicyMarinara on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7699 Originally assigned to: @SpicyMarinara on GitHub. Agreed with Mari on 2026-10-15, after a code study of Advanced Memory recall. **Problem:** with the Decision model on, only the top 24 scenes of a word-match shortlist ever reach the model, and Decision mode turns embeddings off. In long chats, the right scene often never reaches the model. An offline measurement on synthetic chats of whether the target scene reaches the 24: | Kind of question | 200 scenes | 800 scenes | |---|---|---| | A character who appears in 30% of scenes | 8–50% | 0–8% | | "What happened after X" | 17–25% | 0–8% | | A paraphrase with no shared words | 67–100% | 42–75% | The Decision step's 10 s limit is also too short for slower backends (the local 9B model), so it falls back. **Planned:** 1. Turn embeddings back on in Decision mode, and fuse the word and meaning rankings for the shortlist. The embedding query leads with the latest user message. Missing vectors are filled in gradually after replies, with no manual reindex and no lag. 2. Give each Decision pass a time limit sized to the backend's speed and to the number of items it judges, with a reasonable cap. 3. Small fixes: - Each candidate carries a compact date and participants line. - The scene after a strong match joins the shortlist ("after X"). - One failed batch keeps the answers from the batches that succeeded. - Chinese and Japanese text is split into words. - The docs say continuations rerun recall, which is what the code does. 4. Proof: deterministic regressions, plus a before/after measurement at 60/200/800 synthetic scenes, reported in the PR. Rejected: a "summaries of summaries → Decision model picks X" stage. The Decision model answers one yes/no per item, so judging every gist at 800 scenes needs about 34 requests (minutes on local models), and gists drop details that message matching finds today.
Author
Owner

@SpicyMarinara commented on GitHub (Oct 16, 2026):

Fixed on staging by #7701. The Decision recall shortlist uses meaning as well as words: fused once vectors cover 90% of the archive, filled in gradually after replies. Each Decision pass gets time sized to its backend, under one deadline per reply. The search reads every user message since the responder last spoke. Also: a date and participants line for each scene, the scene after a strong match, partial batches kept, and Chinese/Japanese word pairs. The prepare() cost at very large archives is tracked separately in #7702.

<!-- gh-comment-id:6204988152 --> @SpicyMarinara commented on GitHub (Oct 16, 2026): Fixed on staging by #7701. The Decision recall shortlist uses meaning as well as words: fused once vectors cover 90% of the archive, filled in gradually after replies. Each Decision pass gets time sized to its backend, under one deadline per reply. The search reads every user message since the responder last spoke. Also: a date and participants line for each scene, the scene after a strong match, partial batches kept, and Chinese/Japanese word pairs. The prepare() cost at very large archives is tracked separately in #7702.
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-Engine#4251
No description provided.