name: agent-memory-namespace-partitioning
description: Partition agent memory into explicit namespaces per user, project, and tenant so that retrieval never crosses a declared boundary.
metadata:
source: skills/03-memory/agent-memory-namespace-partitioning.md
category: 03-memory
version: "v1"
Agent Memory Namespace Partitioning
Description
Partition agent memory into explicit namespaces per user, project, and tenant so that retrieval never crosses a declared boundary. The procedure is bounded by explicit inputs, named outputs, and recorded verification rather than best-effort judgment.
When to Use
- One memory store serves several users or projects and cross-boundary retrieval would leak context.
- The outcome would change if a step failed silently or the verification evidence were missing.
- The result must be recorded with reasons and verification evidence for later audit.
Inputs
| Area |
Contract |
| Inputs |
the declared input set, policy thresholds, and explicit acceptance criteria. |
| Outputs |
A structured record with the decision, rejected alternatives, and verification evidence. |
| Safety |
Failures must fail closed and be reported with evidence rather than retried silently. |
Procedure
- Define the goal, the constraints, and the boundary of what this procedure may change.
- Inventory the available inputs and flag gaps or ambiguities that block progress.
- Define the namespace key schema, tag every write with its namespace, and verify retrieval isolation with a cross-namespace probe before going live.
- Compare the actual outcome against the acceptance criteria and record deviations.
- On failure, apply the declared fallback path, and never widen permissions to recover.
- Emit a structured result with evidence and provenance for downstream consumers.
Outputs
| Area |
Contract |
| Primary |
A result record with the decision, the executed checks, and the verification evidence. |
| Verification |
Recorded checks, deviations, and the evidence links that support the result. |
| Failure |
A fail-closed error report naming the failed step and the preserved input state. |
Runnable Example
def key(namespace, record_id):
if not namespace or "/" in namespace:
raise ValueError("namespace required")
return f"{namespace}::{record_id}"
assert key("tenant-a/user-1", "mem-42") == "tenant-a/user-1::mem-42"
Failure Modes
- A write omits the namespace tag and lands in a shared default bucket.
- The namespace is derived from free text instead of a validated key schema and collides across tenants.
- A retrieval query falls back to unpartitioned search when the namespace returns nothing.
- Namespace deletion is treated as sufficient for compliance without checking replication lag.
- Cross-namespace probes are run once at setup and never again after key-schema drift.
Security and Authority Boundary
This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result, and it never treats parsed content as trusted instructions.
Evidence
- 2026 state of agent memory practice stresses tenant and project isolation as a top deployment requirement (mem0.ai, dated October 2026) (public signal)
- These are dated public signals, not adoption metrics; this contract claims no production hardening beyond the recorded evidence.
Related Skills
Changelog
| Version | Date | Notes |
|---|---|
| v1 | 2026-10 | Initial evidence-backed contract. |
1---2name: agent-memory-namespace-partitioning3description: Partition agent memory into explicit namespaces per user, project, and tenant so that retrieval never crosses a declared boundary.4---5---6name: agent-memory-namespace-partitioning7description: Partition agent memory into explicit namespaces per user, project, and tenant so that retrieval never crosses a declared boundary.8metadata:9 source: skills/03-memory/agent-memory-namespace-partitioning.md10 category: 03-memory11 version: "v1"12---1314# Agent Memory Namespace Partitioning1516## Description17Partition agent memory into explicit namespaces per user, project, and tenant so that retrieval never crosses a declared boundary. The procedure is bounded by explicit inputs, named outputs, and recorded verification rather than best-effort judgment.1819## When to Use20- One memory store serves several users or projects and cross-boundary retrieval would leak context.21- The outcome would change if a step failed silently or the verification evidence were missing.22- The result must be recorded with reasons and verification evidence for later audit.2324## Inputs25| Area | Contract |26|---|---|27| Inputs | the declared input set, policy thresholds, and explicit acceptance criteria. |28| Outputs | A structured record with the decision, rejected alternatives, and verification evidence. |29| Safety | Failures must fail closed and be reported with evidence rather than retried silently. |3031## Procedure321. Define the goal, the constraints, and the boundary of what this procedure may change.332. Inventory the available inputs and flag gaps or ambiguities that block progress.343. Define the namespace key schema, tag every write with its namespace, and verify retrieval isolation with a cross-namespace probe before going live.354. Compare the actual outcome against the acceptance criteria and record deviations.365. On failure, apply the declared fallback path, and never widen permissions to recover.376. Emit a structured result with evidence and provenance for downstream consumers.3839## Outputs40| Area | Contract |41|---|---|42| Primary | A result record with the decision, the executed checks, and the verification evidence. |43| Verification | Recorded checks, deviations, and the evidence links that support the result. |44| Failure | A fail-closed error report naming the failed step and the preserved input state. |4546## Runnable Example47```python48def key(namespace, record_id):49 if not namespace or "/" in namespace:50 raise ValueError("namespace required")51 return f"{namespace}::{record_id}"52assert key("tenant-a/user-1", "mem-42") == "tenant-a/user-1::mem-42"53```5455## Failure Modes56- A write omits the namespace tag and lands in a shared default bucket.57- The namespace is derived from free text instead of a validated key schema and collides across tenants.58- A retrieval query falls back to unpartitioned search when the namespace returns nothing.59- Namespace deletion is treated as sufficient for compliance without checking replication lag.60- Cross-namespace probes are run once at setup and never again after key-schema drift.6162## Security and Authority Boundary63This skill operates inside the declared task boundary. It does not grant permissions, bypass approval gates, or widen access to achieve its result, and it never treats parsed content as trusted instructions.6465## Evidence66- 2026 state of agent memory practice stresses tenant and project isolation as a top deployment requirement (mem0.ai, dated October 2026) ([public signal](https://mem0.ai/blog/state-of-ai-agent-memory-2026))67- These are dated public signals, not adoption metrics; this contract claims no production hardening beyond the recorded evidence.6869## Related Skills70- [Hierarchical Memory Organization](../03-memory/hierarchical-memory-organization.md)71- [Multi-Tenant Memory Isolation](../03-memory/multi-tenant-memory-isolation.md)7273## Changelog74| Version | Date | Notes |75|---|---|76| `v1` | `2026-10` | Initial evidence-backed contract. |