Replaysafe tackles duplicate actions from AI agent retries
A developer said AI agents can crash mid-task and then repeat the same charge, email, or CRM entry when retried. They open-sourced Replaysafe, a library that wraps non-idempotent calls and uses a fingerprint to check whether the same operation already ran. If it has, the library returns the cached result instead of running the action again. A related post described using a per-session retry budget to stop one flaky tool from causing hundreds of repeated calls and a larger bill.
Key points
- AI agents can repeat the same real-world action after a crash and retry.
- Replaysafe creates a fingerprint from the operation type, target, and input.
- If the same operation was already completed, it returns the cached result instead of running it again.
- The library says it works with LangGraph, CrewAI, Inngest, n8n, and Airflow.
- A per-session retry budget can help prevent runaway agent bills from repeated tool calls.
Quick term guide
- open-sourced
- The code has been made public so others can inspect, use, or contribute to it.
- open-source
- Software whose code is shared publicly so others can inspect, use, or change it.
- non-idempotent calls
- Actions that can cause a new effect each time they run, such as charging a card twice.
- fingerprint
- A compact marker used to tell whether two operations are the same.
- cached result
- A saved answer from an earlier run that can be reused instead of repeating the work.
- retry budget
- A fixed limit on how many retries a session is allowed to make.
- tool calls
- Times when an AI system uses another function, such as search or file access.
- open source
- Software whose code is available for people to view and often modify.