Feature Request: Cross-agent memory reads via link permissions
Problem
Spacebot's memory architecture is per-agent isolated: each agent has its own SQLite + LanceDB memory store. In multi-agent setups, there is no data path between agents' memories.
For example: an overseer agent records project decisions and domain knowledge, but a specialist agent sees an empty memory store. The specialist can't benefit from the overseer's accumulated knowledge without the human repeating it.
The existing send_agent_message tool proves the pattern for cross-agent operations: it uses the links system for permission validation. Memory reads needed the same capability.
Related
Proposed Solution
Extend MemoryRecallTool with an optional target_agent_id parameter, using the existing links system for permission enforcement:
API
{
"tool": "memory_recall",
"args": {
"query": "classification methodology",
"target_agent_id": "overseer"
}
}
When target_agent_id is specified:
- Validate that a link exists between the calling agent and the target
- Check link direction (only read if the link allows it)
- Resolve the target's
MemorySearch from a shared registry
- Perform the search on the target's memory store
- Return results without
record_access() side effects (remote reads don't alter the target's access tracking)
Self-targeting (target_agent_id = own ID) falls through to the normal local path.
Implementation sketch
src/lib.rs:
- Add
memory_search_registry: Arc<ArcSwap<HashMap<String, Arc<MemorySearch>>>> to AgentDeps
src/tools/memory_recall.rs:
- Add
CrossAgentMemoryAccess struct (registry + links + self-agent-id)
- Add
with_cross_agent() builder on MemoryRecallTool
- Add
target_agent_id: Option<String> to args
- In
call(): validate link → resolve target → remote search → skip record_access()
src/tools.rs:
- Both tool factories accept optional
links + memory_search_registry params
- Conditionally call
tool.with_cross_agent(...) when both are Some
src/main.rs:
- After agent initialization, build per-agent
HashMap<String, Arc<MemorySearch>> registries
- Pass to tool factory calls
Why this approach
- Follows existing patterns — mirrors
task_store_registry for cross-agent task access
- Links for permissions — no new permission model, reuses what's already there
- Read-only — agents can only read other agents' memories, never write. This preserves isolation guarantees
- No side effects — remote reads skip
record_access() to avoid polluting the target's access tracking
Impact
- Multi-agent setups can share knowledge without duplication
- Specialists can leverage overseer/manager knowledge automatically
- Read-only by design — no risk of memory corruption across agents
- Zero impact on single-agent setups (no registry = no cross-agent capability)
Implementation Notes
We've been running this on v0.3.3. I noticed vsumner has active memory work in #521-#524 — I'd like to coordinate to make sure this aligns with the direction the memory system is heading. Happy to adapt the implementation to fit the evolving architecture.
Feature Request: Cross-agent memory reads via link permissions
Problem
Spacebot's memory architecture is per-agent isolated: each agent has its own SQLite + LanceDB memory store. In multi-agent setups, there is no data path between agents' memories.
For example: an overseer agent records project decisions and domain knowledge, but a specialist agent sees an empty memory store. The specialist can't benefit from the overseer's accumulated knowledge without the human repeating it.
The existing
send_agent_messagetool proves the pattern for cross-agent operations: it uses the links system for permission validation. Memory reads needed the same capability.Related
Proposed Solution
Extend
MemoryRecallToolwith an optionaltarget_agent_idparameter, using the existing links system for permission enforcement:API
{ "tool": "memory_recall", "args": { "query": "classification methodology", "target_agent_id": "overseer" } }When
target_agent_idis specified:MemorySearchfrom a shared registryrecord_access()side effects (remote reads don't alter the target's access tracking)Self-targeting (
target_agent_id= own ID) falls through to the normal local path.Implementation sketch
src/lib.rs:memory_search_registry: Arc<ArcSwap<HashMap<String, Arc<MemorySearch>>>>toAgentDepssrc/tools/memory_recall.rs:CrossAgentMemoryAccessstruct (registry + links + self-agent-id)with_cross_agent()builder onMemoryRecallTooltarget_agent_id: Option<String>to argscall(): validate link → resolve target → remote search → skiprecord_access()src/tools.rs:links+memory_search_registryparamstool.with_cross_agent(...)when both areSomesrc/main.rs:HashMap<String, Arc<MemorySearch>>registriesWhy this approach
task_store_registryfor cross-agent task accessrecord_access()to avoid polluting the target's access trackingImpact
Implementation Notes
We've been running this on v0.3.3. I noticed vsumner has active memory work in #521-#524 — I'd like to coordinate to make sure this aligns with the direction the memory system is heading. Happy to adapt the implementation to fit the evolving architecture.