Durable, replayable execution engine for AI agents.
A durable, replayable execution engine for AI agents, written in Python.
A cuaderna is a rib of a ship's hull: the structure underneath that holds everything else up.
An agent solves a task in many steps: it reads files, calls a model, runs commands, calls the model again. When the process dies halfway, the work and the money spent on it are gone, and nobody can say afterwards what the agent did or why.
Cuaderna is the layer underneath that code. It is not an agent and it is not a framework for writing agents. You keep writing your agent as plain Python and mark the steps that matter. Every step is written to a journal with its result as soon as it finishes, and everything else is built on that journal:
import asyncio import cuaderna @cuaderna.step(max_attempts=3) async def ask_model(prompt: str) -> str: ... # call whichever SDK you use @cuaderna.step def run_tests(repo: str) -> bool: ... # a plain function runs in a thread @cuaderna.run async def fix_tests(repo: str) -> int: rounds = 0 while not await run_tests(repo): await ask_model(f"fix the tests in {repo}") rounds += 1 return rounds async def main() -> None: engine = cuaderna.Engine("cuaderna.db") print(await engine.execute("fix-123", fix_tests, "path/to/repo")) await engine.close() asyncio.run(main()) Kill it while it works and run it again: it continues from the last step it recorded. Run it once more after it finished and it returns the stored result without executing anything.
examples/fix_tests is a complete agent that fixes the failing tests of a small repo. The run page is a static page that shows a recorded run of it: one process killed during its model call, a second one stopped by its budget, and a third one that finished the run, with what each step received, returned and cost.
pip install cuaderna Requires Python 3.12 or newer. The project is in early development: the API can still change between releases.
See CONTRIBUTING.md for setup and the checks to run. Issues and questions are welcome.
Both files in this release have provenance metadata.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




