Skip to content

Bug: intelligence.cjs graph-state.json grows to 194MB due to duplicate store entriesΒ #1518

@sparkling

Description

@sparkling

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions