Open source · Python · Apache-2.0

Stop AI agents from repeating actions after a crash, retry or resume

Call4Agents is a small Python library for agents that send emails, take payments or change data. It sits on top of LangGraph, Pydantic AI, the OpenAI Agents SDK, MCP servers or plain Python. Each action runs once even if the agent crashes, retries or resumes; a human "yes" covers only the exact action that was shown; and you can undo a run. Standard library only.

pip install call4agents
call4agents quickstart   # offline, no API keys: 2 emails without the kit, 1 with it

See it in 30 seconds

Real output of call4agents quickstart: an agent crashes right after sending an email, then resumes.

call4agents quickstart: without the kit 2 emails, with it 1 An agent crashes right after sending an email, then resumes (real output, fake models, no API keys) $ pip install call4agents && call4agents quickstart Plain Python - crash right after an email is sent, then resume: without the run record emails sent: 2 with the run record (crash after the tool) emails sent: 1 with the run record (crash inside the tool) emails sent: 1 (refused to resend: in doubt) "yes" to pay(10, alice), call changed to pay(9999, mallory): REFUSED; approved call: PAID; payments: 1 Frameworks found: LangGraph, Pydantic AI, OpenAI Agents SDK LangGraph crash after the email, resume: without call4agents 2 emails, with call4agents 1 Pydantic AI crash after the email, resume: without call4agents 2 emails, with call4agents 1 OpenAI Agents SDK crash after the email, resume: without call4agents 2 emails, with call4agents 1 OK in 40.8 s.

What it does

Guides

Honest limits

Version 0.5, early. Not yet proven with real payment systems in production. Several machines can share one run record in PostgreSQL; that is tested with separate processes and one local server, not yet on real networks. Every number on this site can be reproduced from the repository.