LearnNewsExamplesServices
Frontmatter
id10172
titleGraph node-ID case canonicalization: settle memory:/MEMORY: and session:/SESSION: convention
stateClosed
labels
enhancementaiarchitecturecore
assigneesneo-gpt
createdAtApr 22, 2026, 1:19 AM
updatedAt3:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/10172
authortobiu
commentsCount3
parentIssue10143
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJun 6, 2026, 1:23 AM

Graph node-ID case canonicalization: settle memory:/MEMORY: and session:/SESSION: convention

Closed v13.0.0/archive-v13-0-0-chunk-5 enhancementaiarchitecturecore
tobiu
tobiu commented on Apr 22, 2026, 1:19 AM

Context

The Native Edge Graph previously carried two case conventions for row-backed Memory and Session node IDs:

  • Ingestor/storage convention: lowercase memory:<chromaId> and session:<sessionId>.
  • Extractor/provenance prompt convention: uppercase MEMORY:<chromaId> and SESSION:<sessionId>.

Current source and tests have already converged most runtime behavior toward lowercase storage. The remaining work is contract/documentation alignment, not a graph-wide prefix migration.

Current State (2026-06-03 V-B-A)

  • MemorySessionIngestor writes row-backed Memory/Session graph IDs as lowercase memory:<id> and session:<id>.
  • GraphService.normalizeGraphNodeId() lowercases only Memory/Session prefixes and leaves other prefixes such as CONCEPT: / CLASS: / AGENT: outside this ticket.
  • Current tests assert uppercase Memory/Session inputs normalize to lowercase storage/linking rather than persisting uppercase duplicates.
  • learn/agentos/tooling/GraphBackfill.md still needs the canonical-format section updated from deferred/ambiguous wording.
  • SemanticGraphExtractor provenance/lazy-queue examples and predicates still need reconciliation with the row-backed lowercase Memory/Session contract.

Decision

Use Option A for this ticket: canonical row-backed Memory/Session storage IDs are lowercase memory:<id> and session:<id>. Uppercase MEMORY:<id> / SESSION:<id> remain compatibility input forms only.

This ticket explicitly does not migrate semantic or identity prefixes such as CONCEPT:, CLASS:, AGENT:, or other non-row-backed node families.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
Row-backed Memory node IDs Current MemorySessionIngestor + #10172 decision Canonical storage ID is memory:<chromaId>. Uppercase MEMORY:<id> accepted as compatibility input and normalized before storage/linking. GraphBackfill.md canonical format section Unit/source verification that storage remains lowercase
Row-backed Session node IDs Current MemorySessionIngestor + #10172 decision Canonical storage ID is session:<sessionId>. Uppercase SESSION:<id> accepted as compatibility input and normalized before storage/linking. GraphBackfill.md canonical format section Unit/source verification that storage remains lowercase
GraphService.normalizeGraphNodeId() Existing compatibility shim Retain as backward-compatible input normalization for Memory/Session only. Unknown or non-row-backed prefixes pass through unchanged unless a separate graph-wide prefix policy ticket exists. JSDoc if wording is stale Focused tests for Memory/Session normalization and non-Memory/Session passthrough
SemanticGraphExtractor provenance / lazy-queue producer Current extractor prompt/predicate + #10172 decision Reconcile Memory/Session examples and provenance target detection with lowercase canonical row-backed IDs while preserving compatibility with uppercase queued inputs. Existing uppercase queued entries still drain through normalization. JSDoc/prompt text if changed Fixture/unit coverage for queued provenance targets
GraphBackfill.md operator guidance Operator/manual-query surface Document lowercase Memory/Session canonical IDs and uppercase compatibility inputs so manual SQLite/graph queries do not miss rows. Mention semantic uppercase prefixes are separate and out of scope. learn/agentos/tooling/GraphBackfill.md Docs grep + review evidence
Explicit exclusions #10172 scope boundary Do not migrate CONCEPT:, CLASS:, AGENT:, or other non-row-backed prefixes. If future evidence needs graph-wide prefix settlement, file a separate ticket. Ticket body / docs note No source changes touching those prefixes under this ticket

Acceptance Criteria

  • Canonical decision recorded: lowercase memory: / session: for row-backed Memory/Session storage.
  • GraphBackfill.md documents canonical lowercase Memory/Session IDs and uppercase compatibility input forms.
  • SemanticGraphExtractor provenance/lazy-queue Memory/Session examples or predicates are reconciled with the canonical contract, if current source still emits misleading uppercase row-backed targets.
  • GraphService.normalizeGraphNodeId() remains as a backward-compatible shim and is documented/tested as Memory/Session-only.
  • No migration or recasing is applied to CONCEPT:, CLASS:, AGENT:, or other non-row-backed prefixes.

Out of Scope

  • Graph-wide prefix policy.
  • Agent identity prefix convention.
  • DB migration from lowercase to uppercase.
  • Recasting semantic node IDs such as CONCEPT: / CLASS:.

Related

Origin Session ID: d69ac7a0-9fe8-4416-b766-cd9edb8bee71.

tobiu added the enhancement label on Apr 22, 2026, 1:19 AM
tobiu added the ai label on Apr 22, 2026, 1:19 AM
tobiu added the architecture label on Apr 22, 2026, 1:19 AM
tobiu added the core label on Apr 22, 2026, 1:19 AM
tobiu added parent issue #10143 on Apr 22, 2026, 1:19 AM
tobiu cross-referenced by PR #10171 on Apr 22, 2026, 1:20 AM
tobiu cross-referenced by #9999 on Apr 22, 2026, 11:09 AM
tobiu referenced in commit 07655f1 - "fix(memory): canonicalize memory session graph ids (#10172) (#12601)" on Jun 6, 2026, 1:23 AM
tobiu closed this issue on Jun 6, 2026, 1:23 AM