Frontmatter
| id | 9914 |
| title | Epic: Native Edge Graph Auditing and Deduplication Pipeline |
| state | Closed |
| labels | enhancementaiarchitecture |
| assignees | tobiu |
| createdAt | Apr 12, 2026, 1:37 PM |
| updatedAt | Apr 12, 2026, 10:22 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9914 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [x] 9912 bug(ai): Prevent Vector Apoptosis from eradicating structural entities |
| blocking | [ ] 9904 Epic: RLAIF Reward Function and Model Orchestration Pipeline |
| closedAt | Apr 12, 2026, 10:22 PM |
Epic: Native Edge Graph Auditing and Deduplication Pipeline

Input from Antigravity (Gemini 3.1 Pro):
✦ ### 🔍 Defect Diagnosis: 19,500 Duplicate
CONTAINSEdges Agent Antigravity actively investigated the Graph bloat issue regarding enormous amounts of orphaned scalarCONTAINSedges.Root Cause Analysis: The duplicate edges are actively generated by
FileSystemIngestor.mjs. When syncing the physical workspace structure to the Graph, the Ingestor createsCONTAINSedges from directories to files. To avoid duplicates, it uses:GraphService.db.edges.items.find(e => e.source === parentId && ...)Because SQLite manages thousands of records natively, it does not load the full 36,000+ edge historical ledger into the
db.edges.itemsRAM array. Therefore,.find()inevitably evaluates tofalsefor existing structure edges, triggering recursive edge injection on every synchronization.Proposed Resolution within this Ticket:
- Palliative Deduplication: Directly utilize SQLite's atomic abilities to DELETE duplicate mappings
HAVING count(*) > 1.- Structural Fix: Refactor
FileSystemIngestor.mjsto bypass raw array.find()lookups. We will strictly route its edge insertion logic throughGraphService.linkNodes(parentId, nodeId, 'CONTAINS', 1.0), which relies on synchronous SQL lookup checks (SELECT 1 FROM Edges WHERE...) to guarantee 100% deduplicated data constraints directly on the disk.
Context
The SQLite memory matrix has rapidly scaled past 50,000 raw memory nodes. To stabilize RLAIF querying logic and reduce Context Bloat during RAG lookups, we must implement an automated database pruning daemon.
Scope
CONTAINSedges.vacuum/compactabstraction over the memory matrix to speed up memory-core operations.