Skip to content
AgentTx
Open sourceRust · gRPC · RocksDB · 8804bc7 add:vscodeextension

Transactions for AI agents.

AgentTx wraps every tool call in an ACID transaction. When a step fails, it finds the step that really caused it, rewinds state in milliseconds, undoes side effects and hands your agent a one-line fix.

$cargo run --release -p agenttx-protocol
tx 7f3a · billing-agent · 8 steps
Running

The problem

Agents fail in ways retries can’t fix.

Tool-using agents change real systems. Without transactions, every failure leaves a mess — and a bigger prompt.

Silent root causes

Step 3 stores the wrong id. Step 9 fails on a foreign key. Retrying step 9 forever never fixes step 3.

retry(step 9) × ∞

Poisoned context

Every failure pastes kilobytes of stack trace into the prompt, until the model reasons about noise.

at org.postgresql.core.v3…

Half-done side effects

Restarting from scratch re-sends emails, leaves draft files behind and trips over rows it already wrote.

email sent ×3

How it works

One failed step. Four deterministic moves.

Everything below runs inside the proxy in microseconds to milliseconds, before your agent sees a response.

  1. 01

    Clean the error

    A compiled RegexSet turns any stack trace into one actionable line. No LLM call.

    PSQLException: ERROR: insert or update…
    Hint: Foreign key failed for 'customer_id'
  2. 02

    Trace the root cause

    A dependency graph links step outputs to later inputs and walks the key back to its producer.

    step 6 · customer_id
    ← step 2 · session.value
  3. 03

    Rewind everything

    Undo-journal snapshots restore state atomically, Saga actions undo files and APIs, staged emails are dropped.

    restore_snapshot(@2)
    undo draft.json · drop 1 email
  4. 04

    Resume, bounded

    The agent resumes at the right step with the hint as a constraint. A replay budget guarantees termination.

    ROLLBACK_TRIGGERED
    next_step_id = 2

Benchmarks

Before and after, measured.

Same scripted agent, same tools, with and without AgentTx. Every number below comes from the committed benchmark run — reproducible with one command.

All benchmarks
Tool calls to recover · 32-step task
4917% fewer
vs 59 without AgentTx
Error tokens added to the prompt
2797% fewer
vs 1,029 raw stack-trace tokens
Side effects left wrong · all scenarios
0none left
vs 148 duplicate, leaked or orphaned
Snapshot restore · 10K writes
62.5 ms
p50 · engine step overhead 52.5 µs

Tool calls until the task succeeds — silent root cause

A wrong value from an early step fails a later step. Across all sizes: 222 calls without AgentTx, 184 with it.

  • Without AgentTx
  • With AgentTx

AMD Ryzen 5 5600H with Radeon Graphics · 12 cores · release build · Sep 15, 2026, 05:16 PM UTC

Features

Production primitives, not a prompt trick.

The guarantees come from the storage engine and the protocol, so they hold no matter which model or framework drives the agent.

Integration

A dozen lines in the loop you already have.

Send tool calls through ExecuteStep, always resume at next_step_id, and put the returned constraints in your prompt. Works from any language with gRPC.

Python
r = client.ExecuteStep(pb.ExecuteStepRequest(
    transaction_id=tx, step_id=next_step,
    tool_name=call.tool, arguments_json=json.dumps(call.args),
))

if r.status == pb.STEP_STATUS_ROLLBACK_TRIGGERED:
    agent.rewind(r.rollback_to_step, reset_context=r.context_reset)
    system_prompt.constraints = list(r.constraints)   # one-line Clean Hints

next_step = r.next_step_id

Architecture

A single Rust process between your agent and its tools.

Run it as a gRPC proxy next to any framework, or embed the engine as a library. State lives in embedded RocksDB; per-transaction mutexes keep steps ordered while transactions run in parallel. Read the architecture guide.

Open source

Built in the open, on GitHub.

The docs you are reading, the benchmark results and these numbers are loaded straight from the repository and refreshed on every push.

Stars
1
Forks
0
Open issues
1
Contributors
1
  • Rust 53.9%
  • TypeScript 41.7%
  • CSS 1.7%
  • Other 2.6%
harshal050
8804bc7add:vscodeextension

Give your agents a safety net.

Five minutes to your first rollback. Apache-2.0, self-hosted, no telemetry.