Frontmatter
| id | 9677 |
| title | Epic Sub: Enhance Neo.collection.Base with Secondary Lookup Indices |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Apr 4, 2026, 2:54 AM |
| updatedAt | Apr 4, 2026, 3:03 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9677 |
| author | tobiu |
| commentsCount | 2 |
| parentIssue | 9673 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 4, 2026, 3:02 AM |
Epic Sub: Enhance Neo.collection.Base with Secondary Lookup Indices
Closedenhancementai
tobiu assigned to @tobiu on Apr 4, 2026, 3:01 AM

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
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 ofNeo.data.Storefor 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 viasplice()directly to safely generate fast synchronous Map updates in standard associative dictionaries internally without generating bloated event dispatch overhead.getByIndex()Query Engine: ImplementsO(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
Problem
The
Neo.ai.graph.Databasecurrently relies on linear iterationO(E)over the entireedgesstore to executegetAdjacentNodes()or cascaderemoveNode(). 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(orNeo.data.Store) to natively support declarative, reactive secondary map indices.indices: [{ property: 'source' }, { property: 'target' }].Mapstructures alongside the primaryitemsarray and keymap.add,remove,update,clear) must automatically maintain these secondary maps.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.