Skip to content

Git for what your agents know.

Fork an agent’s memory, try something, see the diff, then merge it or throw it away. The same four verbs you use on code, applied to everything an agent or robot has learned.

MAINPOLICY-V2Prefers emailm1Pro plan since 2025m2Refunds: 14 daysm3Escalate chargebacksRefunds: 30 daysmergem6
  1. › clawdb_search({ query: "refund policy" })
    → "Refunds: 14-day window" (score 0.94)

Four verbs. Nothing else to learn.

Fork

Snapshot an agent’s memory into a named branch. Copy-on-write, so nothing is duplicated until the branch diverges.

Diff

See exactly what a branch added, changed or superseded relative to main, memory by memory.

Merge

Fold a branch back into main with a strategy: last-write wins, or the branch wins every conflict.

Discard

Throw a failed experiment away. Main never saw it; nothing to clean up.

Same flow from the SDK or any MCP client.

Branch IDs are ordinary values: pass them between agents, store them with an eval run, or put them in a log line.

const branch = await db.branch.fork('policy-v2');

// …the agent runs against the branch…
await db.memory.remember('Refunds: 30-day window', { tags: ['policy'] });

const diff = await db.branch.diff(branch, 'trunk');
// { added: 2, superseded: 1, conflicts: 0 }

if (evalPassed) await db.branch.merge(branch, 'trunk');
else await db.branch.discard(branch);

What teams branch memory for.

Eval runs that don’t pollute production

Run a thousand test conversations on a branch. The agent remembers everything during the run; production memory learns nothing unless you merge.

A/B two behaviours on identical memory

Fork twice, give each branch a different prompt or model, and compare outcomes on the same starting knowledge. Merge the winner.

Sandbox risky multi-step work

Let a DevOps or finance agent attempt the task on a branch first. If assertions fail, discard it with zero impact on the live agent.

Undo a bad batch of memories

An importer or a confused agent wrote garbage? Branch before bulk writes and discard if the result looks wrong.

Sim-to-real without risk

Fork live fleet memory into a simulator run (Isaac Sim, Gazebo), prove a reroute, then merge only validated policies to the physical fleet.

Per-agent scratch space

Give each agent in a swarm its own branch for working notes, then merge the conclusions into shared memory.
FAQ

Branching, in detail.

Does forking duplicate all my memory?

No. Branches are copy-on-write: a fork records a pointer to main, and storage is only consumed for memories the branch adds or changes.

What happens when a merge conflicts?

You choose the strategy. last-write keeps whichever version was written most recently; source-wins lets the branch override main. The merge result lists what was applied, and reflection jobs can flag any contradictions left behind.

Can agents branch on their own?

Yes. Branching is exposed as MCP tools (clawdb_branch_list, clawdb_branch_get, clawdb_branch_trunk, clawdb_branch_fork, clawdb_branch_merge, clawdb_branch_diff, clawdb_branch_discard, clawdb_branch_archive), so an agent can fork before a risky step and merge or discard afterwards.

How does branching help robot fleets?

A simulator can fork live fleet memory, run high-density scenarios against it, and merge only the proven reroutes back. The physical fleet picks them up on its next sync.

Is branching available on the free tier?

Zero-copy branching is included from Starter; merging with strategies and knowledge-graph linking on branches are on Pro. The open-source engine includes branching when self-hosted.

Fork it. Test it. Merge it.