LearnNewsExamplesServices
Frontmatter
id9677
titleEpic Sub: Enhance Neo.collection.Base with Secondary Lookup Indices
stateClosed
labels
enhancementai
assigneestobiu
createdAtApr 4, 2026, 2:54 AM
updatedAtApr 4, 2026, 3:03 AM
githubUrlhttps://github.com/neomjs/neo/issues/9677
authortobiu
commentsCount2
parentIssue9673
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 4, 2026, 3:02 AM

Epic Sub: Enhance Neo.collection.Base with Secondary Lookup Indices

Closedenhancementai
tobiu
tobiu commented on Apr 4, 2026, 2:54 AM

Problem

The Neo.ai.graph.Database currently relies on linear iteration O(E) over the entire edges store to execute getAdjacentNodes() or cascade removeNode(). For large GraphRAG topologies, this guarantees catastrophic performance degradation as the topology grows, since every relationship hop requires scanning every edge in existence.

Proposed Solution

Enhance Neo.collection.Base (or Neo.data.Store) to natively support declarative, reactive secondary map indices.

  • Introduce a configuration like indices: [{ property: 'source' }, { property: 'target' }].
  • The collection should internally maintain dedicated Map structures alongside the primary items array and key map.
  • Mutations (add, remove, update, clear) must automatically maintain these secondary maps.
  • This unlocks O(1) lookups (e.g., this.edges.indices.source.get(nodeId)) which massively accelerates any graph traversals or relational filtering operations across the Neo.mjs ecosystem.
tobiu added the enhancement label on Apr 4, 2026, 2:54 AM
tobiu added the ai label on Apr 4, 2026, 2:54 AM
tobiu referenced in commit 92d5c3e - "feat: Implement Native Graph Store with O(1) indices (#9677)" on Apr 4, 2026, 3:01 AM
tobiu assigned to @tobiu on Apr 4, 2026, 3:01 AM
tobiu
tobiu Apr 4, 2026, 3:02 AM

Native Graph Store implementation successfully completed. O(1) multi-map queries integrated via splice interception.

tobiu closed this issue on Apr 4, 2026, 3:02 AM
tobiu
tobiu Apr 4, 2026, 3:03 AM

Input from Antigravity (Gemini):

✦ ### Architecture Outline for Native Graph Store Implementation

This implementation mitigates linear O(E) search degradation for high-density topographical traversals inside the GraphRAG framework.

  • Neo.ai.graph.Store: Created as an extension of Neo.data.Store for zero-dependency native mapping without mutating core frameworks.
  • Secondary Declarative Indices: Added reactive indices_ mapping to construct scalable, multi-property mapping lookups.
  • splice() Pipeline Orchestration: Intercepted structural mutations via splice() directly to safely generate fast synchronous Map updates in standard associative dictionaries internally without generating bloated event dispatch overhead.
  • getByIndex() Query Engine: Implements O(1) retrievals resolving standard array extraction utilizing fast Map extraction over graph relationships.
  • Decoupling Neo.ai.graph.Database: Eradicated the iterative topology searches in favor of instantaneously mapping edge lookups [{ property: 'source' }, { property: 'target' }] dynamically configured during the edge store assignment.
tobiu added parent issue #9673 on Apr 4, 2026, 3:03 AM