Context
During the implementation of the fresh-session-spawn substrate corrective (PR #10619), a schema gap was identified in the Memory Core. AGENT_MEMORY nodes currently store crucial routing metadata (like timestamp and sessionId) as embedded string projections rather than structured first-class properties.
The Problem
The lack of structured fields forces downstream queries (like the Cycle 2 schema fix in PR #10619) to rely on brittle regex-based extraction from serialized JSON or unstructured property strings. This approach is computationally inefficient and introduces unnecessary schema coupling where the GraphLog parser must understand the internal string representation of the node properties.
The Architectural Reality
In the SQLite Database and GraphService operations, filtering AGENT_MEMORY by time or session requires mapping over full node properties or relying on regex parsing over the node's serialized data rather than leveraging indexable database columns or top-level structured JSON properties.
The Fix
Promote timestamp and sessionId from embedded string projections to first-class structured properties on AGENT_MEMORY nodes.
- Update node creation logic to set these fields structurally within the
properties map.
- Provide a migration strategy or an update-on-read mechanism for existing
AGENT_MEMORY nodes in the SQLite database to extract and elevate these fields.
- Update downstream querying logic to query against the normalized properties and remove the legacy regex-based extraction added in PR #10619.
Acceptance Criteria
Out of Scope
- Changes to the underlying GraphLog schema itself (this is strictly about node property normalization, not altering the base tables).
- Refactoring
MESSAGE or TASK node schemas.
Related
Origin Session ID: ba7c6393-6378-4905-bf62-12eca4954583
Retrieval Hint: "Option B deferred, schema-normalization follow-up supported"
Context
During the implementation of the fresh-session-spawn substrate corrective (PR #10619), a schema gap was identified in the Memory Core.
AGENT_MEMORYnodes currently store crucial routing metadata (liketimestampandsessionId) as embedded string projections rather than structured first-class properties.The Problem
The lack of structured fields forces downstream queries (like the Cycle 2 schema fix in PR #10619) to rely on brittle regex-based extraction from serialized JSON or unstructured property strings. This approach is computationally inefficient and introduces unnecessary schema coupling where the GraphLog parser must understand the internal string representation of the node properties.
The Architectural Reality
In the SQLite Database and GraphService operations, filtering
AGENT_MEMORYby time or session requires mapping over full node properties or relying on regex parsing over the node's serialized data rather than leveraging indexable database columns or top-level structured JSON properties.The Fix
Promote
timestampandsessionIdfrom embedded string projections to first-class structured properties onAGENT_MEMORYnodes.propertiesmap.AGENT_MEMORYnodes in the SQLite database to extract and elevate these fields.Acceptance Criteria
timestampis a structured property on newly createdAGENT_MEMORYnodes.sessionIdis a structured property on newly createdAGENT_MEMORYnodes.AGENT_MEMORYnodes are migrated or gracefully handled without regex fallback.AGENT_MEMORYnode lookup introduced in PR #10619 is removed.Out of Scope
MESSAGEorTASKnode schemas.Related
Origin Session ID: ba7c6393-6378-4905-bf62-12eca4954583 Retrieval Hint: "Option B deferred, schema-normalization follow-up supported"