[PR #1568] [MERGED] feat(long-term-memory): let other Agents recall memories about the characters they write as (1.4.84) #1569

Closed
opened 2026-10-23 04:03:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1568
Author: @Promansis
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @Promansis

Base: staging ← Head: feature(long-term-memory)/recall-service


📝 Commits (4)

  • b23c054 feat(long-term-memory): let other Agents recall memories about the characters they write as (#1567)
  • 7a92c21 chore(long-term-memory): release 1.4.84 (#1567)
  • d3dc67c Merge upstream/staging into feature(long-term-memory)/recall-service; release long-term-memory 1.4.84
  • 04d7f3f Merge upstream/staging into feature(long-term-memory)/recall-service; release long-term-memory 1.4.84

📊 Changes

25 files changed (+487 additions, -124 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.84.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 (+4 -0)
📝 packages/long-term-memory/client.js (+17 -17)
📝 packages/long-term-memory/docs/ARCHITECTURE.md (+48 -7)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+41 -40)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/api.ts (+1 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+6 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/ActivityView.tsx (+3 -1)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx (+28 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/recall/retrieval.ts (+3 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes/settings.ts (+2 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/server-entry.ts (+3 -0)
➕ packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/services/recall.ts (+116 -0)

...and 5 more files

📄 Description

Pull request

Linked issue

Closes #1567

Why this change

  • Other Agents, such as Slurp and later Noodle, want what Long-Term Memory knows about the characters they write as. Since #1565 the only way in is the storage read, which lists a character's memories unranked; there is no ranked recall, and no way for the user to turn these reads off or see who reads.
  • This adds a versioned recall service for other packages, one switch in Memory Settings that stops every read by another Agent, and a line naming the Agents that read memories lately. It is the groundwork for moving Slurp and Noodle onto Long-Term Memory, planned later with their developer; nothing changes in the Engine, Slurp or Noodle here.

What changed

  • long-term-memory: a new Engine service, long-term-memory:recall (version 1), and a setting, "Other Agents can read memories" (longTermMemoryShareWithPackages, on by default), that gates it and the #1565 storage read.
 activate
   registerService("long-term-memory:storage", createLtmStorageReadService(storage))
+  registerService("long-term-memory:recall", createLtmRecallService(storage))
+    recall({ caller?, queryText, characterIds?, personaId?, mode?, maxTokens?, signal? })
+      null unless "Other Agents can read memories" is on
+      notes = listNotes(characterIds, persona)      # never a chat or group id, so chat-limited memories never match
+        minus archived, game-only, tone and source memories
+        minus character and relationship memories that don't name an account as a subject
+      retrieveLongTermMemory(queryText, noteIds = notes, resolved included, the user's weights, maxTokens)
+      one section per memory: thread, timeline_event, relationship, character, world, scene
+      debug log: package_recall (caller, count)
+      -> { version: 1, sections: [{ noteId, type, title?, text }] }
 storage.listNotes(filter)
+  [] unless the switch is on; debug log: package_list (caller, count)
+GET /api/long-term-memory/settings/package-readers -> { readers: [{ caller, lastReadAt }] }   # from the debug log
  • New services/recall.ts: input checked with zod (caller up to 64 letters, digits and . _ : -, dropped when malformed; queryText 1-8,000 characters; up to 20 character ids; personaId; mode; maxTokens 50-4,000, default 800; an AbortSignal). null for invalid input, an aborted call or reads turned off; { version: 1, sections: [] } when nothing matches. Recall receipts and usage are untouched.
  • recall/retrieval.ts gains one option, noteIds, which limits the candidates to the listed memories, so the service reuses chat recall's ranking.
  • services/storage-read.ts: the storage read returns [] when the switch is off and logs each read; helpers record and list the readers.
  • caller is the name a package gives itself; the Engine doesn't say who looks a service up. The reader line lists the ten names that read most lately, from what the debug log holds (1.5 to 2 MB since #1556); Clear log empties it.
  • Memory Settings, Recall tab: a Toggle and the reader line under it. Activity labels both actions "Read by another Agent". English strings only.
  • docs/ARCHITECTURE.md gains "Services for Other Packages": the call, the result, the rules and the versioning rule (a new section field can be added without a version change; removing or renaming one raises version).
  • Regression extended in tests/long-term-memory-runtime.regression.ts; the routes regression lists the new route. CHANGELOG entry; rebuilt packages/long-term-memory bundles, manifest, artifact and catalog entries as 1.4.84.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none. Engine 2.5.1's api.runtime.services.get finds the new key; older Engines simply don't offer the lookup to packages.
  • New or changed permissions/entrypoints: no manifest change. One new service key, long-term-memory:recall, read-only; one new read-only route, GET /settings/package-readers.
  • Restart, storage, update, or uninstall impact: one new setting, on by default, so today's behaviour holds after an update, a settings reset or importing an older backup. No stored memory or index changes. With the switch off, Slurp 0.3.53's "What your other Agents know" gets [] and falls back as for an empty vault. Rolling back to 1.4.83 drops the service; 1.4.83 reads settings leniently, so it ignores the new field and keeps it in the file for the next upgrade.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • The runtime regression builds its own vault with twelve memories for char-a and checks:
services.get("long-term-memory:recall").version            -> 1, released on deactivate
recall({ characterIds: ["char-a"], queryText })             -> [thread, resolved timeline event, relationship a-b,
                                                                char-a's character memory, world]
  left out: tone, chat-only, archived, game-only, a character memory about char-z, one with no subjects
recall({ ..., personaId })                                  -> adds the persona-only memory
unknown character / mode "conversation" vs roleplay-only    -> { version: 1, sections: [] }
no query / no account / aborted signal                      -> null
malformed caller name                                       -> still reads
readers                                                     -> ["noodle", "null", "slurp"]
switch off                                                  -> recall null, storage read []
  • The test imports the new module, so it can't run on staging; instead each one-line mutation fails its assertion: removing the subject rule, letting subject-less character or relationship memories through, adding tone to the recalled types, a storage read that ignores the switch.
  • On the implementation commit b23c05489: package typecheck, format and lint, the feature build, the typecheck regression, the host runtime overlay regression and every CI-listed Long-Term Memory suite run one by one (31, plus the regression helpers) passed, including runtime, routes, storage, debug-activity, browser and installation.
  • On the release commit 7a92c215a (1.4.84), and again on d3dc67c3d and 04d7f3f42 after merging staging (CI, Dottore and tooling changes only; the rebuilt bundles and archive are byte-identical): the rebuild is clean, and the fast checks, the package typecheck, the runtime, routes, storage, debug-activity, feedback-clarity-ui, browser and installation suites, and the catalog-lane, locale, catalog and release-notes checks pass. Hosted CI runs the full regression set.
  • Not installed through a running Engine; the installation suite installs the rebuilt archive.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

packages/long-term-memory/docs/ARCHITECTURE.md gains "Services for Other Packages", the contract for other packages.

UI evidence (if applicable)

No screenshot. At the end of Memory Settings' Recall tab:

 <MemorySettings> Recall tab
   …
   <Toggle "Filter generated stop words">
+  <Toggle "Other Agents can read memories">
+  <p>Read lately by slurp, an Agent that gave no name.</p>     # or "No other Agent has read memories lately."

Help text: "Lets other Agents, such as Slurp, use memories about the character they write as. They get only memories available to that character everywhere: never memories limited to a chat or group, archived memories or suggestions, and they can't change anything."

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1568 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `feature(long-term-memory)/recall-service` --- ### 📝 Commits (4) - [`b23c054`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b23c0548938a6b4e55b055baded5bf1d89b89f85) feat(long-term-memory): let other Agents recall memories about the characters they write as (#1567) - [`7a92c21`](https://github.com/Pasta-Devs/Marinara-Agents/commit/7a92c215a831413582d7100fc1061936d7f1d7c8) chore(long-term-memory): release 1.4.84 (#1567) - [`d3dc67c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d3dc67c3d56dcbb69322b36c39b9bda054ee5412) Merge upstream/staging into feature(long-term-memory)/recall-service; release long-term-memory 1.4.84 - [`04d7f3f`](https://github.com/Pasta-Devs/Marinara-Agents/commit/04d7f3f42122ad451302ad54c22de9055f813e47) Merge upstream/staging into feature(long-term-memory)/recall-service; release long-term-memory 1.4.84 ### 📊 Changes **25 files changed** (+487 additions, -124 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.84.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` (+4 -0) 📝 `packages/long-term-memory/client.js` (+17 -17) 📝 `packages/long-term-memory/docs/ARCHITECTURE.md` (+48 -7) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+41 -40) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/api.ts` (+1 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+6 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/ActivityView.tsx` (+3 -1) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx` (+28 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/recall/retrieval.ts` (+3 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/routes/settings.ts` (+2 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/server-entry.ts` (+3 -0) ➕ `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/services/recall.ts` (+116 -0) _...and 5 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #1567 ## Why this change - Other Agents, such as Slurp and later Noodle, want what Long-Term Memory knows about the characters they write as. Since #1565 the only way in is the storage read, which lists a character's memories unranked; there is no ranked recall, and no way for the user to turn these reads off or see who reads. - This adds a versioned recall service for other packages, one switch in Memory Settings that stops every read by another Agent, and a line naming the Agents that read memories lately. It is the groundwork for moving Slurp and Noodle onto Long-Term Memory, planned later with their developer; nothing changes in the Engine, Slurp or Noodle here. ## What changed - `long-term-memory`: a new Engine service, `long-term-memory:recall` (version 1), and a setting, "Other Agents can read memories" (`longTermMemoryShareWithPackages`, on by default), that gates it and the #1565 storage read. ```diff activate registerService("long-term-memory:storage", createLtmStorageReadService(storage)) + registerService("long-term-memory:recall", createLtmRecallService(storage)) + recall({ caller?, queryText, characterIds?, personaId?, mode?, maxTokens?, signal? }) + null unless "Other Agents can read memories" is on + notes = listNotes(characterIds, persona) # never a chat or group id, so chat-limited memories never match + minus archived, game-only, tone and source memories + minus character and relationship memories that don't name an account as a subject + retrieveLongTermMemory(queryText, noteIds = notes, resolved included, the user's weights, maxTokens) + one section per memory: thread, timeline_event, relationship, character, world, scene + debug log: package_recall (caller, count) + -> { version: 1, sections: [{ noteId, type, title?, text }] } storage.listNotes(filter) + [] unless the switch is on; debug log: package_list (caller, count) +GET /api/long-term-memory/settings/package-readers -> { readers: [{ caller, lastReadAt }] } # from the debug log ``` - New `services/recall.ts`: input checked with zod (`caller` up to 64 letters, digits and `. _ : -`, dropped when malformed; `queryText` 1-8,000 characters; up to 20 character ids; `personaId`; `mode`; `maxTokens` 50-4,000, default 800; an `AbortSignal`). `null` for invalid input, an aborted call or reads turned off; `{ version: 1, sections: [] }` when nothing matches. Recall receipts and usage are untouched. - `recall/retrieval.ts` gains one option, `noteIds`, which limits the candidates to the listed memories, so the service reuses chat recall's ranking. - `services/storage-read.ts`: the storage read returns `[]` when the switch is off and logs each read; helpers record and list the readers. - `caller` is the name a package gives itself; the Engine doesn't say who looks a service up. The reader line lists the ten names that read most lately, from what the debug log holds (1.5 to 2 MB since #1556); Clear log empties it. - Memory Settings, Recall tab: a `Toggle` and the reader line under it. Activity labels both actions "Read by another Agent". English strings only. - `docs/ARCHITECTURE.md` gains "Services for Other Packages": the call, the result, the rules and the versioning rule (a new section field can be added without a version change; removing or renaming one raises `version`). - Regression extended in `tests/long-term-memory-runtime.regression.ts`; the routes regression lists the new route. CHANGELOG entry; rebuilt `packages/long-term-memory` bundles, manifest, artifact and catalog entries as 1.4.84. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none. Engine 2.5.1's `api.runtime.services.get` finds the new key; older Engines simply don't offer the lookup to packages. - New or changed permissions/entrypoints: no manifest change. One new service key, `long-term-memory:recall`, read-only; one new read-only route, `GET /settings/package-readers`. - Restart, storage, update, or uninstall impact: one new setting, on by default, so today's behaviour holds after an update, a settings reset or importing an older backup. No stored memory or index changes. With the switch off, Slurp 0.3.53's "What your other Agents know" gets `[]` and falls back as for an empty vault. Rolling back to 1.4.83 drops the service; 1.4.83 reads settings leniently, so it ignores the new field and keeps it in the file for the next upgrade. ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - The runtime regression builds its own vault with twelve memories for `char-a` and checks: ```text services.get("long-term-memory:recall").version -> 1, released on deactivate recall({ characterIds: ["char-a"], queryText }) -> [thread, resolved timeline event, relationship a-b, char-a's character memory, world] left out: tone, chat-only, archived, game-only, a character memory about char-z, one with no subjects recall({ ..., personaId }) -> adds the persona-only memory unknown character / mode "conversation" vs roleplay-only -> { version: 1, sections: [] } no query / no account / aborted signal -> null malformed caller name -> still reads readers -> ["noodle", "null", "slurp"] switch off -> recall null, storage read [] ``` - The test imports the new module, so it can't run on staging; instead each one-line mutation fails its assertion: removing the subject rule, letting subject-less character or relationship memories through, adding `tone` to the recalled types, a storage read that ignores the switch. - On the implementation commit b23c05489: package typecheck, format and lint, the feature build, the typecheck regression, the host runtime overlay regression and every CI-listed Long-Term Memory suite run one by one (31, plus the regression helpers) passed, including runtime, routes, storage, debug-activity, browser and installation. - On the release commit 7a92c215a (1.4.84), and again on d3dc67c3d and 04d7f3f42 after merging staging (CI, Dottore and tooling changes only; the rebuilt bundles and archive are byte-identical): the rebuild is clean, and the fast checks, the package typecheck, the runtime, routes, storage, debug-activity, feedback-clarity-ui, browser and installation suites, and the catalog-lane, locale, catalog and release-notes checks pass. Hosted CI runs the full regression set. - Not installed through a running Engine; the installation suite installs the rebuilt archive. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation `packages/long-term-memory/docs/ARCHITECTURE.md` gains "Services for Other Packages", the contract for other packages. ## UI evidence (if applicable) No screenshot. At the end of Memory Settings' Recall tab: ```diff <MemorySettings> Recall tab … <Toggle "Filter generated stop words"> + <Toggle "Other Agents can read memories"> + <p>Read lately by slurp, an Agent that gave no name.</p> # or "No other Agent has read memories lately." ``` Help text: "Lets other Agents, such as Slurp, use memories about the character they write as. They get only memories available to that character everywhere: never memories limited to a chat or group, archived memories or suggestions, and they can't change anything." 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:03:14 +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#1569
No description provided.