Skip to content

fix: load brain graph nodes from projections (#4196) - #4295

Merged
atomantic merged 2 commits into
mainfrom
claim/issue-4196
Aug 15, 2026
Merged

fix: load brain graph nodes from projections (#4196)#4295
atomantic merged 2 commits into
mainfrom
claim/issue-4196

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • brainGraph.loadNodes() was reading full record bodies via brainStorage.getAll() instead of the cached field projections brainSearchIndex already builds — the same duplicate disk-read pattern issue [Perf] Graph search index endpoint loads full record bodies for all entity types and daily logs #3507 fixed for the graph search index.
  • Adds tags/status/summary fields (description, context, oneLiner, artist, notes) plus a type-guarded content derived field to the shared brain projection set so the graph's edge-bearing views (overview/neighborhood) can read from projections without losing data — large SongBook sheet bodies (content.text) still never reach the cache.
  • Parallelizes the per-type projection fetch in loadNodes() with Promise.all, matching the existing pattern in the sibling getBrainGraphSearchIndex().

Closes #4196

Test plan

  • cd server && NODE_ENV=test npx vitest run services/brainGraph.test.js services/brainSearchIndex.test.js — 50 passing, including new coverage for tags/status projection, string-vs-object content guarding, and node-for-node parity between the full and projection-backed graph paths
  • Full server suite (NODE_ENV=test npm test): 1398 files / 29352 tests passing

loadNodes() awaited getBrainProjections() once per entity type in a
sequential loop, paying the sum of all six fetch latencies on a cold
cache. getBrainGraphSearchIndex() already fetches the same six types
with Promise.all — loadNodes() now matches that pattern.
@atomantic
atomantic merged commit 4459921 into main Aug 15, 2026
1 check passed
@atomantic
atomantic deleted the claim/issue-4196 branch August 15, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Brain graph: read node fields from projections instead of full record bodies

1 participant