Documentation
AgentKit plugin
Upoch for Coinbase AgentKit: every swap, transfer or trade action is checkpointed before and after it runs, and the agent can roll back to the last good state.
What it does
- Automatic checkpoints.
upoch.attach(agentkit)wraps the agent's consequential actions (swaps, transfers, bridges, staking, lending, trades, mints, deploys and approvals). Each one gets a verified checkpoint on Robinhood Chain before it runs and another after, with the transaction hash when the action returns one. The pre-action checkpoint commits before the action runs. - Any framework adapter. The checkpoints are applied to the AgentKit instance itself, so LangChain, the Vercel AI SDK, OpenAI Agents and the MCP adapter all get them without changes.
- Rollback. With
upochActionProvider(), the model can restore its last checkpoint at the start of a task and roll back to the checkpoint right before the last swap or transfer, or to one you name. - Your agent's wallet can be on any network: Upoch uses its own keys and writes checkpoints to Robinhood Chain. Every checkpoint opens in the Time-Travel Debugger.
Setup
Once, in your own terminal (Node.js 24 or later):
npm install -g @upoch/guard
upoch setup # keys, funding, registration
upoch protect # optional: add a guardian, raises your Upoch Scoreupoch setup creates two keys on your machine: the owner, which registers the agent, and the executor, the agent's key, which can only submit checkpoints. It waits while you send the owner a little ETH on Robinhood Chain (0.001 ETH is plenty), then registers the agent and gives the executor gas for checkpoints. Then add Upoch to your AgentKit:
// npm install @upoch/agentkit
import { AgentKit } from "@coinbase/agentkit";
import { UpochWatcher, upochActionProvider } from "@upoch/agentkit";
const upoch = new UpochWatcher();
const agentkit = await AgentKit.from({
walletProvider,
// Optional: let the model restore, checkpoint and roll back itself.
actionProviders: [...yourProviders, upochActionProvider({ watcher: upoch })],
});
// Automatic checkpoints around consequential actions:
upoch.attach(agentkit);
// Then use any AgentKit framework adapter as usual, e.g. getLangChainTools(agentkit).Actions for the model
| Action | |
|---|---|
| upoch_restore | Latest checkpoint, verified against the chain, and which actions completed |
| upoch_checkpoint | Save the current state |
| upoch_rollback | Go back to an earlier checkpoint and continue; by default the one right before the last swap or transfer |
| upoch_history | Recent checkpoints |
| upoch_complete | Mark the task finished |
A rollback restores the agent's state; it cannot reverse transactions that already happened on-chain. The actions list what ran after the restored checkpoint so the agent can account for it.
Options
new UpochWatcher({
watch: ["ERC20ActionProvider_transfer"], // exact action names, or a RegExp (default: value-moving names)
state: () => myAgentState, // what each checkpoint holds (default: the log of watched actions)
strict: true, // stop the action when its pre-action checkpoint fails (default false)
});An action counts as failed when it throws, or when the text it returns starts with "Error" or "Failed", which is how most AgentKit actions report failure. If you don't need the actions for the model, withUpoch(agentkit) is the one-line version.
Safety
- Each checkpoint is one transaction from the executor key, with a daily limit (100 by default,
maxCheckpointsPerDayin ~/.upoch/config.json). - State that looks like private keys, seed phrases or API tokens is refused before anything is stored: checkpoints are permanent.
- Keys stay on your machine in ~/.upoch/secrets.json, unencrypted (owner-only permissions on macOS and Linux). Back it up, and keep only small amounts on these keys.
- The Upoch contracts have not been audited.