[PR #1970] [MERGED] feat(long-term-memory): import Advanced Memory scene recaps (1.5.20) #2054

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

📋 Pull Request Information

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

Base: staging ← Head: feature(long-term-memory)/advanced-memory-ingest


📝 Commits (5)

  • 0bbca5c feat(long-term-memory): import Advanced Memory scene recaps (#1964)
  • 0d40b6b Merge upstream/staging into feature(long-term-memory)/advanced-memory-ingest; release long-term-memory 1.5.20
  • 4e04dd9 fix(long-term-memory): round the Advanced Memory backfill batch size (#1964)
  • 524a9a9 fix(long-term-memory): show the rounded Advanced Memory backfill batch size (#1964)
  • d8bce4a Merge branch 'staging' into feature(long-term-memory)/advanced-memory-ingest

📊 Changes

38 files changed (+1220 additions, -194 deletions)

View changed files

📝 .github/workflows/ltm-browser.yml (+2 -2)
➕ artifacts/long-term-memory-1.5.20.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 (+25 -25)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+76 -66)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+8 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/ko.json (+8 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx (+12 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/shared-controls.tsx (+4 -1)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/sources/SourcesWorkspace.tsx (+94 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/vault/MemoryVault.tsx (+2 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/extraction-config.ts (+1 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-processing.ts (+146 -9)

...and 18 more files

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1964

Why this change

  • Chats that use Advanced Memory already have scene recaps written by the Engine. Long-Term Memory imported the same chat a second time from its summaries and messages, which costs another model call and gives duplicate notes from the same events.
  • With this change, Long-Term Memory reads those scene recaps directly. It needs no model call, and each recap reaches only the characters who were in that scene.

What changed

  • Long-Term Memory 1.5.20 (patch).
  • New setting under Memory Settings → Extraction: "Use Advanced Memory recaps" (useAdvancedMemory), with English and Korean strings.
  • An optional host read: persistence.listChatSummaries(chat.id).advancedMemory. A local structural type reads it, and a failed or missing read returns no records.
  • Enabled kind: "scene" records become rows in the existing chats source, chat-am:am-<recordId>, with provenance { kind: "advanced_memory", sourceId: chatId, entryId: recordId }. Scope is the chat scope with characterIds narrowed to the scene's audience present in the chat.
  • Precedence: when a chat has recap records, its rolling and legacy summaries and its message pieces are hidden. The outdated check runs without the recaps, so the hidden notes are not reported as gone.
  • With "Import new chat sources automatically" and the new setting both on, records that carry a block import through #1963's auto-import job, with no model call.
  • Backfill: POST /import/advanced-memory/backfill-batch and a "Backfill Advanced Memory" group in Import → Chats (batch size 1–100). It skips records that are already current, and records whose message range is covered by chat_summary or chat_transcript message_range evidence.
  • Echo filter: in-chat recall leaves out recap source notes and notes that were extracted only from them.
  • summaryMemoryInstruction() on the runtime service. Only Capability API 1.391 hosts call it.
  • New regression tests/long-term-memory-advanced-memory-import.regression.ts (listed in ltm-browser.yml and tests/README.md). It feeds a fake listChatSummaries that returns advancedMemory records.
  • Merged upstream/staging (otome-forge 0.6.3) and rebuilt long-term-memory outputs: client.js, server.mjs, manifest.json, artifacts/long-term-memory-1.5.20.zip and the catalog and notes entries.

Deviations from the issue text:

  • Recap rows live in the existing "chats" source, not a separate "Advanced Memory" source.
  • Creating a relationship is medium risk, so it still waits in the review draft with auto-accept on. That is the existing policy.
  • The echo filter is proved at helper level (advancedMemoryEchoNoteIds), not through a full generation.

Open question for the issue owner: a recap note keeps the chat's persona in its scope, so a scene can be recalled in another chat with the same persona. That follows the issue's { ...chatScope, characterIds: audience ∩ chat }. Should a scene drop the persona (and group) and be audience-only?

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none for installs. engine.min stays 2.5.1 and engine-boundary.json capabilityApi stays 1.390. The feature does nothing until a Marinara version with Capability API 1.391 (Engine #8589) provides advancedMemory; on older versions nothing changes.
  • New or changed permissions/entrypoints: no permission changes. One new package route, POST /import/advanced-memory/backfill-batch.
  • Restart, storage, update, or uninstall impact: a new stored provenance kind, advanced_memory, and a new boolean setting with default off. No migration and no change to existing rows.

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

  • Local agent checks on the pushed head (env MARINARA_AGENTS_ROOT=<worktree>, MARINARA_ENGINE_ROOT=/home/damo/dev/Marinara-Engine): exit 0 for the rebuild with no diff, test-fast.sh (lint, format), scripts/typecheck-packages.mjs long-term-memory, test-catalog-lanes.mjs, validate-package-locales.mjs, validate-catalog.mjs, catalog-release-notes.regression.mjs, git diff --check, and the test-ltm.sh suites advanced-memory-import, routes-imports, runtime, branch-recall, source-task, feedback-clarity-ui, host-styles, conversation-summary-import, chat-transcript-import, storage and routes. The Run step also ran each other CI-listed LTM suite, including browser, on the feature commit.
  • The installation LTM suite fails on the shared local Engine host. Its dice.service.ts imports isDicePoolNotation, which that host's @marinara-engine/shared does not export. This is the host's state, not this diff. Hosted CI uses its own Engine checkout.
  • No install through a running Marinara Engine yet. The feature needs Engine #8589 (Capability API 1.391) before there is anything to see.

Documentation impact

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

UI evidence (if applicable)

  • No screenshots yet. The new setting and the Backfill group also show on older hosts, but there they find nothing to import ("nothing left").

🤖 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/1970 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `feature(long-term-memory)/advanced-memory-ingest` --- ### 📝 Commits (5) - [`0bbca5c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0bbca5c5266afc605671a39731ec9be12250e9a1) feat(long-term-memory): import Advanced Memory scene recaps (#1964) - [`0d40b6b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0d40b6b8e329f27c45a21728d9556718ebb0e92c) Merge upstream/staging into feature(long-term-memory)/advanced-memory-ingest; release long-term-memory 1.5.20 - [`4e04dd9`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4e04dd9a0f83e12f2e2d981580da5052a48750ca) fix(long-term-memory): round the Advanced Memory backfill batch size (#1964) - [`524a9a9`](https://github.com/Pasta-Devs/Marinara-Agents/commit/524a9a975f3f44f8102e2937f2b35ef3ae821cb9) fix(long-term-memory): show the rounded Advanced Memory backfill batch size (#1964) - [`d8bce4a`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d8bce4abe825f77fa296e972cb13e4e6d27fb019) Merge branch 'staging' into feature(long-term-memory)/advanced-memory-ingest ### 📊 Changes **38 files changed** (+1220 additions, -194 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ltm-browser.yml` (+2 -2) ➕ `artifacts/long-term-memory-1.5.20.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` (+25 -25) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+76 -66) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+8 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/ko.json` (+8 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx` (+12 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/shared-controls.tsx` (+4 -1) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/sources/SourcesWorkspace.tsx` (+94 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/vault/MemoryVault.tsx` (+2 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/extraction-config.ts` (+1 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/source-processing.ts` (+146 -9) _...and 18 more files_ </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1964 ## Why this change - Chats that use Advanced Memory already have scene recaps written by the Engine. Long-Term Memory imported the same chat a second time from its summaries and messages, which costs another model call and gives duplicate notes from the same events. - With this change, Long-Term Memory reads those scene recaps directly. It needs no model call, and each recap reaches only the characters who were in that scene. ## What changed - **Long-Term Memory 1.5.20 (patch).** - New setting under Memory Settings → Extraction: "Use Advanced Memory recaps" (`useAdvancedMemory`), with English and Korean strings. - An optional host read: `persistence.listChatSummaries(chat.id).advancedMemory`. A local structural type reads it, and a failed or missing read returns no records. - Enabled `kind: "scene"` records become rows in the existing chats source, `chat-am:am-<recordId>`, with provenance `{ kind: "advanced_memory", sourceId: chatId, entryId: recordId }`. Scope is the chat scope with `characterIds` narrowed to the scene's audience present in the chat. - Precedence: when a chat has recap records, its rolling and legacy summaries and its message pieces are hidden. The outdated check runs without the recaps, so the hidden notes are not reported as gone. - With "Import new chat sources automatically" and the new setting both on, records that carry a block import through #1963's auto-import job, with no model call. - Backfill: `POST /import/advanced-memory/backfill-batch` and a "Backfill Advanced Memory" group in Import → Chats (batch size 1–100). It skips records that are already current, and records whose message range is covered by `chat_summary` or `chat_transcript` `message_range` evidence. - Echo filter: in-chat recall leaves out recap source notes and notes that were extracted only from them. - `summaryMemoryInstruction()` on the runtime service. Only Capability API 1.391 hosts call it. - New regression `tests/long-term-memory-advanced-memory-import.regression.ts` (listed in `ltm-browser.yml` and `tests/README.md`). It feeds a fake `listChatSummaries` that returns `advancedMemory` records. - Merged `upstream/staging` (otome-forge 0.6.3) and rebuilt `long-term-memory` outputs: `client.js`, `server.mjs`, `manifest.json`, `artifacts/long-term-memory-1.5.20.zip` and the catalog and notes entries. Deviations from the issue text: - Recap rows live in the existing "chats" source, not a separate "Advanced Memory" source. - Creating a relationship is medium risk, so it still waits in the review draft with auto-accept on. That is the existing policy. - The echo filter is proved at helper level (`advancedMemoryEchoNoteIds`), not through a full generation. Open question for the issue owner: a recap note keeps the chat's persona in its scope, so a scene can be recalled in another chat with the same persona. That follows the issue's `{ ...chatScope, characterIds: audience ∩ chat }`. Should a scene drop the persona (and group) and be audience-only? ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none for installs. `engine.min` stays 2.5.1 and `engine-boundary.json` `capabilityApi` stays 1.390. The feature does nothing until a Marinara version with Capability API 1.391 (Engine #8589) provides `advancedMemory`; on older versions nothing changes. - New or changed permissions/entrypoints: no permission changes. One new package route, `POST /import/advanced-memory/backfill-batch`. - Restart, storage, update, or uninstall impact: a new stored provenance kind, `advanced_memory`, and a new boolean setting with default off. No migration and no change to existing rows. ## 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 - Local agent checks on the pushed head (env `MARINARA_AGENTS_ROOT=<worktree>`, `MARINARA_ENGINE_ROOT=/home/damo/dev/Marinara-Engine`): exit 0 for the rebuild with no diff, `test-fast.sh` (lint, format), `scripts/typecheck-packages.mjs long-term-memory`, `test-catalog-lanes.mjs`, `validate-package-locales.mjs`, `validate-catalog.mjs`, `catalog-release-notes.regression.mjs`, `git diff --check`, and the `test-ltm.sh` suites advanced-memory-import, routes-imports, runtime, branch-recall, source-task, feedback-clarity-ui, host-styles, conversation-summary-import, chat-transcript-import, storage and routes. The Run step also ran each other CI-listed LTM suite, including browser, on the feature commit. - The `installation` LTM suite fails on the shared local Engine host. Its `dice.service.ts` imports `isDicePoolNotation`, which that host's `@marinara-engine/shared` does not export. This is the host's state, not this diff. Hosted CI uses its own Engine checkout. - No install through a running Marinara Engine yet. The feature needs Engine #8589 (Capability API 1.391) before there is anything to see. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - No screenshots yet. The new setting and the Backfill group also show on older hosts, but there they find nothing to import ("nothing left"). 🤖 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-11-07 16:39:05 +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#2054
No description provided.