[GH-ISSUE #1841] [Feature]: Slurp: use Long-Term Memory's recall for Creator posts and DM replies, with a choice of whole memories or relevant parts #1780

Closed
opened 2026-11-07 16:36:38 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1841

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Slurp Creators can draw on what Long-Term Memory knows about them ("What your other Agents know"), but the way in is old: slp-agent-memory-source.ts lists a character's memories through long-term-memory:storage and pastes at most two sentences into the flavour brief. That read skips Long-Term Memory's subject, mode and persona rules, ignores what the post or DM is about, never reaches DMs, and keeps alive a service Long-Term Memory wants to remove (tracker SN-6). Long-Term Memory has had a service built for this since 1.4.84, long-term-memory:recall.

Tracker: SN-3.

Proposed package or change

Slurp reads memories through long-term-memory:recall for each post plan and each DM reply, and shows them in the existing "What you already know" block as "From your memory". The user picks whole memories (default) or the parts that fit what is being written. slurp2 only, minor bump with a CHANGELOG entry. Nothing changes in the Engine or Long-Term Memory (whole mode is issues/ltm-recall-whole-memories.md; without it LTM answers ranked).

Decisions (joint note, 2026-10-29): keep one switch, "What your other Agents know" (no split, no first-time confirmation; it stays on by default as today); whole or ranked is a user choice, default whole; a DM with the player's persona includes persona memories only when the persona's Slurp page is set to Linked identity (open); thread notes and fan-side records stay in Slurp.

Minimal fix

P = packages/slurp2/src/engine/packages/server/src/slp, C = packages/slurp2/src/engine/packages/client/src/slp.

+P/data/creators/slp-ltm-recall.ts
+  recallSlurpMemories({ db, source, queryText, personaId?, signal? })
+    gate: Creator disclosure open && settings.flavourFromAgents      (same gate as the flavour brief today)
+    service = getCapabilityService("long-term-memory:recall")       (import as slp-agent-memory-source.ts does)
+    no service -> status "missing", []; null -> status "off", []; throw -> status "error", []
+    recall({ caller: "slurp2", queryText, characterIds: [character source id], personaId, mode: "roleplay",
+             maxTokens: 800, whole: settings.memoryRecall !== "relevant", signal })
+    -> lines "title: text" (at most 6), status "ok"
 P/features/feed/slp-post-plan-service.ts  planSlurpPost
   continuityInstruction = slurpContinuityInstruction({ facts, events, memories })   # memories from recallSlurpMemories
                                                                                    # queryText = beat.line, beat.place, beat.anchor
 P/features/messages/slp-message-generation-service.ts
   continuity block for the DM also gets memories; queryText = the fan's latest message
   personaId only when viewer.kind === "persona" && !fanVoice && viewerPageAccount
                   && (viewerPageAccount.settings.privacy.identityDisclosure ?? "open") === "open"
 P/modules/continuity/slp-continuity-prompt.ts
   slurpContinuityInstruction({ facts, events?, memories?, threadId? })
+    "From your memory:" group after "Recently:"; renders when only memories exist
-P/data/creators/slp-agent-memory-source.ts  memoryLines (the storage read)    # tracker lines stay
  • Recall helper. New P/data/creators/slp-ltm-recall.ts, called once in planSlurpPost (after the beat is known, before the continuity block at ~362) and once per DM reply (beside the fan_thread continuity at ~572). characterIds is the Creator's character source id; a persona-sourced Creator passes its persona as personaId. Synthetic fans get Creator memories only. Lines are title: text with whitespace collapsed; nothing is stored. The preview (P/features/feed/slp-prompt-preview-service.ts:116) builds the same block, so it shows the memories too.
  • Continuity block. slurpContinuityInstruction gets an optional memories: string[] rendered as a "From your memory:" group (at most 6), with the existing reference-data line. Today it returns "" without facts or events; with memories it renders.
  • Status. The helper keeps the last outcome per server run ("ok" | "missing" | "off" | "error", or none yet). New GET /settings/memory-status beside GET /settings (P/features/settings/slp-settings-routes.ts:59) returns it.
  • Setting. memoryRecall: "whole" | "relevant" in P/modules/settings/slp-settings.ts (schema beside flavourFromAgents at :308, default "whole" beside :572) and in C/features/settings/slp-settings-contract.ts and slp-settings-defaults.ts (engine group, after flavourFromAgents). An older saved settings file without it reads as "whole".
  • UI. In SlpEngineLinkPanel.tsx (~89-93), under the "What your other Agents know" switch and only while it is on: a two-option choice and one status line, using the panel's existing controls.
    • Choice: "Whole memories" / "Only the parts that fit the post". Help: "Whole memories give Creators more to go on but take more room in the prompt."
    • Status (only when something is wrong): "Long-Term Memory isn't installed." / "Long-Term Memory isn't sharing memories. Turn on "Other Agents can read memories" in its Memory Settings." / "Long-Term Memory couldn't be read. Creators post without memories for now."
    • Switch detail, made accurate: "Creators can draw on what Long-Term Memory, Character Tracker, World State and Persona Stats know about them: memories, outfits, mood, weather. Memories you limited to one chat are never used. Slurp only reads them and never changes those Agents."
    • New keys in C/locales/en.json; de, ko, pl per the package's locale rule (run node scripts/validate-package-locales.mjs).
  • Removed. memoryLines and the long-term-memory:storage read in slp-agent-memory-source.ts, and its call in slp-flavour-source.ts:135-138 keeps only the tracker lines. Memories now come through the continuity block, so the flavour brief no longer repeats them.
  • CHANGELOG (packages/slurp2/CHANGELOG.md, new minor version): Creators' posts and DM replies use what Long-Term Memory remembers about them, whole memories by default, or only the parts that fit; the status line says when Long-Term Memory is missing or not sharing; persona memories reach a DM only when that persona's Slurp page uses Linked identity.
  • Deferred. slurp2_continuity_links rows (fromType: "ltm_note") for freshness, results in the reference pool, and the echo filter (SN-5). Thread notes and fan-side records are not touched.

Regression proof

tests/slurp-continuity-prompt.regression.ts:

  • memories alone render the block with "From your memory:" and at most 6 lines; no facts, events or memories still gives "".

New tests/slurp2-ltm-recall.regression.ts, with a fake recall service registered through the capability registry:

  • the post plan calls recall once with caller: "slurp2", the Creator's character id, mode: "roleplay", whole: true by default and whole: false with memoryRecall: "relevant", and its sections reach continuityInstruction;
  • disclosure hinted or flavourFromAgents: false makes no call;
  • no service gives status "missing", a null result "off", a throw "error", and each leaves the plan without memories;
  • a DM from the player's persona with an open page passes personaId; with a hinted page, a fan voice or a synthetic fan it doesn't.

Update tests/slurp2-life-moments.regression.ts:321-363 (it asserts the storage read), tests/host-runtime-overlay.regression.mjs:237-255, 281-283 and tests/slurp2-steering-flavour.regression.ts to the new path. Mutations that must fail: dropping the disclosure gate, passing personaId for a hinted page, and ignoring memoryRecall.

Why should this be optional?

It sits behind the existing "What your other Agents know" switch and Creator disclosure, and does nothing without Long-Term Memory. Long-Term Memory's "Other Agents can read memories" switch stops it from the other side, and its Sharing table shows Slurp's reads.

Alternatives considered

  • Split a separate "Use memories from Long-Term Memory" switch with a first-time confirmation: declined by the maintainer, one switch stays.
  • Ranked recall only: the maintainer wants whole memories first, to check that memories reach posts at all.
  • Keep listNotes: no subject, mode or persona rules, no DMs, and it blocks SN-6.

Additional context

Follows #1567 (recall service) and #1805 (Sharing table). Pairs with issues/ltm-recall-whole-memories.md (whole mode) and issues/noodle-ltm-recall.md (SN-2); no file overlap with either. Once a Slurp release with this is out, Long-Term Memory removes long-term-memory:storage (SN-6).

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.

Local trace

  • Mapped on upstream/staging 8c1a195ec (Slurp 0.4.8). Anchors re-checked at that tip: planSlurpPost beat at 162, continuity at 362, purpose at 384; DM disclosureMode 478, viewerPageAccount 485, fan_thread continuity 572; flavour gate slp-flavour-source.ts:136.
  • Disclosure values open | hinted | secret (shared/src/slp/slp-social.types.ts:24); the UI labels open "Linked identity".
  • capability-service-registry.service.js is not in scripts/server-engine-modules-baseline.json for slurp2 and Slurp already imports it, so no baseline change.
  • Assumptions to confirm with the maintainer: no first-time confirmation (one switch, default on, as today); status from the last outcome in this server run, so it is empty until the first post or DM; the 6-line cap and 800-token budget; persona memories in posts only for a persona-sourced Creator.
Originally created by @Promansis on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1841 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Slurp Creators can draw on what Long-Term Memory knows about them ("What your other Agents know"), but the way in is old: `slp-agent-memory-source.ts` lists a character's memories through `long-term-memory:storage` and pastes at most two sentences into the flavour brief. That read skips Long-Term Memory's subject, mode and persona rules, ignores what the post or DM is about, never reaches DMs, and keeps alive a service Long-Term Memory wants to remove (tracker SN-6). Long-Term Memory has had a service built for this since 1.4.84, `long-term-memory:recall`. Tracker: SN-3. ## Proposed package or change Slurp reads memories through `long-term-memory:recall` for each post plan and each DM reply, and shows them in the existing "What you already know" block as "From your memory". The user picks whole memories (default) or the parts that fit what is being written. `slurp2` only, minor bump with a CHANGELOG entry. Nothing changes in the Engine or Long-Term Memory (whole mode is `issues/ltm-recall-whole-memories.md`; without it LTM answers ranked). Decisions (joint note, 2026-10-29): keep one switch, "What your other Agents know" (no split, no first-time confirmation; it stays on by default as today); whole or ranked is a user choice, default whole; a DM with the player's persona includes persona memories only when the persona's Slurp page is set to Linked identity (`open`); thread notes and fan-side records stay in Slurp. ### Minimal fix P = `packages/slurp2/src/engine/packages/server/src/slp`, C = `packages/slurp2/src/engine/packages/client/src/slp`. ```diff +P/data/creators/slp-ltm-recall.ts + recallSlurpMemories({ db, source, queryText, personaId?, signal? }) + gate: Creator disclosure open && settings.flavourFromAgents (same gate as the flavour brief today) + service = getCapabilityService("long-term-memory:recall") (import as slp-agent-memory-source.ts does) + no service -> status "missing", []; null -> status "off", []; throw -> status "error", [] + recall({ caller: "slurp2", queryText, characterIds: [character source id], personaId, mode: "roleplay", + maxTokens: 800, whole: settings.memoryRecall !== "relevant", signal }) + -> lines "title: text" (at most 6), status "ok" P/features/feed/slp-post-plan-service.ts planSlurpPost continuityInstruction = slurpContinuityInstruction({ facts, events, memories }) # memories from recallSlurpMemories # queryText = beat.line, beat.place, beat.anchor P/features/messages/slp-message-generation-service.ts continuity block for the DM also gets memories; queryText = the fan's latest message personaId only when viewer.kind === "persona" && !fanVoice && viewerPageAccount && (viewerPageAccount.settings.privacy.identityDisclosure ?? "open") === "open" P/modules/continuity/slp-continuity-prompt.ts slurpContinuityInstruction({ facts, events?, memories?, threadId? }) + "From your memory:" group after "Recently:"; renders when only memories exist -P/data/creators/slp-agent-memory-source.ts memoryLines (the storage read) # tracker lines stay ``` - **Recall helper.** New `P/data/creators/slp-ltm-recall.ts`, called once in `planSlurpPost` (after the beat is known, before the continuity block at ~362) and once per DM reply (beside the `fan_thread` continuity at ~572). `characterIds` is the Creator's character source id; a persona-sourced Creator passes its persona as `personaId`. Synthetic fans get Creator memories only. Lines are `title: text` with whitespace collapsed; nothing is stored. The preview (`P/features/feed/slp-prompt-preview-service.ts:116`) builds the same block, so it shows the memories too. - **Continuity block.** `slurpContinuityInstruction` gets an optional `memories: string[]` rendered as a "From your memory:" group (at most 6), with the existing reference-data line. Today it returns `""` without facts or events; with memories it renders. - **Status.** The helper keeps the last outcome per server run (`"ok" | "missing" | "off" | "error"`, or none yet). New `GET /settings/memory-status` beside `GET /settings` (`P/features/settings/slp-settings-routes.ts:59`) returns it. - **Setting.** `memoryRecall: "whole" | "relevant"` in `P/modules/settings/slp-settings.ts` (schema beside `flavourFromAgents` at :308, default `"whole"` beside :572) and in `C/features/settings/slp-settings-contract.ts` and `slp-settings-defaults.ts` (`engine` group, after `flavourFromAgents`). An older saved settings file without it reads as `"whole"`. - **UI.** In `SlpEngineLinkPanel.tsx` (~89-93), under the "What your other Agents know" switch and only while it is on: a two-option choice and one status line, using the panel's existing controls. - Choice: "Whole memories" / "Only the parts that fit the post". Help: "Whole memories give Creators more to go on but take more room in the prompt." - Status (only when something is wrong): "Long-Term Memory isn't installed." / "Long-Term Memory isn't sharing memories. Turn on \"Other Agents can read memories\" in its Memory Settings." / "Long-Term Memory couldn't be read. Creators post without memories for now." - Switch detail, made accurate: "Creators can draw on what Long-Term Memory, Character Tracker, World State and Persona Stats know about them: memories, outfits, mood, weather. Memories you limited to one chat are never used. Slurp only reads them and never changes those Agents." - New keys in `C/locales/en.json`; `de`, `ko`, `pl` per the package's locale rule (run `node scripts/validate-package-locales.mjs`). - **Removed.** `memoryLines` and the `long-term-memory:storage` read in `slp-agent-memory-source.ts`, and its call in `slp-flavour-source.ts:135-138` keeps only the tracker lines. Memories now come through the continuity block, so the flavour brief no longer repeats them. - **CHANGELOG** (`packages/slurp2/CHANGELOG.md`, new minor version): Creators' posts and DM replies use what Long-Term Memory remembers about them, whole memories by default, or only the parts that fit; the status line says when Long-Term Memory is missing or not sharing; persona memories reach a DM only when that persona's Slurp page uses Linked identity. - **Deferred.** `slurp2_continuity_links` rows (`fromType: "ltm_note"`) for freshness, results in the reference pool, and the echo filter (SN-5). Thread notes and fan-side records are not touched. ### Regression proof `tests/slurp-continuity-prompt.regression.ts`: - memories alone render the block with "From your memory:" and at most 6 lines; no facts, events or memories still gives `""`. New `tests/slurp2-ltm-recall.regression.ts`, with a fake recall service registered through the capability registry: - the post plan calls recall once with `caller: "slurp2"`, the Creator's character id, `mode: "roleplay"`, `whole: true` by default and `whole: false` with `memoryRecall: "relevant"`, and its sections reach `continuityInstruction`; - disclosure `hinted` or `flavourFromAgents: false` makes no call; - no service gives status `"missing"`, a `null` result `"off"`, a throw `"error"`, and each leaves the plan without memories; - a DM from the player's persona with an `open` page passes `personaId`; with a `hinted` page, a fan voice or a synthetic fan it doesn't. Update `tests/slurp2-life-moments.regression.ts:321-363` (it asserts the storage read), `tests/host-runtime-overlay.regression.mjs:237-255, 281-283` and `tests/slurp2-steering-flavour.regression.ts` to the new path. Mutations that must fail: dropping the disclosure gate, passing `personaId` for a `hinted` page, and ignoring `memoryRecall`. ## Why should this be optional? It sits behind the existing "What your other Agents know" switch and Creator disclosure, and does nothing without Long-Term Memory. Long-Term Memory's "Other Agents can read memories" switch stops it from the other side, and its Sharing table shows Slurp's reads. ## Alternatives considered - Split a separate "Use memories from Long-Term Memory" switch with a first-time confirmation: declined by the maintainer, one switch stays. - Ranked recall only: the maintainer wants whole memories first, to check that memories reach posts at all. - Keep `listNotes`: no subject, mode or persona rules, no DMs, and it blocks SN-6. ## Additional context Follows #1567 (recall service) and #1805 (Sharing table). Pairs with `issues/ltm-recall-whole-memories.md` (whole mode) and `issues/noodle-ltm-recall.md` (SN-2); no file overlap with either. Once a Slurp release with this is out, Long-Term Memory removes `long-term-memory:storage` (SN-6). ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details. ## Local trace - Mapped on upstream/staging 8c1a195ec (Slurp 0.4.8). Anchors re-checked at that tip: `planSlurpPost` beat at 162, continuity at 362, purpose at 384; DM `disclosureMode` 478, `viewerPageAccount` 485, `fan_thread` continuity 572; flavour gate `slp-flavour-source.ts:136`. - Disclosure values `open | hinted | secret` (`shared/src/slp/slp-social.types.ts:24`); the UI labels `open` "Linked identity". - `capability-service-registry.service.js` is not in `scripts/server-engine-modules-baseline.json` for slurp2 and Slurp already imports it, so no baseline change. - Assumptions to confirm with the maintainer: no first-time confirmation (one switch, default on, as today); status from the last outcome in this server run, so it is empty until the first post or DM; the 6-line cap and 800-token budget; persona memories in posts only for a persona-sourced Creator.
bsakaguchi 2026-11-07 16:36:38 +07:00
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-Agents#1780
No description provided.