You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Memory namespaces are the semantic dimension that makes the three-act M1 demo legible. Without them, "the toy sees travel memory but NOT the peanut allergy" is impossible to demonstrate — the worker either returns everything or nothing. Namespaces let cap-tokens carry "allowed namespaces" claims, the wire envelope carries the requested namespace, and the worker filters at request time.
This issue composes with the existing 4-type memory taxonomy (profile / procedural / semantic / episodic per docs/plan/agentkeys-memory-design.md). Types are structural (how the memory is encoded); namespaces are semantic (what life-context it belongs to). They compose: a single piece of episodic memory can live in the travel namespace.
Critical-path dependency for #107 (the MCP server's memory.get / memory.put tools depend on this).
Scope (M1)
Cap-token claim: add namespaces_allowed: ["personal", "travel"] to the broker-signed cap payload. The broker mints with the claim; the worker enforces it.
Wire-format field: add namespace: string field to memory put/get envelope. Out of band of S3 key derivation (preserves agent-iam-strategy.md §3.2a).
Memory worker filter: deterministic string-set membership check at request time. Wrong namespace → empty result + audit row (audit.namespace_violation).
Path-prefixed namespace layout (keeps current S3 key derivation — defer until cross-namespace queries justify it; likely M4+)
Per-namespace embedding indexes (use existing global index — M2 if scale demands)
User-defined custom namespaces (v0 has 4 fixed; user-defined → M4 with delegation work)
kids / device / temp namespaces (M3-M4)
arch.md compatibility
Verified zero contradictions per IAM strategy §3.5. Compatible with:
arch.md §17.5 (data_class binding) — namespace orthogonal to data_class
arch.md §17 (per-actor PrincipalTag) — namespace is a worker-layer filter; doesn't change AWS IAM
arch.md §K3 epoch rotation — namespace metadata is not key-bound
agentkeys-memory-design.md §1 invariants — namespace is metadata, not encoding
Acceptance criteria
A device's cap-token with namespaces_allowed: ["travel"] successfully reads travel-tagged memory and returns empty result for personal / family / work namespaces
An audit row is emitted on cross-namespace access attempt (audit.namespace_violation)
The three-act demo Act 1 succeeds: toy sees Chengdu trip (travel), NOT peanut allergy (personal). Verified end-to-end against MagicLick 2.5 hardware running xiaozhi-esp32 firmware.
Unit tests for the worker's namespace filter (positive + negative)
Cap-token claim is signed (the broker's K1 signing covers namespaces_allowed) and the worker re-verifies before filtering
Risks
Risk
Mitigation
Operators forget to tag memory at write time → memory becomes unreadable
The 4 default namespaces are an enum — represent as enum Namespace { Personal, Family, Work, Travel } with serde rename to lowercase strings
Watch for: namespace is NOT a substitute for data_class — data_class controls vault vs memory (per CLAUDE.md "Cap-tokens are data-class-explicit"); namespace is a sub-filter within memory only
Context
Memory namespaces are the semantic dimension that makes the three-act M1 demo legible. Without them, "the toy sees travel memory but NOT the peanut allergy" is impossible to demonstrate — the worker either returns everything or nothing. Namespaces let cap-tokens carry "allowed namespaces" claims, the wire envelope carries the requested namespace, and the worker filters at request time.
This issue composes with the existing 4-type memory taxonomy (profile / procedural / semantic / episodic per
docs/plan/agentkeys-memory-design.md). Types are structural (how the memory is encoded); namespaces are semantic (what life-context it belongs to). They compose: a single piece of episodic memory can live in thetravelnamespace.Critical-path dependency for #107 (the MCP server's
memory.get/memory.puttools depend on this).Scope (M1)
namespaces_allowed: ["personal", "travel"]to the broker-signed cap payload. The broker mints with the claim; the worker enforces it.namespace: stringfield to memory put/get envelope. Out of band of S3 key derivation (preservesagent-iam-strategy.md§3.2a).audit.namespace_violation).personal,family,work,travel(peragent-iam-strategy.md§3.5).Out of scope (defer)
kids/device/tempnamespaces (M3-M4)arch.md compatibility
Verified zero contradictions per IAM strategy §3.5. Compatible with:
arch.md§17.5 (data_class binding) — namespace orthogonal to data_classarch.md§17 (per-actor PrincipalTag) — namespace is a worker-layer filter; doesn't change AWS IAMarch.md§K3 epoch rotation — namespace metadata is not key-boundagentkeys-memory-design.md§1 invariants — namespace is metadata, not encodingAcceptance criteria
namespaces_allowed: ["travel"]successfully readstravel-tagged memory and returns empty result forpersonal/family/worknamespacesaudit.namespace_violation)namespaces_allowed) and the worker re-verifies before filteringRisks
memory.putrequiresnamespaceparam; missing param → 400 with clear errortravelANDfamily)References
docs/spec/plans/milestones-roadmap.md§2 (M1 scope)docs/research/agent-iam-strategy.md§3.5 (memory namespace model)docs/plan/agentkeys-memory-design.md— 4-type memory taxonomy (profile / procedural / semantic / episodic) that namespaces compose withdocs/research/ai-memory-systems-survey.md— competitive landscape for the memory layerdocs/arch.md§17 (per-data-class isolation invariants), §K-keysEffort
~3-4 days. Sequencing:
Depends on #107 MCP server scaffolding being far enough along that the
memory.get/memory.puttools can be wired through.Pickup notes for the next agent / developer
agent-iam-strategy.md§3.5 first — this is the strategic anchoragentkeys-memory-design.mdfor the existing 4-type taxonomycrates/agentkeys-worker-memory/— extend itsverify.rsfilter logiccrates/agentkeys-broker-server/src/handlers/cap.rs— add thenamespaces_allowedfield thereenum Namespace { Personal, Family, Work, Travel }with serde rename to lowercase stringsdata_classcontrols vault vs memory (per CLAUDE.md "Cap-tokens are data-class-explicit");namespaceis a sub-filter within memory only