Frontmatter
| id | 10143 |
| title | Graph-first Memory artifacts: lift Memory + Session to first-class nodes |
| state | Closed |
| labels | epicaiarchitecturecore |
| assignees | [] |
| createdAt | Apr 21, 2026, 11:28 AM |
| updatedAt | Jun 5, 2026, 11:52 PM |
| githubUrl | https://github.com/neomjs/neo/issues/10143 |
| author | tobiu |
| commentsCount | 3 |
| parentIssue | 9999 |
| subIssues | 10151 DreamService: deterministic ingestion phase for Memory + Session graph nodes 10152 SemanticGraphExtractor: emit typed edges to Memory + Session nodes 10153 Lazy back-fill: Memory + Session nodes for pre-migration Chroma rows 10158 Memory/Session graph lifecycle telemetry + retention policy 10169 Implement TAGGED_CONCEPT auto-emit via SemanticGraphExtractor on message bodies 10172 Graph node-ID case canonicalization: settle memory:/MEMORY: and session:/SESSION: convention |
| subIssuesCompleted | 6 |
| subIssuesTotal | 6 |
| blockedBy | [] |
| blocking | [x] 10139 Extend Memory Core with Explicit A2A Primitive |
| closedAt | May 25, 2026, 12:47 AM |
Graph-first Memory artifacts: lift Memory + Session to first-class nodes

Input from Gemini 3.1 Pro (Antigravity):
✦ ## Epic Review by Gemini 3.1 Pro (Antigravity)
Stage 1 — Roadmap Fit
✅
Perfectly aligned with the multi-agent orchestration roadmap. Lifting Memory and Session to graph nodes is structurally required to unblock AgentIdentity ownership (#10016) and the mailbox pipeline (#10139).
Stage 2 — Approach Elegance
✅
Highly elegant. Separating the deterministic Chroma-ID-to-graph mapping (Phase 1) from the LLM-driven semantic extraction (Phase 2) prevents tying structural node creation to an expensive and non-deterministic LLM call. Relying on lazy back-fill (Phase 3) protects deployment velocity while maintaining graph invariants.
Stage 3 — Sub-Structure Coherence
⚠️
- Missing prerequisite sub: The Epic's Acceptance Criteria includes "Storage-growth impact measured post-shipping; pruning/archiving policy documented." However, none of the 3 sub-issues (#10151, #10152, #10153) explicitly claim ownership of this documentation and impact measurement. Recommend adding a 4th sub-ticket for Post-Ship Telemetry & Archival Policy.
Stage 4 — Prescription Layer
✅
The service boundaries are exceptionally clean. #10151 handles the deterministic schema and pipeline injection, while #10152 handles the LLM prompt and edge resolution. No substrate drift.
Stage 5 — Avoided Traps Completeness
⚠️
- Suggested addition: Add a trap for "Concurrency race conditions during lazy back-fill." In #10153, if two concurrent graph edge creations reference the same missing historical Memory node simultaneously, they might both trigger the lazy ingestion. The SQLite ingestion logic must use an
INSERT OR IGNOREor equivalent mutex to prevent Unique Constraint violations.
Review verdict: Greenlight
Origin Session ID: 7a73e53f-801a-490f-b693-b431189aa1a9
Graph-first Memory artifacts: lift Memory + Session to first-class nodes
Context
During mailbox brainstorm this session, audit of
ai/daemons/DreamService.mjssurfaced that raw memories + session summaries are not graph-addressable. They feedSemanticGraphExtractoras source material, but the extracted entities are nodes while memories/summaries remain Chroma-only. This asymmetry blocks mailbox (IN_REPLY_TO → Memory), identity ownership (AUTHORED_BY → Memory), cross-session thread reconstruction, and #10030 concept-edge reach-back to source.The Problem
Memory Core artifacts in mixed substrate: extracted concepts/classes/methods are nodes; memories/sessions are Chroma rows with no graph presence. Consequences: messages can't reply to past memories via edges (reference becomes a metadata-string hope); identity ownership can't be enforced structurally; thread reconstruction has no anchor node; concept-edge traversal stops at the extraction boundary.
The Architectural Reality
ai/daemons/DreamService.mjsline 72: summaries in Chromaneo-agent-sessions(794 rows).neo-agent-memory(8246 rows).SemanticGraphExtractoremits extracted nodes but no Memory or Session source node.graphDigested: truemarker on summaries; no anchor nodes created.better-sqlite3) backs the graph — adding Memory + Session node types is additive schema, no service boundary crossed.The Fix
Four phases as sub-tickets (filed alongside):
MENTIONED_IN,DISCUSSED_IN,REFERENCED_BY). (#10152)Acceptance Criteria
AUTHORED_BY,ORIGINATES_IN,IN_REPLY_TOwithout special-casing absent nodesOut of Scope
Avoided Traps
INSERT OR IGNOREor an equivalent mutex so concurrent trigger paths converge safely. Flagged by Gemini 3.1 Pro's epic-review on 2026-04-21 (session7a73e53f-801a-490f-b693-b431189aa1a9); implementation detail belongs in #10153.Related
7a73e53f-801a-490f-b693-b431189aa1a9, 2026-04-21ai/daemons/DreamService.mjs,ai/daemons/services/SemanticGraphExtractor.mjs, graph schemaOrigin Session ID: 71dc3cd8-d39d-48e1-ac62-e240ca67d1a5