[GH-ISSUE #2016] [Feature]: Long-Term Memory: show how many memories each Agent added this week in Memory Settings → Sharing #1875

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

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

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Memory Settings → Recall → Sharing has two switches, "Other Agents can read memories" and "Other Agents can add memories", and one table under the first: Agent, Last read, Reads this week, Memories returned this week (#1805). Since #1992 (1.5.23), Slurp can add memories through the long-term-memory:intake service. Nothing in Long-Term Memory shows that it does. A user who turns "Other Agents can add memories" on can't tell whether Slurp is adding anything, or how much, without searching the Memory Vault for "From Slurp" sections. An Agent that only adds (read switch off) doesn't appear in the table at all.

#1805 left this out on purpose ("A 'Feeds memories' column ... comes with learning from Noodle and Slurp posts, and the row key (the caller id) is ready for it"), and the SN-4 plan for #1989 deferred an "Added this week" column. Intake now exists, so the column has data.

Proposed package or change

Package-only Long-Term Memory patch release. No Engine change, no new route, no stored-format change: intake writes one Debug activity line per applied record, the same way reads already do, and the existing table gains one column.

Agent    Last read    Reads this week   Memories returned this week   Memories added this week
slurp2   2 min. ago   14                61                            3
  • The table moves below both switches, since it now reports both.
  • A row is listed when the Agent read or added; an Agent that only added shows "No reads" under Last read.
  • Rows stay ordered newest first, by the Agent's latest read or add, up to ten.
  • The empty state becomes "No other Agent has read or added memories lately."

Minimal fix

S = packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory, C = packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory. Checked on upstream/staging 5f2ad6896 (LTM 1.5.26).

  • S/services/storage-read.ts:
    • add recordLtmPackageAdd(root, caller, memories) beside recordLtmPackageRead (~25): recordLtmDebugEvent({ root, phase: "apply", action: "package_add", status: "ok", source: caller, counts: { memories } }).
    • listLtmPackageReaders (~47): in its single pass, also take package_add events (read the log once without the retrieval filter and filter the two phases in the loop). Per caller add added (sum of counts.memories of adds in the last 7 days). lastReadAt becomes string | null (null when the caller only added). Sort by the newest read or add, newest first, then slice(0, 10) as now. The return shape is { caller, lastReadAt, reads, memories, added }.
  • S/services/intake.ts:
    • submitUnlocked (~146) also returns how many character memories it wrote (mutations.length) with "applied".
    • submit (~286): after withLtmVaultLock resolves with an applied result, call recordLtmPackageAdd(root, caller, count). Call it outside the lock, because recordLtmDebugEvent takes the vault lock itself. unchanged, null and retract record nothing. The returned value stays { version: 1, status }.
  • C/settings/MemorySettings.tsx:
    • the packageReaders request type (~240) gains lastReadAt: string | null; added: number.
    • the Sharing group (~955-1020): move the table and its empty-state paragraph below the "Other Agents can add memories" Toggle. Add a fifth header and a right-aligned tabular-nums cell with reader.added. Last read shows otherAgentsNoReads when lastReadAt is null. Label the table with a new otherAgentsTable key instead of the read switch's label. Use only classes the table already uses.
  • C/locales/en.json and ko.json: add memorysettings.otherAgentsMemoriesAddedThisWeek ("Memories added this week"), memorysettings.otherAgentsNoReads ("No reads") and memorysettings.otherAgentsTable ("What other Agents read and added"). Replace memorysettings.noOtherAgentHasReadMemoriesLately with memorysettings.noOtherAgentHasUsedMemoriesLately ("No other Agent has read or added memories lately."). node scripts/validate-package-locales.mjs must pass.
  • packages/long-term-memory/docs/UI.md (~260): the Sharing sentence also names memories added this week, and says the table sits under both switches.
  • packages/long-term-memory/CHANGELOG.md: one line under ## Unreleased. Patch release; no version bump in the implementation commit.

Regression:

  1. tests/long-term-memory-runtime.regression.ts, the listLtmPackageReaders block (~476-530):
    • recordLtmPackageAdd(recallRoot, "tally", 2) gives the tally row added: 2, and the existing deep-equal assertions gain added.
    • an 8-day-old package_add line counts toward ordering but not toward added.
    • a caller that only added ("adder") is listed with lastReadAt: null, reads: 0, memories: 0, added: 1.
    • ordering uses the newest read or add.
  2. tests/long-term-memory-intake.regression.ts (~87-137):
    • after the first applied submit, the slurp2 row from listLtmPackageReaders(root) has added: 1.
    • the unchanged resubmit leaves it at 1.
    • the two-character pair record adds 2.
  3. tests/long-term-memory-routes.regression.ts (~40) already smoke-tests GET /settings/package-readers; no change expected.

Suites: test-ltm.sh runtime, test-ltm.sh intake, test-ltm.sh routes, plus the package typecheck and test-fast.sh.

Non-goals

  • Per-agent Can read / Can add switches in the table. They wait until a second Agent can add memories and the Engine tells a service who calls it (registerService(..., { forCaller })). Until then a name is self-reported and a per-row switch blocks nothing.
  • Counting retracts, or Activity view entries for adds.
  • Any change to what intake accepts or writes.

Why should this be optional?

It is part of the optional Long-Term Memory package's settings and only reports what the package's own intake service already does.

Alternatives considered

  • Counting from_<caller> sections or source_pkg_<caller>_ notes in the vault. That shows the total, not this week, and needs a vault scan on every Settings open. The Debug activity log already backs the read columns.
  • A separate "Added by" table. One row per Agent keeps reads and adds together and needs no second empty state.

Additional context

Follows #1805 (the table) and #1989 / #1992 (intake, 1.5.23).

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.
Originally created by @Promansis on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/2016 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Memory Settings → Recall → Sharing has two switches, "Other Agents can read memories" and "Other Agents can add memories", and one table under the first: Agent, Last read, Reads this week, Memories returned this week (#1805). Since #1992 (1.5.23), Slurp can add memories through the `long-term-memory:intake` service. Nothing in Long-Term Memory shows that it does. A user who turns "Other Agents can add memories" on can't tell whether Slurp is adding anything, or how much, without searching the Memory Vault for "From Slurp" sections. An Agent that only adds (read switch off) doesn't appear in the table at all. #1805 left this out on purpose ("A 'Feeds memories' column ... comes with learning from Noodle and Slurp posts, and the row key (the caller id) is ready for it"), and the SN-4 plan for #1989 deferred an "Added this week" column. Intake now exists, so the column has data. ## Proposed package or change Package-only Long-Term Memory patch release. No Engine change, no new route, no stored-format change: intake writes one Debug activity line per applied record, the same way reads already do, and the existing table gains one column. ``` Agent Last read Reads this week Memories returned this week Memories added this week slurp2 2 min. ago 14 61 3 ``` - The table moves below both switches, since it now reports both. - A row is listed when the Agent read or added; an Agent that only added shows "No reads" under Last read. - Rows stay ordered newest first, by the Agent's latest read or add, up to ten. - The empty state becomes "No other Agent has read or added memories lately." ### Minimal fix S = `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory`, C = `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory`. Checked on `upstream/staging` 5f2ad6896 (LTM 1.5.26). - `S/services/storage-read.ts`: - add `recordLtmPackageAdd(root, caller, memories)` beside `recordLtmPackageRead` (~25): `recordLtmDebugEvent({ root, phase: "apply", action: "package_add", status: "ok", source: caller, counts: { memories } })`. - `listLtmPackageReaders` (~47): in its single pass, also take `package_add` events (read the log once without the `retrieval` filter and filter the two phases in the loop). Per caller add `added` (sum of `counts.memories` of adds in the last 7 days). `lastReadAt` becomes `string | null` (null when the caller only added). Sort by the newest read or add, newest first, then `slice(0, 10)` as now. The return shape is `{ caller, lastReadAt, reads, memories, added }`. - `S/services/intake.ts`: - `submitUnlocked` (~146) also returns how many character memories it wrote (`mutations.length`) with `"applied"`. - `submit` (~286): after `withLtmVaultLock` resolves with an applied result, call `recordLtmPackageAdd(root, caller, count)`. Call it outside the lock, because `recordLtmDebugEvent` takes the vault lock itself. `unchanged`, `null` and `retract` record nothing. The returned value stays `{ version: 1, status }`. - `C/settings/MemorySettings.tsx`: - the `packageReaders` request type (~240) gains `lastReadAt: string | null; added: number`. - the Sharing group (~955-1020): move the table and its empty-state paragraph below the "Other Agents can add memories" `Toggle`. Add a fifth header and a right-aligned `tabular-nums` cell with `reader.added`. Last read shows `otherAgentsNoReads` when `lastReadAt` is null. Label the table with a new `otherAgentsTable` key instead of the read switch's label. Use only classes the table already uses. - `C/locales/en.json` and `ko.json`: add `memorysettings.otherAgentsMemoriesAddedThisWeek` ("Memories added this week"), `memorysettings.otherAgentsNoReads` ("No reads") and `memorysettings.otherAgentsTable` ("What other Agents read and added"). Replace `memorysettings.noOtherAgentHasReadMemoriesLately` with `memorysettings.noOtherAgentHasUsedMemoriesLately` ("No other Agent has read or added memories lately."). `node scripts/validate-package-locales.mjs` must pass. - `packages/long-term-memory/docs/UI.md` (~260): the Sharing sentence also names memories added this week, and says the table sits under both switches. - `packages/long-term-memory/CHANGELOG.md`: one line under `## Unreleased`. Patch release; no version bump in the implementation commit. Regression: 1. `tests/long-term-memory-runtime.regression.ts`, the `listLtmPackageReaders` block (~476-530): - `recordLtmPackageAdd(recallRoot, "tally", 2)` gives the `tally` row `added: 2`, and the existing deep-equal assertions gain `added`. - an 8-day-old `package_add` line counts toward ordering but not toward `added`. - a caller that only added (`"adder"`) is listed with `lastReadAt: null`, `reads: 0`, `memories: 0`, `added: 1`. - ordering uses the newest read or add. 2. `tests/long-term-memory-intake.regression.ts` (~87-137): - after the first `applied` submit, the `slurp2` row from `listLtmPackageReaders(root)` has `added: 1`. - the `unchanged` resubmit leaves it at 1. - the two-character pair record adds 2. 3. `tests/long-term-memory-routes.regression.ts` (~40) already smoke-tests `GET /settings/package-readers`; no change expected. Suites: `test-ltm.sh runtime`, `test-ltm.sh intake`, `test-ltm.sh routes`, plus the package typecheck and `test-fast.sh`. ### Non-goals - Per-agent Can read / Can add switches in the table. They wait until a second Agent can add memories and the Engine tells a service who calls it (`registerService(..., { forCaller })`). Until then a name is self-reported and a per-row switch blocks nothing. - Counting retracts, or Activity view entries for adds. - Any change to what intake accepts or writes. ## Why should this be optional? It is part of the optional Long-Term Memory package's settings and only reports what the package's own intake service already does. ## Alternatives considered - Counting `from_<caller>` sections or `source_pkg_<caller>_` notes in the vault. That shows the total, not this week, and needs a vault scan on every Settings open. The Debug activity log already backs the read columns. - A separate "Added by" table. One row per Agent keeps reads and adds together and needs no second empty state. ## Additional context Follows #1805 (the table) and #1989 / #1992 (intake, 1.5.23). ## 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.
bsakaguchi 2026-11-07 16:37:18 +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#1875
No description provided.