LearnNewsExamplesServices
Frontmatter
id10010
titleMemory Core: Team vs Private Context Retrieval Flag
stateClosed
labels
enhancementaiarchitecture
assigneesneo-gemini-pro
createdAtApr 14, 2026, 5:19 PM
updatedAtJun 7, 2026, 7:19 PM
githubUrlhttps://github.com/neomjs/neo/issues/10010
authortobiu
commentsCount2
parentIssue10016
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[x] 10000 Hardened Identity Ingestion & Tenant Isolation
blocking[]
closedAtMay 17, 2026, 8:23 AM

Memory Core: Team vs Private Context Retrieval Flag

Closed v13.0.0/archive-v13-0-0-chunk-4 enhancementaiarchitecture
tobiu
tobiu commented on Apr 14, 2026, 5:19 PM

Objective

Introduce a Memory Core retrieval policy that lets deployments choose between strict private tenant reads, team-wide context reads, and legacy-migration compatibility while preserving write-side author provenance.

Current Source of Authority

learn/agentos/tooling/MultiTenantMigrationGuide.md supersedes the original boolean NEO_ENABLE_TEAM_MEMORY sketch with the memorySharing enum:

  • private: strict tenant isolation.
  • team: team/deployment-wide context sharing for tagged records.
  • legacy: migration-window compatibility for pre-tenant-aware / shared historical data.

This ticket implements the retrieval-side plumbing for that contract. It must not reintroduce a boolean-only policy surface.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
ai/mcp/server/memory-core/config.template.mjs / deployment config MultiTenantMigrationGuide.md memorySharing enum + mailbox.defaultReplyPolicy config pattern Add memorySharing.defaultPolicy with allowed values legacy, private, team; migration-window default is legacy, operator may flip to private post-migration; add env binding such as NEO_MEMORY_SHARING_DEFAULT_POLICY Missing config uses legacy during the migration window; invalid enum fails loudly rather than silently weakening isolation MemoryCore.md, SharedDeployment.md, MultiTenantMigrationGuide.md Config unit coverage for default, env override, and invalid enum
query_raw_memories MCP schema and MemoryService.queryMemories() #10010 original objective + MultiTenantMigrationGuide.md read-side policy Accept optional memorySharing override; otherwise use config default. private filters to caller userId only. team returns tagged team/deployment records while excluding untagged legacy rows. legacy preserves migration compatibility by including caller-owned plus shared / legacy-compatible rows. Returned records expose author provenance (userId when present) No bound identity keeps existing local single-tenant fallthrough; sessionId remains an outer constraint when supplied MemoryCoreMcpApi.md, MemoryCore.md Unit tests for where-clause construction and result provenance; integration smoke for owner/peer/shared visibility
query_summaries MCP schema and SummaryService.querySummaries() Same retrieval contract as raw memories; summaries are the fast session-level context surface Same memorySharing resolution as query_raw_memories, including optional per-call override, config default, private/team/legacy query filters, and returned author provenance (userId when present) Category filter composes with the sharing filter; no bound identity preserves daemon/local fallthrough MemoryCoreMcpApi.md, MemoryCore.md Unit tests for category + sharing filter composition; integration smoke for owner/peer/shared summary visibility
Write paths (add_memory, summarization/session writes) #10000 identity stamping invariant + MemoryCoreMcpAuth.md anti-spoof rule Writes always stamp the normalized server-resolved userId when a request context exists; clients cannot supply userId; memorySharing affects reads only Stdio / local no-identity mode preserves current local-dev behavior; no fake default tenant backfill MemoryCoreMcpAuth.md, MultiTenantMigrationGuide.md Existing write-side userId tests stay green; add regression that memorySharing does not alter write metadata
Legacy migration semantics MultiTenantMigrationGuide.md lazy-tag-on-read decision Do not backfill or mutate historical records. legacy read policy is the compatibility mechanism; private and team exclude untagged historical rows unless explicitly modeled as shared/tagged Operators can keep default legacy until healthcheck migration signals support flipping to private MultiTenantMigrationGuide.md, HealthService migration docs Test that legacy policy includes compatibility rows while private/team do not leak untagged rows

Out of Scope

  • SQLite Native Edge Graph RLS implementation remains #10011.
  • Storage-level per-tenant Chroma separation remains rejected for this layer.
  • Backfill scripts remain rejected; lazy-tag-on-read is the migration strategy.
  • A boolean-only NEO_ENABLE_TEAM_MEMORY surface is obsolete and should not be implemented.
tobiu added the enhancement label on Apr 14, 2026, 5:19 PM
tobiu added the ai label on Apr 14, 2026, 5:19 PM
tobiu added the architecture label on Apr 14, 2026, 5:19 PM
tobiu added parent issue #9999 on Apr 14, 2026, 5:19 PM
tobiu cross-referenced by #10016 on Apr 14, 2026, 6:43 PM
tobiu removed parent issue #9999 on Apr 14, 2026, 6:44 PM
tobiu added parent issue #10016 on Apr 14, 2026, 6:44 PM
tobiu marked this issue as being blocked by #10000 on Apr 14, 2026, 6:44 PM
tobiu cross-referenced by PR #10121 on Apr 20, 2026, 12:40 PM
tobiu cross-referenced by #9748 on Apr 20, 2026, 1:13 PM
tobiu cross-referenced by PR #10123 on Apr 20, 2026, 3:06 PM
tobiu cross-referenced by PR #10128 on Apr 20, 2026, 4:12 PM
tobiu cross-referenced by PR #10130 on Apr 20, 2026, 5:26 PM
tobiu cross-referenced by #10145 on Apr 21, 2026, 8:43 PM
tobiu referenced in commit b300383 - "feat(ai): Implement Memory Sharing Policy enum (#10010) (#11475) on May 17, 2026, 8:23 AM
tobiu closed this issue on May 17, 2026, 8:23 AM
tobiu referenced in commit 352344b - "feat(ai): default memory-sharing to team for deployment-wide raw reads (#12532) on Jun 5, 2026, 6:09 PM