[GH-ISSUE #1021] [Issue]: Memory vault loads slowly because opening it scans the whole vault twice #523

Closed
opened 2026-10-20 17:28:18 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @Promansis on GitHub.

Summary

Opening the Long-Term Memory vault freezes for about a second. The freeze is largely independent of the selected scope size because the vault is fully scanned twice on open: /scope-targets calls storage.listNotes() with no limit, and /notes then calls storage.listNotes() again for the selected scope. Each listNotes() sequentially reads and parses every JSON file in the vault.

Affected package

long-term-memory (1.3.8)

Expected behavior

Opening the vault should read and parse the vault at most once per fresh storage state. Selecting a scope with few or no memories should not trigger another full rescan.

Actual behavior

With roughly 300 memories, both the initial /scope-targets request and the scoped /notes request read and parse all vault notes in sequence (storage.ts:232-273). The vault UI blocks while both complete, so the freeze persists even when the selected scope has very few memories. The client then filters, sorts, and renders the full note array, with repeated linear link lookups during search/preview.

Steps to reproduce

  1. Install long-term-memory with a vault containing a few hundred notes.
  2. Open Chat Settings -> Agents -> Long-Term Memory (Memory Vault).
  3. Observe the UI freeze while /scope-targets and /notes both complete.
  4. Select a scope with few or no memories and observe that loading is still slow.

Environment

  • Marinara Engine version: 2.4.1 (manifest builtAgainst)
  • Package version: 1.3.8
  • Install type: source
  • OS + version: Linux
  • Browser or app shell: browser

Logs, screenshots, or video

No logs captured; reported behavior is a visible UI freeze.

Additional context

Distinct from #731 (repeated local-character discovery in /scope-targets, already fixed). The remaining cost is the unbounded storage.listNotes() call in /scope-targets plus a second full scan in /notes. Proposed direction: a shared, invalidated vault snapshot in LongTermMemoryStorage so both consumers share one parse, and a single combined vault-data request for the vault open path.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Sep 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1021 Originally assigned to: @Promansis on GitHub. ## Summary Opening the Long-Term Memory vault freezes for about a second. The freeze is largely independent of the selected scope size because the vault is fully scanned twice on open: `/scope-targets` calls `storage.listNotes()` with no limit, and `/notes` then calls `storage.listNotes()` again for the selected scope. Each `listNotes()` sequentially reads and parses every JSON file in the vault. ## Affected package `long-term-memory` (1.3.8) ## Expected behavior Opening the vault should read and parse the vault at most once per fresh storage state. Selecting a scope with few or no memories should not trigger another full rescan. ## Actual behavior With roughly 300 memories, both the initial `/scope-targets` request and the scoped `/notes` request read and parse all vault notes in sequence (`storage.ts:232-273`). The vault UI blocks while both complete, so the freeze persists even when the selected scope has very few memories. The client then filters, sorts, and renders the full note array, with repeated linear link lookups during search/preview. ## Steps to reproduce 1. Install `long-term-memory` with a vault containing a few hundred notes. 2. Open Chat Settings -> Agents -> Long-Term Memory (Memory Vault). 3. Observe the UI freeze while `/scope-targets` and `/notes` both complete. 4. Select a scope with few or no memories and observe that loading is still slow. ## Environment - Marinara Engine version: 2.4.1 (manifest `builtAgainst`) - Package version: 1.3.8 - Install type: source - OS + version: Linux - Browser or app shell: browser ## Logs, screenshots, or video No logs captured; reported behavior is a visible UI freeze. ## Additional context Distinct from #731 (repeated local-character discovery in `/scope-targets`, already fixed). The remaining cost is the unbounded `storage.listNotes()` call in `/scope-targets` plus a second full scan in `/notes`. Proposed direction: a shared, invalidated vault snapshot in `LongTermMemoryStorage` so both consumers share one parse, and a single combined vault-data request for the vault open path. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:28:18 +07:00
  • closed this issue
  • added the
    bug
    label
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#523
No description provided.