Problem
In multi-agent systems, multiple agents often need to share knowledge (e.g., a research agent and a writer agent both need access to the same context). Currently there's no standard pattern for shared vs. private memory in agent frameworks.
Proposed Solution: Memory Namespaces
// Private namespace (default) -- only this agent reads/writes
const privateMemory = new Engram({ agentId: "research-agent", namespace: "private" })
// Shared namespace -- all agents in the same session can read
const sharedMemory = new Engram({ agentId: "research-agent", namespace: "shared:session-001" })
// Team namespace -- agents with the same team ID share memories
const teamMemory = new Engram({ agentId: "research-agent", namespace: "team:writing-crew" })
Conflict Resolution Strategy
const memory = new Engram({
namespace: "shared:session-001",
conflictPolicy: "last-writer-wins", // or "merge", "version", "ask-llm"
onConflict: async (existing, incoming) => {
// Custom merge logic
return await mergeLLM(existing.content, incoming.content)
}
})
Use Cases
- Multi-agent pipelines: researcher passes findings to writer via shared memory
- Parallel agents: coordinate without redundant work
- Persistent sessions: multiple chat sessions sharing user preference profiles
Prior Art
Redis namespaces, PostgreSQL row-level locking, CRDTs for distributed state.
Problem
In multi-agent systems, multiple agents often need to share knowledge (e.g., a research agent and a writer agent both need access to the same context). Currently there's no standard pattern for shared vs. private memory in agent frameworks.
Proposed Solution: Memory Namespaces
Conflict Resolution Strategy
Use Cases
Prior Art
Redis namespaces, PostgreSQL row-level locking, CRDTs for distributed state.