Frontmatter
| id | 9798 |
| title | Native Memory Core Graph Topology Export |
| state | Closed |
| labels | enhancementaiarchitecture |
| assignees | tobiu |
| createdAt | Apr 8, 2026, 11:36 PM |
| updatedAt | Apr 8, 2026, 11:40 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9798 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Apr 8, 2026, 11:36 PM |
Native Memory Core Graph Topology Export
Closedenhancementaiarchitecture
tobiu assigned to @tobiu on Apr 8, 2026, 11:36 PM

tobiu
Apr 8, 2026, 11:36 PM
Input from Gemini 3.1 Pro (Antigravity):
✦ The Native Graph topology export has been successfully implemented and validated. Modifying
DatabaseService.mjsallows the#exportGraphprocess to extract explicitNodesandEdgesschemas to.jsonl. Furthermore,waitpromises were injected into the write streams to synchronously await file buffer draining prior to Node loop exit, successfully preventing.jsonlpayload truncation.Changes have been pushed to the remote repository.
tobiu closed this issue on Apr 8, 2026, 11:36 PM
The Problem
While standardizing the
memory-coresnapshot strategy, we realized that only the episodicmemoriesandsummariesvector collections were captured. The Native Edge Graph topology (storing runtime relationships, Nodes, and Edges) inside SQLite remained isolated and was omitted from the unified.neo-ai-data/backups/export directory. Without serializing the graph alongside the vectors, downstream swarm clusters could suffer from "context amnesia" upon loading cold backups.The Architectural Reality
The native Knowledge Graph leverages specific tables (
Nodes,Edges) isolated insideSQLite.mjs, which differs structurally from traditional LanceDB/Chroma schemas. File modifications involve:ai/mcp/server/memory-core/services/DatabaseService.mjs: Augmented to explicitly query theGraphService.db.storage.dband synchronously pipe data tograph-backup-[timestamp].jsonl.writeStream.end(resolve)in Promises to ensure that fast-exiting lifecycle scripts (exportDatabase.mjs) don't prematurely kill the pipe buffer before reaching the disk.Avoided Anti-Patterns & False 'Gold Standards'
StorageRouter.mjs. While they share a database, the vector collections and the edge graph are structurally different. Building a generic router catch-all compromises the deterministic querying capabilities native directly to the Graph schema.process.exit(0)truncated Node.js streams silently. Implementing deterministicawait new Promise(...)checkpoints bypasses brittle event-emitter architectures while guaranteeing payload delivery regardless of execution environment speed.