Skip to main content

Module agent_scoped

Module agent_scoped 

Source
Expand description

Runtime memory wrapper bound to one agent.

Each agent holds its own per-agent backend instance (selected at agent creation via [agents.<alias>.memory.backend], immutable thereafter). The wrapper sits directly on top of that instance and:

  • Stamps the bound agent’s UUID on every store via the inner backend’s store_with_agent trait method (real implementations on every backend; the agent_id is never silently dropped at the trait boundary).
  • Filters every recall through the inner backend’s recall_for_agents with the resolved allowlist (own UUID + the read_memory_from allowlist from [agents.<alias>.workspace.read_memory_from]).
  • Intersects caller-supplied per-call allowlists with the bound allowlist so a caller can never widen scope past what the agent’s config permits.

Cross-backend allowlist entries are rejected at config load. The wrapper only ever sees same-backend sibling UUIDs in its allowed_agent_ids set.

Structs§

AgentScopedMemory
A Memory impl that scopes every read and write to a bound agent’s UUID + a resolved cross-agent allowlist.