LearnNewsExamplesServices
Frontmatter
id10139
titleExtend Memory Core with Explicit A2A Primitive
stateClosed
labels
enhancementaiarchitecturecoreneeds-re-triage
assignees[]
createdAtApr 21, 2026, 1:29 AM
updatedAt3:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/10139
authortobiu
commentsCount5
parentIssue9999
subIssues
10147 Mailbox: Message node schema + addMessage / listMessages / getMessage / markRead
10148 Mailbox: archiveMessage / deleteMessage + retracted-marker semantics
10149 Mailbox: extend memory-core healthcheck with inbox + outbox preview
10150 Mailbox: optional Chroma semantic layer for "find related messages"
10168 Expand mailbox test coverage and role-based addressing
10174 Mailbox SENT_TO edges silently culled by linkNodes FK check
10176 Mailbox identity observability + Claude Desktop onboarding docs
10179 Mailbox reachable-counterparty skips broadcast receipt path
10180 Mailbox polish: countMessages primitive + concept provenance docs
10181 Memory-core stdio identity binding non-deterministic after DB re-seed
10184 Identity binding stays null post-#10182 — enable debug logging + diagnose
10186 MCP concurrency audit + single-writer enforcement
10231 PermissionService.grantPermission must not lazy-stub missing targets
10232 GraphService.initAsync should self-seed AgentIdentity + BroadcastSentinel roots on boot
10252 Mailbox reply policy: config-gated default for deployment-tier selection
subIssuesCompleted14
subIssuesTotal15
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 10146 Cross-tenant permission edges + multi-tenant validation test suite, [x] 10145 OAuth2 authentication layer for Memory Core MCP connections, [x] 10144 AgentIdentity node type + GitHub account binding for model identities, [x] 10143 Graph-first Memory artifacts: lift Memory + Session to first-class nodes
blocking[]
closedAtMay 26, 2026, 4:22 AM

Extend Memory Core with Explicit A2A Primitive

Closed v13.0.0/archive-v13-0-0-chunk-5 enhancementaiarchitecturecoreneeds-re-triage
tobiu
tobiu commented on Apr 21, 2026, 1:29 AM

Extend Memory Core with Explicit A2A Primitive

Context

This ticket was filed 2026-04-20 (session a38d25d1-3003-4d57-b0ac-0effe2c3507e) with a Chroma-metadata prescription: extend add_memory with a recipient field, surface get_inbox over the existing memory collection. A follow-up session (71dc3cd8-d39d-48e1-ac62-e240ca67d1a5) re-reasoned the prescription layer across five turns of brainstorm with @tobiu and arrived at a graph-primary substrate decision instead. This reshape carries the new prescription; the original Chroma-metadata approach is preserved as an Avoided Trap. The ticket ID and its #9999 parent linkage are preserved — MX-loop in motion, not a new ticket.

The Problem

Probabilistic semantic retrieval (query_raw_memories) cannot serve as an explicit A2A channel — proven empirically when cross-instance agents failed to hand off via add_memory convention. But the original fix (metadata on the memory collection) conflates two categories:

  • Memories are open-shape, high-volume episodic content. Chroma substrate; semantic retrieval dominates access. Retention is accumulative.
  • Messages are closed-contract, directed artifacts with invariants (sender, read-state, thread integrity). Relationship queries dominate access (inbox/outbox/thread/reply-chain). Lifecycle is explicit (read, archived, retracted).

Tagging memories with recipient works tactically for MVP but bakes category-conflation into the substrate. Every downstream primitive (healthcheck preview, cross-tenant permissions, thread reconstruction, sender-history queries) pays the tax of filtering high-cardinality semantic chunks instead of traversing a structured mailbox graph.

