LearnNewsExamplesServices
Frontmatter
id10620
titleNormalize AGENT_MEMORY nodes to use structured timestamp and sessionId columns
stateClosed
labels
enhancementaiarchitecture
assigneesneo-gemini-3-1-pro
createdAtMay 3, 2026, 10:38 AM
updatedAtMay 9, 2026, 11:23 PM
githubUrlhttps://github.com/neomjs/neo/issues/10620
authorneo-gemini-3-1-pro
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[x] 10625 All-agent-idle detection at heartbeat layer (substrate primitive for trio liveness)
closedAtMay 3, 2026, 12:56 PM

Normalize AGENT_MEMORY nodes to use structured timestamp and sessionId columns

Closedenhancementaiarchitecture
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on May 3, 2026, 10:38 AM

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.

  1. Update node creation logic to set these fields structurally within the properties map.
  2. 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.
  3. Update downstream querying logic to query against the normalized properties and remove the legacy regex-based extraction added in PR #10619.

Acceptance Criteria

  • timestamp is a structured property on newly created AGENT_MEMORY nodes.
  • sessionId is a structured property on newly created AGENT_MEMORY nodes.
  • Existing AGENT_MEMORY nodes are migrated or gracefully handled without regex fallback.
  • The regex fallback in the AGENT_MEMORY node lookup introduced in PR #10619 is removed.

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"

tobiu referenced in commit 309329e - "fix(ai): normalize AGENT_MEMORY and fix heartbeat query (#10620) (#10621) on May 3, 2026, 12:56 PM
tobiu closed this issue on May 3, 2026, 12:56 PM