auto-memory-store.json accumulates duplicate entries on every session (4482 entries with only 157 unique IDs). intelligence.cjs buildEdges() processes all duplicates, generating O(n^2) edges between copies of the same entry. This produces 1.3M edges (194MB graph-state.json) for just 157 unique nodes.
The cache-hit check (graphState.nodeCount === store.length) also never matches because it compares deduplicated node count (157) against raw store length (4482), so the graph is needlessly rebuilt on every session start.
Fix
Deduplicate store entries by ID before building nodes and edges. Fix cache-hit check to compare against unique ID count.
Result: 194MB -> 79KB, 1,337,498 edges -> 157.
File
v3/@claude-flow/cli/.claude/helpers/intelligence.cjs
auto-memory-store.json accumulates duplicate entries on every session (4482 entries with only 157 unique IDs). intelligence.cjs buildEdges() processes all duplicates, generating O(n^2) edges between copies of the same entry. This produces 1.3M edges (194MB graph-state.json) for just 157 unique nodes.
The cache-hit check (
graphState.nodeCount === store.length) also never matches because it compares deduplicated node count (157) against raw store length (4482), so the graph is needlessly rebuilt on every session start.Fix
Deduplicate store entries by ID before building nodes and edges. Fix cache-hit check to compare against unique ID count.
Result: 194MB -> 79KB, 1,337,498 edges -> 157.
File
v3/@claude-flow/cli/.claude/helpers/intelligence.cjs