Problem
Agent frameworks route prompts and plan tool calls. But when those tools mutate the real world (payments, cloud infrastructure, inventory, email), a failure at step 3 leaves steps 1 and 2 committed. Reserve a flight, book a hotel, charge the card, card fails: the framework reports an error and the customer has a hotel booking they never paid for. None of the popular frameworks address this, because it’s a distributed-systems problem, not a prompting one.
System
Tool calls execute as a Saga: a sequence of forward transactions T1…Tn, each registered with a compensating inverse Ci. On failure at step k, the engine runs C(k−1)…C1 in strict reverse order. An event-sourced write-ahead log records every step’s intent before it runs, so a crash mid-saga can be recovered and compensated on restart rather than left half-done.
Worth knowing
The dual-schema contract. A tool cannot be registered without its compensating inverse, or an explicit pivot=True marking a point of no return. That’s enforced by Pydantic validators at construction time, not discovered mid-incident. The interesting design question is which steps are pivots: sending an email can’t be un-sent, so everything before it must be safe to commit and everything after must be safe to fail.
This sits underneath LangChain, LangGraph, CrewAI or AutoGen rather than replacing them, which is the right layer for a correctness guarantee.