Agent Memory BusUpdated 2026-05-25
Agent Memory Bus
Shared hosted memory for agentic systems, task context, and handoffs.
Agent Memory Bus lets agents publish work events, retrieve shared task memory, and hand off context to another agent.
It is hosted on RetainDB Cloud, exposed at https://api.retaindb.com, and backed by the Convex memory backend.
What agents should record
- decisions
- constraints
- failures
- tool results
- task updates
- observations worth remembering
Planner to builder flow
ts
import { RetainDB } from "@retaindb/sdk";
const db = new RetainDB({
apiKey: process.env.RETAINDB_API_KEY,
project: "app"
});
const planner = db.agent("planner").task("checkout-redesign");
await planner.event({
type: "decision",
summary: "Use hosted checkout in v1.",
details: {
reason: "Lower implementation risk and fewer compliance concerns."
},
salience: 0.9
});
const context = await planner.context(
"What should the builder know before implementation?"
);
const handoff = await planner.handoff({
toAgentId: "builder",
summary: "Implement hosted checkout using the recorded constraints.",
context: JSON.stringify(context)
});The builder can resume the handoff:
ts
const builder = db.agent("builder").task("checkout-redesign");
const resumed = await builder.handoffResume(String(handoff.handoff_id), {
sessionId: "builder-session-001"
});Scopes
Agent Memory Bus uses the same isolation model as RetainDB memory:
projectuser_idsession_idagent_idtask_id
Use agent_id for the actor and task_id for the shared work item.
REST routes
POST /v1/agent/memory/eventsPOST /v1/agent/memory/contextPOST /v1/agent/memory/handoffsGET /v1/agent/memory/handoffs/:handoffIdPOST /v1/agent/memory/handoffs/:handoffId/resume
Was this page helpful?
Your feedback helps us prioritize docs improvements weekly.