A Rust runtime that journals every step an agent takes, so it survives any crash and replays exactly, nondeterministic model behavior included.
Durable execution made software reliable. But its replay model assumes determinism, and LLM agents are not deterministic. Everyone else caches around that. We modeled it.
How it works
Pragmatic wraps your agent and records what it does. Every LLM call's realized outcome lands in an append-only log, so a crash is no longer a lost run and a replay is no longer a guess.
Each LLM call's realized outcome is recorded to an append-only log as the run proceeds. The journal is the source of truth for what the agent actually did, not a reconstruction after the fact.
Resume exactly where the agent stopped. Recorded outcomes are read back instead of re-sampled, so there are no duplicate model calls, no divergent paths, and no lost work after a failure.
Reproduce the entire run exactly for debugging and audit, nondeterministic LLM behavior included. This is T1, replay soundness: replaying the journal reproduces the original trace, exactly, every time.
In your code
Keep writing agents the way you already do. Wrap the run, route model calls through the Oracle, and Pragmatic journals every realized outcome as the agent executes.
Crash on step nine of a thousand and the agent resumes on step nine, reading every prior call back from the Journal instead of paying for it again. Replay the whole run later and it reproduces exactly, T1, model behavior included.
use pragmatic::{Oracle, Runtime}; // Wrap the run. Every Oracle call is journaled once. #[pragmatic::durable] async fn research(task: Task, llm: &Oracle) -> Report { let plan = llm.call(plan(&task)).await; // journaled let mut out = Vec::new(); for step in plan.steps { out.push(llm.call(probe(step)).await); // journaled } synthesize(out) } // Crash anywhere. Resume exactly, no re-sampling. let report = rt.resume(run_id).await; // Replay the whole run, bit for bit, for audit. let trace = rt.replay(run_id).await; // T1
from pragmatic import Oracle, runtime # Wrap the run. Every Oracle call is journaled once. @pragmatic.durable async def research(task: Task, llm: Oracle) -> Report: plan = await llm.call(plan(task)) # journaled out = [] for step in plan.steps: out.append(await llm.call(probe(step))) # journaled return synthesize(out) # Crash anywhere. Resume exactly, no re-sampling. report = await rt.resume(run_id) # Replay the whole run, bit for bit, for audit. trace = await rt.replay(run_id) # T1
import pragmatic.Oracle; import pragmatic.Runtime; // Wrap the run. Every Oracle call is journaled once. @Pragmatic.Durable CompletableFuture<Report> research(Task task, Oracle llm) { Plan plan = llm.call(plan(task)).join(); // journaled List<Output> out = new ArrayList<>(); for (Step step : plan.getSteps()) { out.add(llm.call(probe(step)).join()); // journaled } return synthesize(out); } // Crash anywhere. Resume exactly, no re-sampling. Report report = rt.resume(runId).join(); // Replay the whole run, bit for bit, for audit. Trace trace = rt.replay(runId).join(); // T1
#include <pragmatic/oracle.hpp> #include <pragmatic/runtime.hpp> // Wrap the run. Every Oracle call is journaled once. PRAGMATIC_DURABLE auto research(Task task, Oracle& llm) -> Task::future<Report> { auto plan = co_await llm.call(plan(task)); // journaled std::vector<Output> out; for (auto& step : plan.steps) { out.push_back(co_await llm.call(probe(step))); // journaled } co_return synthesize(out); } // Crash anywhere. Resume exactly, no re-sampling. auto report = co_await rt.resume(run_id); // Replay the whole run, bit for bit, for audit. auto trace = co_await rt.replay(run_id); // T1
Why Pragmatic
Every durable execution engine handles a nondeterministic call the same way: run it once, cache the output as an opaque activity, and replay that fixed value. It works, but the engine never understands the call. Pragmatic models each LLM call as a first-class probability distribution and proves replay reproduces the run. That model is what a cache cannot give you.
Architecture
Pragmatic is a Rust runtime that runs on the infrastructure you already have: Linux, containers, any cloud. It links into your agent as a library. There is nothing new to provision and no operating system to adopt.
Each LLM call is modeled as a probability distribution, the Oracle. Every realized outcome is written to an append-only Journal. Replay reads outcomes back from the Journal instead of re-sampling the model, which is what makes recovery faithful.
Every effect carries a capability token, and the Journal is a signed, immutable record of the run. You get idempotency, provenance, and a tamper-evident audit trail at the runtime level, without rebuilding any of it yourself.
The Supervisor detects failures, restores agents from their Journals, and drives recovery and replay. It is the control plane that turns a crashed run into a resumed one without re-sampling or lost work.
Use cases
Agents that run for hours or days survive process restarts, deploys, and infrastructure failures, then resume exactly where they stopped. No re-sampling, no half-finished work, no babysitting.
Reproduce the exact run that failed, step by step, including the nondeterministic model behavior that caused it. Stop guessing at heisenbugs you cannot reproduce and replay the real thing.
Every run has a signed, replayable record of what the agent actually did. That reproducibility matters most for regulated and high-stakes teams, and it ships in the box rather than being bolted on later.
When one agent in a system crashes, recover it from its Journal without unwinding the others. Coordinated multi-agent runs stay consistent through partial failure.
Specifications
Deployment
The Pragmatic runtime on your own infrastructure. Your data and Journals never leave your environment.
The runtime, fully managed. Durable journaling, recovery, and a replay console for time-travel debugging, without operating any of it.
For teams that have to prove what their agents did. The signed, replayable record becomes your audit trail.
Research
Pragmatic's guarantees are real because they are proved. Agentical is the probabilistic process calculus underneath the runtime: the reason crash recovery and faithful replay hold even when the model underneath is nondeterministic. This is the engine room, not a separate paper.
The gap
Durable execution is the proven substrate for reliable software: Temporal, Restate, Inngest, and DBOS all build on it. But its replay model assumes code is deterministic, so every engine hacks around LLMs by caching model outputs as opaque activities. Frontier models show only 50 to 96 percent determinism even at temperature 0. Pragmatic is durable execution built for nondeterminism from the ground up, holding three properties together.
Re-run a system from its recorded log and reproduce the same outcome, exactly.
Resume after a failure without re-sampling the model or losing prior work.
Reason about how secret inputs can, and cannot, influence public observations.
The idea
Model each LLM call as a first-class probability distribution, the Oracle, and journal every realized outcome to an append-only log, the Journal. Recovery becomes replay: read back recorded outcomes instead of re-sampling.
Two nondeterminisms are kept cleanly separate: probabilistic (the Oracle) and adversarial scheduling (resolved by a scheduler), the standard probabilistic-automata / MDP-with-schedulers setup.
The calculus
A π-calculus-style process calculus with a probabilistic small-step operational semantics in record and replay modes. A configuration is the 5-tuple <P;H;J;K;t>: agent pool, shared store, journal, channel state, and logical clock.
Three theorems
The flagship result: replaying the recorded journal reproduces the original run's trace exactly, with probability 1, proved via a coupling on the shared oracle-randomness space. Equiprobability follows.
Secret (High) inputs don't affect public (Low) observations, proved as termination-insensitive noninterference, conditional on named assumptions: per-label oracle partitioning and a label-filtered scheduler.
Local per-agent probability contracts compose to a global bound, an assumption-free union bound. The product form holds only under independence, with a Fréchet–Hoeffding fallback otherwise.
Verified / built
lean/AgenticalT1.lean covers T1's operational core (the oracle fragment), trace-equivalence, crash-resume (C1), no-orphaned-effect (L4), and cursor-determinism (L1), all sorry-free. Axioms are propext, plus Quot.sound for L4. Not yet mechanized: channels, the measure-theoretic layer, or T2/T3.
A zero-dependency reference implementation. Six integration tests pass demonstrating T1, C1, and L4. Measured: 1000/1000 replay-determinism; ~230 ns O(1) append latency, flat to 1M entries; and a ~1500× replay speedup under a 1 ms/draw latency-injected oracle, since replay performs zero oracle calls.
The contribution
Agentical brings together probabilistic-operational semantics, multi-agent coordination, and durable replay in a single calculus, backed by a reference implementation.
FAQ
General durable execution treats a model call as an opaque step: run it once, store the output, replay the stored value. That works well, and we build on the same lineage. The difference is that the engine has no model of the call, so there is no probabilistic reasoning and no information-flow guarantee, and replay holds only while the surrounding code stays deterministic. Pragmatic models the call itself and proves the replay guarantee, which is what nondeterministic agents need.
Pragmatic does not re-sample the model on replay. The first run records each realized outcome to the Journal, and replay reads those outcomes back. Reproducing a run reads from the log rather than calling the model again, which is what makes it exact. This is T1, proved by a coupling on the shared oracle-randomness space.
No. Keep your agent logic and route model calls through the Oracle. The runtime links in as a library and journals outcomes as the agent runs. There is no new operating system and no new orchestration language to learn.
Pragmatic is in private beta with design partners. The replay guarantee (T1) is mechanized in Lean 4 and the Rust reference runtime passes its determinism and recovery tests today. The probabilistic and information-flow results (T2, T3) are proved pen-and-paper and not yet mechanized. We are honest about that scope.
With self-hosted, the runtime and your Journals stay entirely in your environment. Pragmatic Cloud manages durable journaling and replay for you. Enterprise adds a signed, immutable audit trail and information-flow guarantees for regulated teams.