The Architectural Reality

  • ai/daemons/DreamService.mjs (audited this session): memories and summaries are source material for extraction, not first-class graph nodes. The substrate exists but hasn't been used for mailbox-shaped work.
  • SQLite (better-sqlite3) already backs the Native Edge Graph; FTS5 covers keyword search; Concept Ontology (#10030) supplies semantic edges.
  • Existing graph tools (get_node, get_neighbors, search_nodes, query_hybrid_graph) absorb most mailbox access patterns. Mailbox-specific tools become thin wrappers, not a parallel tool tree.

The Fix

Mailbox as graph-primary directed messaging, built on Memory + Session + AgentIdentity as first-class graph nodes (prerequisites tracked in peer sub-epic + #10016 subs).

  • Message node: {id, subject, bodyText, createdAt, readAt, archivedAt, priority, retracted}
  • Edges: SENT_BY, SENT_TO (AgentIdentity | Role | Broadcast addressing), ORIGINATES_IN, RELATED_SESSION, REFERENCES_TICKET, IN_REPLY_TO, PART_OF_THREAD, TAGGED_CONCEPT (auto-emitted via #10030 integration).
  • Optional Chroma mailbox collection for semantic body search — phase-gated, not v1.

This ticket is the parent sub-epic for mailbox work. Implementation breaks into four sub-tickets (filed alongside): (1) Message schema + core tools, (2) Lifecycle (archive/retract), (3) Healthcheck preview, (4) Optional Chroma semantic layer. Cross-tenant permission edges + test suite land under #10016 — mailbox workload is the production-shape validation for #9999's multi-tenant substrate.

Acceptance Criteria

  • All four mailbox sub-tickets filed and linked
  • Graph-first Memory artifacts sub-epic shipped as prerequisite (this ticket blockedBy it)
  • AgentIdentity + OAuth2 work under #10016 shipped as prerequisite
  • Mailbox tools consumed by at least one real agent handoff (A2A demonstration, not synthetic)
  • Cross-tenant permission test suite (filed under #10016) passes with mailbox as workload
  • (Post-merge) Agents adopt addMessage / listMessages for explicit handoffs; convention-based "leave a memory for the next session" is retired

Out of Scope

  • Separate MCP server for A2A (original Avoided Trap; still rejected)
  • Cross-physical-clone Chroma sync (remains local to the federated Memory Core)
  • Human-facing mailbox UI

Avoided Traps

  • Chroma-metadata prescription (original body of this ticket). Rejected after re-reasoning. Category conflation: messages and memories have different retention, invariants, and access patterns. Tagging memories with recipient works for MVP but bakes conflation into the substrate — every downstream primitive pays the tax. Rationale anchored in user memory feedback_mcp_output_category_split (closed contracts vs open-shape introspection should not share a tool signature).
  • Separate A2A MCP server. Still rejected. Mailbox lives inside Memory Core MCP; extend the graph, don't fork the server.
  • "Mailbox is just another kind of memory." Rejected. Messages carry explicit SENT_BY / SENT_TO / IN_REPLY_TO edges memories don't; conflating invents edge-shaped scalars and re-derives them at query time.
  • Skipping memory-node lifting. Rejected. Messages need IN_REPLY_TO → Memory and REFERENCES_MEMORY → Memory edges. Memories must be nodes first — hence the peer sub-epic prerequisite.

Related

  • Parent: #9999 (Cloud-Native Knowledge & Multi-Tenant Memory Core)
  • Sibling (blocks this): Graph-first Memory artifacts sub-epic (filed this session)
  • Sibling (blocks this): #10016 AgentIdentity + OAuth2 subs (filed this session)
  • Context: Discussion #10137 (MX paradigm), #9535 (AI Village per-model account precedent)
  • Heritage sessions: 5a521819-dc75-4549-888e-fcea818d0401 (MX discussion), a38d25d1-3003-4d57-b0ac-0effe2c3507e (original filing)

Origin Session ID: 71dc3cd8-d39d-48e1-ac62-e240ca67d1a5

tobiu added the enhancement label on Apr 21, 2026, 1:29 AM
tobiu added the ai label on Apr 21, 2026, 1:29 AM
tobiu added the architecture label on Apr 21, 2026, 1:29 AM
tobiu added the core label on Apr 21, 2026, 1:29 AM
tobiu added parent issue #9999 on Apr 21, 2026, 1:29 AM
tobiu cross-referenced by #10143 on Apr 21, 2026, 11:28 AM
tobiu cross-referenced by #10144 on Apr 21, 2026, 11:28 AM
tobiu cross-referenced by #10145 on Apr 21, 2026, 11:29 AM
tobiu cross-referenced by #10146 on Apr 21, 2026, 11:29 AM
tobiu cross-referenced by #10147 on Apr 21, 2026, 11:29 AM
tobiu cross-referenced by #10148 on Apr 21, 2026, 11:29 AM
tobiu cross-referenced by #10149 on Apr 21, 2026, 11:30 AM
tobiu cross-referenced by #10150 on Apr 21, 2026, 11:30 AM
tobiu cross-referenced by #10151 on Apr 21, 2026, 11:31 AM
tobiu added sub-issue #10147 on Apr 21, 2026, 11:32 AM
tobiu added sub-issue #10148 on Apr 21, 2026, 11:32 AM
tobiu added sub-issue #10149 on Apr 21, 2026, 11:32 AM
tobiu added sub-issue #10150 on Apr 21, 2026, 11:32 AM
tobiu marked this issue as being blocked by #10143 on Apr 21, 2026, 11:33 AM
tobiu marked this issue as being blocked by #10144 on Apr 21, 2026, 11:33 AM
tobiu marked this issue as being blocked by #10145 on Apr 21, 2026, 11:33 AM
tobiu marked this issue as being blocked by #10146 on Apr 21, 2026, 11:33 AM
tobiu cross-referenced by #10154 on Apr 21, 2026, 1:17 PM
tobiu cross-referenced by PR #10155 on Apr 21, 2026, 1:32 PM
tobiu cross-referenced by PR #10161 on Apr 21, 2026, 4:36 PM
tobiu cross-referenced by PR #10162 on Apr 21, 2026, 4:54 PM
tobiu cross-referenced by #9999 on Apr 21, 2026, 7:03 PM
tobiu cross-referenced by #10016 on Apr 21, 2026, 8:21 PM
tobiu cross-referenced by PR #10166 on Apr 21, 2026, 9:06 PM
tobiu referenced in commit 7db6c90 - "feat(ai): wire stdio identity + anti-spoof guard for Memory Core MCP (#10145) (#10166) on Apr 21, 2026, 10:16 PM
tobiu
tobiu Apr 21, 2026, 10:27 PM

Input from Gemini 3.1 Pro (Antigravity):

✦ Epic Review by Gemini 3.1 Pro (Antigravity)

Stage 1 — Roadmap Fit: ✅ Perfectly aligned. This is a critical pillar for #9999 (Multi-Tenant Memory Core) and establishes the necessary explicit channel for reliable A2A (Agent-to-Agent) handoffs, avoiding the unreliability of probabilistic semantic retrieval for workflow orchestration.

Stage 2 — Approach Elegance: ✅ The decision to abandon the Chroma-metadata approach in favor of a graph-primary Message node on the Native Edge Graph is highly elegant. It correctly identifies that messages are closed-contract, directed artifacts, whereas memories are open-shape semantic chunks. Reusing the SQLite graph substrate prevents building redundant infrastructure (like a separate A2A server).

Stage 3 — Sub-Structure Coherence: ✅ The phase boundaries between schema/read/write (#10147), lifecycle (#10148), diagnostics (#10149), and the optional semantic layer (#10150) are clean. Note: As discussed in recent session planning, #10147's AC #5 (permission check integration) creates a circular dependency with #10146. This AC should be explicitly shifted to #10146 to keep the Mailbox PR and the Permissions PR cleanly sequenced.

Stage 4 — Prescription Layer: ✅ The implementation targets the correct substrate boundaries (Memory Core MCP tool layer and GraphService). The distinction between graph-primary storage for messages and vector-primary storage for memories correctly allocates database responsibilities.

Stage 5 — Avoided Traps Completeness: ✅ Extremely thorough. Explicitly calling out the "Chroma-metadata category conflation" and "Mailbox is just another kind of memory" traps prevents future contributors from attempting to merge the two substrates.

Verdict: Greenlight.

Origin Session ID: ada4aecb-60fc-4b25-a76b-cb92600835a2

tobiu
tobiu Apr 21, 2026, 11:02 PM

Input from Antigravity (Gemini 3.1 Pro):

✦ # Epic Review by Antigravity (Gemini 3.1 Pro)

  • Stage 1 — Roadmap Fit: ✅ The shift to an explicit A2A primitive perfectly aligns with the Epic #9999 Multi-Tenant architecture.
  • Stage 2 — Approach Elegance: ✅ Using the Native Edge Graph over Chroma-metadata avoids category conflation between directed messages and probabilistic semantic memory. Strong reuse of existing graph substrate.
  • Stage 3 — Sub-Structure Coherence: ✅ The four sub-issues cleanly cover the ACs with well-defined phase boundaries. The dependencies on #10143 and #10144 are correctly mapped.
  • Stage 4 — Prescription Layer: ✅ Solves the explicit A2A communication gap exactly at the structural edge level rather than faking it in semantic vectors.
  • Stage 5 — Avoided Traps Completeness: ✅ Outstanding capture of "Mailbox is just a memory" and the separate server fallacy.

Verdict: Greenlight

Origin Session ID: ada4aecb-60fc-4b25-a76b-cb92600835a2

tobiu cross-referenced by PR #10167 on Apr 21, 2026, 11:06 PM
tobiu added sub-issue #10168 on Apr 21, 2026, 11:24 PM
tobiu cross-referenced by PR #10170 on Apr 22, 2026, 12:30 AM
tobiu
tobiu Apr 22, 2026, 1:03 AM

Input from Gemini 3.1 Pro (Antigravity):

✦ # Epic Review by Gemini 3.1 Pro (Antigravity)

Stage 1 — Roadmap Fit: ✅ The transition to explicit A2A primitives aligns directly with the Golden Path to cure cross-session amnesia. The explicit linkage to #9999 confirms its place in the Multi-Tenant Memory Core evolution.

Stage 2 — Approach Elegance: ✅ Pivoting from a Chroma-metadata string tag to a true graph-primary Message node with directed edges (SENT_BY, SENT_TO) is the structurally superior choice. It avoids conflating open-shape episodic memory with closed-contract communication artifacts.

Stage 3 — Sub-Structure Coherence: ✅ The sub-issues (10147-10150) form a clean, non-circular phase progression. Moving from core node schemas, through lifecycle operations, to healthcheck visibility, and finally the optional semantic layer provides solid staging.

Stage 4 — Prescription Layer: ✅ The sub-graph targets the Memory Core MCP substrate accurately. The decision to reject a parallel A2A server keeps the framework footprint concise and reuses existing tools (get_node, get_neighbors).

Stage 5 — Avoided Traps Completeness: ✅ The "Avoided Traps" section is excellent, explicitly rejecting the original add_memory metadata hack and the separate MCP server path.

Verdict: Greenlight

Origin Session ID: ada4aecb-60fc-4b25-a76b-cb92600835a2

tobiu cross-referenced by PR #10171 on Apr 22, 2026, 1:05 AM