mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1840] [Feature]: Long-Term Memory: let recall return whole memories instead of ranked parts, as an option for other Agents #1781
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#1781
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?
Originally created by @Promansis on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1840
Originally assigned to: @Promansis on GitHub.
What problem does this solve?
long-term-memory:recall(SV-2, #1567) ranks memories against what the caller is about to write and returns only the parts that score best, cut tomaxTokens. That is the right default for most callers, but Slurp and Noodle are about to use recall, and their users have very different setups (small vaults, local models, long or short memories). The maintainer wants the user to choose between ranked parts and whole memories, with whole memories as the default first, so we can check that memories reach the posts at all before tuning ranking. Today the only way to get whole memories islong-term-memory:storage(listNotes), which skips recall's privacy rules (subjects, mode, persona) and which we want to remove (tracker SN-6).Tracker: SN-3 (and SN-2), unblocks SN-6.
Proposed package or change
One optional input on the recall service,
whole, that returns whole memories under the same rules as ranked recall.long-term-memoryonly, patch bump. Nothing changes in the Engine, Slurp or Noodle.Minimal fix
S =
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory.whole: z.boolean().default(false)inrecallInputSchema(S/services/recall.ts).queryTextstays required in both modes, so a caller writes one call for both and an older LTM, which strips the unknown key, answers with ranked parts instead ofnull.SECTION_TYPESindex, then byupdatedAtnewest first. A memory's text ischunkNoteSections(note)(S/recall/chunking.ts) texts joined by"\n"; a memory with no text is skipped. Add memories in that order while their estimated tokens fitmaxTokens; a memory that doesn't fit is skipped (never cut), and later smaller ones can still fit. At most 20 sections. Use the token estimate recall already uses (estimateTokensinS/recall/budget.ts; export it rather than copy it). No retrieval call, so no embeddings are needed.nullcases, abort handling,recordLtmPackageRead(…, "package_recall", caller, count)and the result shape.versionstays 1: the new input is additive (the contract's own rule).packages/long-term-memory/docs/ARCHITECTURE.md§ "Services for Other Packages": documentwhole, its order (type, then newest first), the skip-don't-cut rule and that an older LTM ignores it and ranks.## Unreleased: "Other Agents that read memories, such as Slurp and Noodle, can ask for whole memories instead of the parts that fit what they are writing. The same memories are shared either way."Regression proof
tests/long-term-memory-runtime.regression.ts, in the existing recall block (recallRoot, memories forchar-a):whole: trueforchar-areturns the same set of memory ids as ranked recall, in type order, eachtextequal to that memory's full section text;maxTokenssmaller than the largest memory but larger than a later one, the large memory is missing and the later one is present with its full text;whole: truewith the switch off givesnull, and withmode: "conversation"against roleplay-only memories gives{ version: 1, sections: [] }.Each of these mutations fails an assertion: whole mode without the subject rule, cutting a memory to fit instead of skipping it, and oldest-first order.
Why should this be optional?
It is an input on an existing service inside an optional package, off unless a caller asks for it. The choice itself is a setting in each reading Agent (Slurp, Noodle). Long-Term Memory's "Other Agents can read memories" switch still stops every read.
Alternatives considered
long-term-memory:storage: it skips the subject, mode and persona rules, and it keeps a second service alive that SN-6 removes.recallWholemethod: two methods to document and keep in step for one difference.maxTokensin ranked mode: recall still returns parts and still ranks against the query, so it is not "whole memories".Additional context
Follows #1567 (SV-2) and #1805 (SN-1, the Sharing table). Slurp (
issues/slurp-ltm-recall.md, SN-3) and Noodle (issues/noodle-ltm-recall.md, SN-2) sendwhole: trueby default; both work against an LTM without this change, ranked. No file overlaps with those two items.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
Local trace
8c1a195ec(LTM 1.5.7).S/services/recall.tsis 116 lines; notes carry a top-levelupdatedAt(packages/long-term-memory/src/engine/packages/shared/src/features/agents/long-term-memory/schema/notes.ts:306).