← Back to knowledge center

Durable AI agents: state, checkpoints and recovery

An agent that outlives one HTTP request becomes a distributed process. It needs persisted state, idempotent actions, checkpoints and an explicit recovery protocol.

V
Virtek AI and Infrastructure TeamCompute platform architecture

Model the work as a stateful process

Separate accepted, prepared, awaiting data, awaiting approval, executing, validating, completed and stopped states. State contains more than conversation history: goal, constraints, completed actions, artifacts, tool versions and the next permitted transition.

A model request may be retried; an external side effect may not. Email delivery, payment, record mutation or an equipment command needs an idempotency key and separate confirmation of the actual outcome.

Use checkpoints instead of infinite context

After a meaningful stage, save a compact summary, structured facts, links to source evidence and unresolved questions. A checkpoint should let a new session continue without replaying the whole history or losing critical constraints.

Memory and state are different. State belongs to one workflow instance and follows a strict lifecycle. Memory contains reviewed knowledge useful to later runs and changes under separate governance.

Design resumption and compensation

For every step define timeout, retry count, safe retry behaviour, fallback and a compensating action. If an external system returns an ambiguous result, verify the real outcome before resending a command. Do not resume an old run automatically after tools or permissions have changed.

Human waiting is a normal state. Preserve deadline, recipient, a clear decision packet and an escalation route, then revalidate context and authority after the response.

Observe the process from goal to outcome

The trace should connect the run, model steps, tools, checkpoints, human approvals, errors and final artifact. Track active and waiting time, repeated steps, cost, interventions and the proportion of runs recovered without manual reconstruction.

A dependable agent is not one that never fails. It is one whose failures are bounded, visible and recoverable without duplicating effects in real systems.

Need an architecture
for your workload?

We will review inputs, risks and constraints, then propose a reasoned solution.

Talk to an engineer↗︎