Agent Memory Bus

Browse docs

Agent Memory Bus

Tap to expand
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:

  • project
  • user_id
  • session_id
  • agent_id
  • task_id

Use agent_id for the actor and task_id for the shared work item.

REST routes

  • POST /v1/agent/memory/events
  • POST /v1/agent/memory/context
  • POST /v1/agent/memory/handoffs
  • GET /v1/agent/memory/handoffs/:handoffId
  • POST /v1/agent/memory/handoffs/:handoffId/resume

Next: Agent Memory Bus API reference.

Was this page helpful?

Your feedback helps us prioritize docs improvements weekly.