[GH-ISSUE #721] [Issue]: speed up Long-Term Memory source views #368

Closed
opened 2026-10-20 17:26:56 +07:00 by bsakaguchi · 3 comments
Owner

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

Originally assigned to: @Promansis on GitHub.

Summary

Long-Term Memory source-oriented views can take a long time to load as note data is read repeatedly. The Review Queue projection currently performs two note-ID lookups for the same response, while Memory Vault and related source views also perform broad note loads.

Affected package

Long-Term Memory (long-term-memory)

Expected behavior

Review Queue, Memory Vault, and related source views should load without redundant note-storage searches. The Review Queue projection should fetch the union of source and mutation target note IDs once, preserving the current response and projection behavior.

Actual behavior

Review Queue projection calls getNotesByIds separately for mutation overlays and source notes. Because note lookup initializes and locks the package store and reads note files, this duplicates storage work and contributes to slow source-oriented UI loads.

Steps to reproduce

  1. Install and enable Long-Term Memory in a compatible Marinara Engine checkout.
  2. Open Long-Term Memory and navigate to Review Queue with drafts present.
  3. Observe the time required for the review data and source context to appear.
  4. Compare with Memory Vault or Sources, which also load note data and may show the same slow behavior as the vault grows.

Environment

  • Marinara Engine version: 2.4.1 or compatible
  • Package version: 1.2.20
  • Install type: source / installer
  • OS + version: not captured
  • Browser or app shell: Marinara Engine

Logs, screenshots, or video

Not captured; this is a load-time/performance report.

Additional context

The initial implementation slice is the uncommitted change in draft-review.ts, which combines source and mutation target IDs and performs one deduplicated getNotesByIds call. Memory Vault and other source-related broad-load behavior should be measured before extending the fix.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Sep 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/721 Originally assigned to: @Promansis on GitHub. ## Summary Long-Term Memory source-oriented views can take a long time to load as note data is read repeatedly. The Review Queue projection currently performs two note-ID lookups for the same response, while Memory Vault and related source views also perform broad note loads. ## Affected package Long-Term Memory (`long-term-memory`) ## Expected behavior Review Queue, Memory Vault, and related source views should load without redundant note-storage searches. The Review Queue projection should fetch the union of source and mutation target note IDs once, preserving the current response and projection behavior. ## Actual behavior Review Queue projection calls `getNotesByIds` separately for mutation overlays and source notes. Because note lookup initializes and locks the package store and reads note files, this duplicates storage work and contributes to slow source-oriented UI loads. ## Steps to reproduce 1. Install and enable Long-Term Memory in a compatible Marinara Engine checkout. 2. Open Long-Term Memory and navigate to Review Queue with drafts present. 3. Observe the time required for the review data and source context to appear. 4. Compare with Memory Vault or Sources, which also load note data and may show the same slow behavior as the vault grows. ## Environment - Marinara Engine version: 2.4.1 or compatible - Package version: 1.2.20 - Install type: source / installer - OS + version: not captured - Browser or app shell: Marinara Engine ## Logs, screenshots, or video Not captured; this is a load-time/performance report. ## Additional context The initial implementation slice is the uncommitted change in `draft-review.ts`, which combines source and mutation target IDs and performs one deduplicated `getNotesByIds` call. Memory Vault and other source-related broad-load behavior should be measured before extending the fix. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:26:56 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Promansis commented on GitHub (Sep 5, 2026):

Validation correction: the scope-fallback-label regression is pre-existing on upstream/staging, but it is related to this work because it directly affects Memory Vault, one of the slow source-oriented surfaces under investigation. The current patch only changes the Review Queue server lookup and does not fix that Memory Vault correctness issue. Full LTM validation therefore remains blocked by this related pre-existing failure.

<!-- gh-comment-id:5551896830 --> @Promansis commented on GitHub (Sep 5, 2026): Validation correction: the scope-fallback-label regression is pre-existing on upstream/staging, but it is related to this work because it directly affects Memory Vault, one of the slow source-oriented surfaces under investigation. The current patch only changes the Review Queue server lookup and does not fix that Memory Vault correctness issue. Full LTM validation therefore remains blocked by this related pre-existing failure.
Author
Owner

@Promansis commented on GitHub (Sep 5, 2026):

Resolved the validation blocker: Memory Vault already applies the missing-persona fallback through MemoryAvailabilityWorkbench -> availabilityEntries. The regression assertion was stale after the availability UI refactor and now verifies the current wiring. Focused scope fallback, full LTM suite, rebuilt lifecycle, and final local CI all pass.

<!-- gh-comment-id:5551975699 --> @Promansis commented on GitHub (Sep 5, 2026): Resolved the validation blocker: Memory Vault already applies the missing-persona fallback through MemoryAvailabilityWorkbench -> availabilityEntries. The regression assertion was stale after the availability UI refactor and now verifies the current wiring. Focused scope fallback, full LTM suite, rebuilt lifecycle, and final local CI all pass.
Author
Owner

@Promansis commented on GitHub (Sep 5, 2026):

Unified fix completed for the 1.2.20 source-loading regression. Review Queue now performs one deduplicated note lookup, and Memory Vault/Sources scope-target loading reuses the route note snapshot instead of rescanning the vault for every chat. Existing all-chat local-character behavior is preserved. Full LTM suite, rebuilt lifecycle/artifact checks, final CI/catalog gate, and branch review all pass.

<!-- gh-comment-id:5552071510 --> @Promansis commented on GitHub (Sep 5, 2026): Unified fix completed for the 1.2.20 source-loading regression. Review Queue now performs one deduplicated note lookup, and Memory Vault/Sources scope-target loading reuses the route note snapshot instead of rescanning the vault for every chat. Existing all-chat local-character behavior is preserved. Full LTM suite, rebuilt lifecycle/artifact checks, final CI/catalog gate, and branch review all pass.
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#368
No description provided.