WhoBuilt

Two Roads to Durable Agents: Replay vs. Snapshot

May 10, 2026· 17 min· 8.5K views·Watch on YouTube

Speaker

Eric Allam, CEO and co-founder of Trigger.dev, explains how to make production agents durable during an AI Engineer talk.

Why agent backends need durability

Allam says production agents need to do long-running work, survive turns and code versions, and recover from errors. He traces the stateless backend model from CGI and PHP to modern frameworks and serverless, where each request combines input with database state to produce a response.

Replay works for workflows, but strains across sessions

Multi-step side effects need recovery that avoids repeating completed work, such as charging a credit card twice. Durable execution engines address this by wrapping side effects in cached steps, creating a replay journal and audit trail. But replay requires deterministic code outside steps, careful versioning, and can hit size limits as an agent's log grows across a long session.

Separate context from execution state

Allam divides an agent into its context and its execution layer. The context is an append-only record of messages, tool calls, and results that can live in a database, object storage, or distributed file system. The execution layer may include a cloned repository, installed packages, in-memory data, or a running subprocess, which cannot be reconstructed as easily from a log.

Snapshots preserve the machine between turns

Instead of keeping a machine running while an agent waits, snapshot it to disk and restore it when the next user message arrives. Allam describes moving from process checkpointing with CRIU to Firecracker microVMs, which can capture an entire machine. Seekable compression and snapshot layering reduce a 512 MB machine snapshot to about 14 MB; snapshots take slightly under a second and restores a few hundred milliseconds.

Combine logs and snapshots for recovery

A durable agent uses a context log for conversation history and snapshots for execution state. If an LLM needs a delayed retry, the machine can be saved and restored later; if the machine crashes or has a bug, the context log supports recovery. Allam says this points toward stateful compute and describes FC Run as a forthcoming open-source tool for running and snapshotting containers in Firecracker VMs.

Takeaways

  • Use replay journals for bounded workflows with discrete steps and side effects.
  • Treat an agent's conversation context and machine state as separate durability problems.
  • Persist context in an append-only log so it can survive machine failures and code upgrades.
  • Snapshot long-running execution environments between user turns instead of paying to keep them running.
  • Choose recovery based on the failure: retry from a saved machine state or rebuild from the context log.

Mentioned in this talk

Search inside this talk

What was claimed 13

  • founded
    Co-founder
    “I'm Eric, one of the founders of Trigger.dev”
    YouTube
    Verified3 sources· Talk, Web· archived
  • feature
    Trigger.dev: Building infrastructure to deploy agents to production
    “we've been trying to make it easy to deploy these types of agents to production”
    YouTube
    Unverified1 source· Talk
  • feature
    replay model: Caches completed side effect steps so resumed execution skips work already done
    “wrapping every side effect in a step that gets cached as it's executed”
    YouTube
    Unverified1 source· Talk
  • feature
    replay model: Requires steps to be wrapped and code outside steps to be deterministic; journal versioning is tricky
    “you have to wrap everything in steps, and everything outside of steps has to be deterministic”
    YouTube
    Unverified1 source· Talk
  • feature
    replay model: Agent replay logs can grow until they exceed system limits
    “the log grows and grows. At a certain point, you might hit a fundamental limit”
    YouTube
    Unverified1 source· Talk
  • feature
    append-only context log: Preserves agent context across code versions and machine crashes
    “you can upgrade your harness and still use the same context”
    YouTube
    Unverified1 source· Talk
  • uses
    “Last year, we moved to Firecracker microVMs”
    YouTube
    Unverified1 source· Talk
  • feature
    Firecracker: Snapshots and restores the entire machine state
    “This allows us to snapshot the entire machine”
    YouTube
    Unverified1 source· Talk
Show all 13 facts

Related talks