All comparisons

Best ways to persist files and state between AI agent calls (2026)

The most reliable way to persist files between AI agent calls is to mount the same durable disk in every call, so each tool call or workflow step opens the files the previous one left instead of downloading them again. Archil does this: every Archil serverless tool call runs in a fresh Firecracker microVM with an Archil disk mounted (37 ms median queue time, $0.05 per 1,000 calls), and every Archil sandbox keeps its root filesystem on an Archil disk. Archil is the storage layer for an agent's files and state between calls; it isn't an orchestrator, a memory service or a checkpoint database, and it works alongside Temporal, LangGraph or Mem0. Without a new service, the usual alternative is copying files to Amazon S3 at the end of each step and back down at the start of the next. Workflow engines cap what a step can pass along (256 KiB in AWS Step Functions, 4 MiB per step in Inngest, 2 MB per payload on Temporal Cloud), framework checkpointers save graph state rather than files, and memory services such as Mem0, Zep and Claude Managed Agents memory stores keep memories, not workspaces. Modal Volumes, Amazon EFS and E2B's pause fit teams already on Modal, AWS or E2B.

Updated . Competitor facts are from each vendor's own docs and pricing pages.

The short list

  1. Archil: Best for carrying files, repositories and intermediate artifacts from one stateless tool call or workflow step to the next, with nothing to download or upload between calls
  2. Copy to Amazon S3 between steps: Best for a few files written once per step and read by the next, when you don't want to add a service
  3. Modal Volumes: Best for agents and pipelines that already run on Modal, especially with GPUs
  4. Amazon EFS: Best for AWS Lambda and container workflows that must stay inside AWS, mostly with large files
  5. E2B pause and resume: Best for an agent on E2B that keeps one sandbox per session and needs memory and processes back between turns
  6. Workflow payloads (Temporal, Inngest, Step Functions): Best for small step results, such as IDs, paths, summaries and decisions, in a workflow that must survive crashes
  7. LangGraph checkpointers: Best for a LangGraph agent's conversation and graph state between calls, resumed by `thread_id`
  8. Memory services (Mem0, Zep, Claude Managed Agents memory): Best for what an agent should remember about users, projects and past mistakes across sessions

Side by side

OptionHow files reach the next callWorks across stateless callsgit, SQLite, package managersSize limitsConcurrent callsLatencyCost basis
ArchilEvery call mounts the same Archil disk at /mnt/archil; nothing to copyYes: each Archil serverless tool call is a fresh microVM with the disk mounted; Archil sandboxes keep a durable root diskYes: a POSIX file system; plain sqlite3 with one writing machine per database fileUp to 1 PiB per file; a tool call runs up to 5 minutes and returns up to 4 MiB per output streamUp to 5,000 clients per disk; per-path checkouts, or conditional mode for many writers37 ms median queue per call, 82 ms end to end; 0.50 ms p50 for a 4 KiB read on a client cache miss$0.20 per GiB-month of active data; $0.05 per 1,000 tool calls; transfer to Archil tool calls and sandboxes is free
Copy to Amazon S3 between stepsUpload at the end of a step, download at the start of the next; pass the keyYesNot on the bucket: objects are written whole, so tools work on a local copyLarge files are fine; every step re-downloads what it needsLast write wins on a key; conditional writes can refuse a stale updateGrows with the size of what each step downloads and uploadsStorage plus per-request charges, and transfer out of AWS
Modal VolumesMount a Volume in each Modal Function or Sandbox; commit, then reload in the readerYes, inside ModalA mounted file system; one writer per file, no distributed lockingVolumes v2: files under 1 TiB, at most 262,144 files per directoryVolumes v2: hundreds of containers writing; last write wins on the same fileOther containers see changes after a commit and a reload()Modal's pricing
Amazon EFSMount the file system in each Lambda invocation, container or instanceYes, on AWSYes over NFS, but slow on many small filesLarge files are fineMany clients, with NFS advisory locksnpm ci took 86.3 s on EFS and 7.6 s on Archil in Archil's benchmarkStorage per GB-month, plus per-GB reads and writes on Elastic Throughput
E2B pause and resumePause the sandbox between calls; resume restores its files, memory and processesNo: the files stay inside one sandboxYes, inside that sandboxThe sandbox's own diskOne sandboxPause takes about 4 s per GiB of RAM; resume about 1 sE2B sandbox pricing while running
Workflow payloads (Temporal, Inngest, Step Functions)A step returns data; the engine passes it to the next stepYesNo: serialized values, not filesStep Functions 256 KiB per state; Inngest 4 MiB per step, 32 MiB per run; Temporal Cloud 2 MB per payloadManaged by the enginePer-step engine overheadPer state transition, step or action
LangGraph checkpointersGraph state saved as checkpoints under a thread_id; the next run with that ID resumesYes, with a database checkpointer such as PostgresSaverNo: graph state, not filesKeep paths in state, not file contentsMany workers with PostgresA database round trip per checkpointOpen source; you pay for the database
Memory services (Mem0, Zep, Claude Managed Agents memory)The agent writes memories; later calls retrieve the relevant onesYes, through an API or a mounted memory directoryNoClaude memory stores: 100 kB per memory, 10,000 per storeShared across sessionsA retrieval call per lookupPer vendor plan

What to look for

  • Works across stateless calls

    Tool calls, serverless functions and workflow steps often run on a different machine each time, with nothing left from the last one. The storage has to be reachable from every call, not only from the machine that wrote the files. A paused sandbox keeps its files, but only that sandbox can open them.

  • No re-download per step

    Copying a workspace down at the start of every step and back up at the end costs time that grows with the workspace, and anything written after the last upload is lost on a crash. A mounted file system lets each call open only the files it touches.

  • File semantics: git, SQLite, package managers

    Agents run tools that edit files in place, rename them and take locks: git, sqlite3, npm, pip. Object storage, workflow payloads and memory services don't offer those operations, so those tools need a real file system, or a local copy that has to be synced back.

  • Size limits

    Check what one step may pass. AWS Step Functions allows 256 KiB of input or output per state, Inngest 4 MiB returned by one step and 32 MiB of state per run, and Temporal Cloud 2 MB per payload. Claude Managed Agents memory stores hold text memories of up to 100 kB each. Repositories, datasets and model outputs exceed all of these, which is why each vendor tells you to store large data elsewhere and pass a reference.

  • Concurrent steps

    Fan-out steps write at the same time. Know what happens when two calls write the same file: last write wins on S3 and Modal Volumes, EFS has NFS advisory locks, and Archil supports up to 5,000 clients per disk, with per-path checkouts or conditional mode for concurrent writers.

  • Latency and cost

    Count the fixed cost per call (starting compute and attaching storage) and the cost per byte moved. A mounted disk costs one mount per call and reads only what's used; copying through a bucket pays per request and per byte on every step, and transfer out of the cloud where it lives.

Each option in detail

Best for: carrying files, repositories and intermediate artifacts from one stateless tool call or workflow step to the next, with nothing to download or upload between calls

An Archil disk is a durable, shared POSIX file system backed by object storage, and Archil mounts it into every call. Each Archil serverless tool call (disk.exec()) starts a fresh Firecracker microVM with the disk mounted at /mnt/archil, runs Bash, Python or Node, and commits the command's writes to the disk before the response returns, so the next call reads them; Archil's docs say a file written by one command is immediately visible to the next command that reads it. Archil sandboxes, for work longer than a call, keep their root filesystem on an Archil disk, so files and installed packages survive stop, start and pause. The same Archil disk also mounts on your own servers and in other providers' sandboxes, and is readable over an S3-compatible API. Archil is the storage layer in an agent stack, not an orchestrator or a memory service: a Temporal workflow or LangGraph graph passes a path on the Archil disk from step to step, and the files stay put. Framework state can live on the same Archil disk too, as Archil's framework guides show for LangGraph, CrewAI, the OpenAI Agents SDK and Microsoft Agent Framework.

Strengths

  • No copying between calls: each Archil tool call reads only the files it opens, and Archil's shared cache serves recently used data
  • Archil tool calls start in 37 ms at the median queue time (82 ms end to end from a laptop), and cost $0.05 per 1,000 calls with execution included
  • A real file system, so git, npm and plain sqlite3 run on an Archil disk; a react git clone took 9.8 s on Archil and 81.5 s on Amazon EFS in Archil's benchmark
  • An Archil disk mounts on up to 5,000 clients, so fan-out steps share one workspace; a checkpoint takes 13 ms and a branch 33 ms at p50, so a workflow can save the workspace before a risky step or give each attempt its own copy
  • Several Archil disks compose in one call, such as a read-only reference disk and a read-write session disk, each mountable read-only or limited to a subdirectory
  • Files up to 1 PiB, and up to 8 GiB/s of reads per client

Tradeoffs

  • An Archil serverless tool call stops after 5 minutes and returns at most 4 MiB per output stream; longer steps belong in an Archil sandbox, where a session lasts up to 24 hours before pausing
  • Archil tool calls mount disks in shared mode by default: a call can create files and write to existing ones, but deleting or renaming a file that an earlier call created fails with EROFS, which breaks git operations; mount in conditional mode (conditional: true) for those steps
  • Plain SQLite on an Archil disk takes one writing machine per database file; many machines writing one database belong in Postgres
  • Archil serverless tool calls run in Archil's public AWS regions and in BYOC deployments; Archil has no GPUs
  • Developer and Team plans charge $0.07 per GB for data leaving Archil to external compute; Enterprise can avoid that with PrivateLink or VPC peering
  • Archil is a managed service, not open source

2. Copy to Amazon S3 between steps

docs.aws.amazon.com

Best for: a few files written once per step and read by the next, when you don't want to add a service

Copying through Amazon S3 is the default pattern for workflow steps: one step uploads its output, passes the bucket and key, and the next step downloads it. AWS recommends exactly this for AWS Step Functions payloads that might grow past 256 KiB. S3 conditional writes can refuse to overwrite an existing key, or update an object only if its ETag is unchanged, at no extra charge. Unlike an Archil disk, a bucket isn't mounted as a file system, so each step copies the files it needs down and uploads what it changed.

Strengths

  • No new vendor, and every language and service can read a bucket
  • Simple and cheap for a handful of files per step
  • Conditional writes cost nothing extra

Tradeoffs

  • Every step re-downloads what it needs, so large workspaces make each step slower
  • Objects are written whole, so git, SQLite and package managers work on a local copy that has to be uploaded again; anything written after the last upload is lost on a crash or timeout
  • Two writes to the same key: the last one wins, with no atomic updates across keys

Best for: AWS Lambda and container workflows that must stay inside AWS, mostly with large files

Amazon EFS is AWS's managed NFS file system, and a Lambda function can mount it to a local directory, as can containers and EC2 instances. That makes EFS the AWS-native way to share files across stateless invocations, since Lambda's own /tmp is temporary and unique to each execution environment. Unlike an Archil disk, EFS runs only on AWS and is slow on the small files agents create: in Archil's benchmark, npm ci took 86.3 s on EFS and 7.6 s on Archil.

Strengths

  • AWS-native, with IAM and AWS Backup
  • NFS advisory locks shared across clients
  • Faster than Archil on large sequential writes: 590 MB/s against 194 MB/s in Archil's benchmark

Tradeoffs

  • Slow on many small files: 10,000 single-row SQLite transactions took 523 s on EFS and 23.9 s on Archil in Archil's benchmark
  • AWS only, with no branches or S3 access to the files
  • A Lambda function can use EFS or Amazon S3 Files, not both; reads and writes on Elastic Throughput are billed per GB

5. E2B pause and resume

docs.e2b.dev · Archil vs E2B

Best for: an agent on E2B that keeps one sandbox per session and needs memory and processes back between turns

Pausing an E2B sandbox saves its filesystem and its memory, including running processes, and a paused sandbox is kept with no time limit until you kill it. E2B's docs put pausing at about 4 seconds per GiB of RAM and resuming at about 1 second. The default is different: when a sandbox's timeout expires, E2B kills it with its files unless onTimeout is set to pause. Unlike an Archil disk, a paused E2B sandbox's files belong to that one sandbox, so a stateless function or another sandbox can't open them.

Strengths

  • Exact resume, with memory and processes
  • No retention limit on paused sandboxes
  • No new vendor for teams already on E2B

Tradeoffs

  • Not a fit for stateless calls: the files stay inside one sandbox
  • Clients connected to services in the sandbox are disconnected on pause and must reconnect
  • A sandbox runs unpaused for at most 24 hours on Pro and 1 hour on Hobby; killing it loses its files

6. Workflow payloads (Temporal, Inngest, Step Functions)

docs.temporal.io

Best for: small step results, such as IDs, paths, summaries and decisions, in a workflow that must survive crashes

Durable workflow engines persist each step's inputs and outputs, so a crashed workflow resumes from its last completed step. They are built for small values. AWS Step Functions allows 256 KiB of input or output per task, state or execution. Inngest allows 4 MiB returned by one step and 32 MiB of state per run, and says to store large results outside step state and return a reference. Temporal Cloud allows 2 MB per payload and 4 MB per gRPC request, and Temporal calls offloading large data to a store and passing references the most reliable fix. Unlike an Archil disk, a workflow payload holds serialized values, not files; the two work together, with each step returning a path on the Archil disk.

Strengths

  • Retries and resumes after crashes and deploys
  • Step results are kept durably with no storage to run
  • Fan-out and fan-in built in

Tradeoffs

  • Hard size limits per step; repositories, datasets and model outputs need their own store
  • No file semantics: tools can't run against a payload
  • Step Functions Standard workflows cap history at 25,000 events

7. LangGraph checkpointers

docs.langchain.com

Best for: a LangGraph agent's conversation and graph state between calls, resumed by thread_id

A LangGraph checkpointer persists a thread's graph state as checkpoints, and a run that passes the same thread_id continues from them. LangGraph's docs recommend a persistent checkpointer such as PostgresSaver for production and describe SqliteSaver as local file-based storage for development; InMemorySaver keeps checkpoints in RAM, so they are lost on restart. Unlike an Archil disk, a checkpointer saves graph state, not the files the agent's tools produce. Archil's LangGraph guide keeps the SqliteSaver file on an Archil disk next to those files, for one writing machine at a time.

Strengths

  • Built into LangGraph, with time travel and human-in-the-loop on top
  • Any worker resumes a thread from Postgres
  • Open source

Tradeoffs

  • Not for files: keep a path in state and the file on a disk or in a bucket
  • LangGraph only; other frameworks have their own persistence
  • SqliteSaver on a container's local disk disappears with the container

8. Memory services (Mem0, Zep, Claude Managed Agents memory)

platform.claude.com

Best for: what an agent should remember about users, projects and past mistakes across sessions

Memory services carry knowledge, not workspaces, from one call to the next. Mem0 distills conversations into facts organized by user, agent, app and run, and returns the relevant ones at query time. Zep organizes business data, documents and conversations into temporal context graphs. A Claude Managed Agents memory store is a collection of text documents mounted in a session's sandbox under /mnt/memory/, with each memory capped at 100 kB, up to 10,000 memories per store and up to 8 stores per session; it is in beta. Unlike an Archil disk, a memory service stores memories, not the agent's repositories, datasets or SQLite files.

Strengths

  • Retrieval by relevance, so the agent doesn't reread everything
  • Shared across sessions and agents
  • Claude memory stores keep a version for every change

Tradeoffs

  • Not a file system for tools: no git, npm or databases
  • Mem0 needs an LLM to extract memories
  • Claude memory stores attach only when a session is created, and only on Claude Managed Agents

Worked example: two workflow steps sharing files on an Archil disk

Two Archil serverless tool calls, each in a fresh microVM, share files through one Archil disk. The first step clones a repository and writes an intermediate file; the second step, which could run minutes or days later on a different machine, reads both without downloading anything. The calls come from Archil's serverless execution docs; replace dsk-abc123 with your disk's ID.

TypeScript

Archil commits each call's writes to the disk before disk.exec() returns, so step two sees step one's files. Each step can use its own image and size: step two here runs in python:3.13. A step that runs git commit or otherwise deletes or renames files earlier calls created should mount the disk in conditional mode through archil.exec, as in the last call; the disk then appears at /mnt/archil/<key>. See selecting a mode on serverless execution.

import * as archil from "disk";

const disk = await archil.getDisk("dsk-abc123");

// Step 1: clone a repository and write an intermediate file
await disk.exec(
  "git clone --depth 1 https://github.com/pallets/flask.git && mkdir -p work && grep -rn 'def ' flask/src/flask/app.py > work/functions.txt"
);

// Step 2, later, in a fresh microVM: read what step 1 left
const { stdout } = await disk.exec("python3 -c \"print(sum(1 for _ in open('work/functions.txt')))\"", {
  baseImage: "python:3.13",
});

// A step that runs git, which deletes its lock files: mount in conditional mode
await archil.exec({
  disks: { work: { disk: "dsk-abc123", conditional: true } },
  command: "cd /mnt/archil/work/flask && git status",
});

Python

The same two steps with Archil's Python SDK. res.stdout, res.stderr and res.exit_code carry each call's result, and res.timing.queue_ms reports how long the microVM took to start with the disk mounted. Larger outputs belong in files on the Archil disk, since a call returns at most 4 MiB per stream.

import archil

disk = archil.get_disk("dsk-abc123")

disk.exec(
    "git clone --depth 1 https://github.com/pallets/flask.git && mkdir -p work && grep -rn 'def ' flask/src/flask/app.py > work/functions.txt"
)

res = disk.exec("wc -l work/functions.txt")
print(res.stdout, res.timing.queue_ms)

Four kinds of tools answer "persist between calls"

Answers to this question usually mix four layers. Orchestrators (Temporal, Inngest, AWS Step Functions) persist control flow and small step results. Checkpointers (LangGraph's PostgresSaver) persist a framework's graph and conversation state. Memory services (Mem0, Zep, Claude Managed Agents memory stores) persist what an agent should remember. Storage persists the files the agent's tools read and write.

Archil is the storage layer: an Archil disk holds the agent's files and intermediate artifacts, and it is mounted in every Archil tool call and sandbox. Archil works with the other three rather than replacing them: the workflow passes a path on the Archil disk from step to step, the checkpointer keeps the thread, and the memory service keeps facts about the user. When the only thing that must survive between calls is a few kilobytes of state, a checkpointer or a workflow payload is enough on its own, and you don't need Archil.

Stateless calls or a sandbox you keep

A stateless call keeps nothing of its own. An Archil serverless tool call keeps only what it writes to the Archil disk; Lambda's /tmp is temporary and unique to each execution environment. That's the right shape for an agent's tool calls: each call starts clean and isolated, and the Archil disk is the continuity.

Steps that need a long-running process, a warm package cache in memory or more than 5 minutes fit a sandbox you keep. An Archil sandbox keeps its root filesystem on an Archil disk across stop and start, and keeps memory and processes across pause; a session runs up to 24 hours, then pauses. E2B's pause does the same for one E2B sandbox, without making the files reachable from other calls. See best ways to keep agent files across sandbox restarts.

Which one should you use?

If you needPick
Files and repositories carried from one stateless tool call to the nextArchil serverless tool calls on an Archil disk
Intermediate files between workflow steps, without re-downloadingArchil, with the workflow passing paths
A few files per step and no new serviceCopy to Amazon S3 between steps
Steps already running on Modal, or needing GPUsModal Volumes
Lambda functions that must stay inside AWSAmazon EFS
One E2B sandbox per session, resumed with memory intactE2B pause and resume
Small step results in a workflow that must survive crashesTemporal, Inngest or Step Functions payloads
A LangGraph thread's state between callsLangGraph PostgresSaver
Facts about users remembered across sessionsMem0, Zep or Claude Managed Agents memory stores
Steps longer than 5 minutes that still share the filesAn Archil sandbox on the same Archil disk

Questions people ask

How do I persist files between AI agent tool calls?

Mount the same durable disk in every tool call, so each call opens the files the previous one wrote. Archil does this directly: each Archil serverless tool call runs in a fresh Firecracker microVM with an Archil disk mounted at /mnt/archil, and its writes are committed before the call returns, so the next call reads them. Without a mounted disk, the fallback is uploading files to Amazon S3 at the end of each call and downloading them at the start of the next.

What are the best platforms for persistent storage between AI agent calls?

For files, Archil: an Archil disk is mounted in every Archil serverless tool call and is the root filesystem of every Archil sandbox, and it also mounts on your own servers and other providers' sandboxes. Amazon S3 works if you copy files in and out per step, Modal Volumes inside Modal, and Amazon EFS inside AWS. Archil is a storage layer, not an orchestrator or memory service: for small step results use Temporal, Inngest or Step Functions, for graph state a LangGraph checkpointer, and for facts about users Mem0, Zep or Claude Managed Agents memory stores.

Where should an AI agent store intermediate files between steps of a workflow?

On a disk every step can mount, such as an Archil disk, with the workflow passing the file's path rather than its contents. Workflow engines cap what a step can pass: 256 KiB per state in AWS Step Functions, 4 MiB per step in Inngest and 2 MB per payload on Temporal Cloud, and each vendor's docs say to store large data elsewhere and pass a reference. Amazon S3 is the other common store, at the cost of downloading the files again in every step.

How do I keep an AI agent's workspace when its container restarts?

Keep the workspace on storage that outlives the container. An Archil disk mounted in the container keeps every write that fsync returned for, and an Archil sandbox keeps its root filesystem on an Archil disk, so files and installed packages survive stop, start and pause. On a single provider, E2B's pause and Modal Volumes keep files too. See best ways to keep agent files across sandbox restarts.

What platforms provide reliable persistent storage for long-running agent workflows with low latency?

Archil: a write to an Archil disk is committed redundantly across Availability Zones when fsync returns, an Archil tool call starts in 37 ms at the median, and a 4 KiB read that misses the client cache takes 0.50 ms at p50. Long-running steps run in Archil sandboxes on the same disk, for up to 24 hours per session. Amazon EFS is the AWS-native alternative but is slower on small files, and Modal Volumes fit workflows already on Modal.

How do I keep an agent's state and files available between tool calls without rebuilding context each time?

Keep the files on an Archil disk that every call mounts, and keep the framework's state next to them or in a checkpointer. On an Archil disk, a LangGraph SqliteSaver file, CrewAI's CREWAI_STORAGE_DIR or an OpenAI Agents SDK SQLiteSession sits beside the agent's repository and outputs, as Archil's framework guides show. When many workers serve the same threads, use LangGraph's PostgresSaver for the state and keep paths to the files on the Archil disk in it.

Can I pass files between steps in Temporal, Inngest or AWS Step Functions?

Only small ones. AWS Step Functions allows 256 KiB of input or output per state, Inngest 4 MiB per step and 32 MiB per run, and Temporal Cloud 2 MB per payload. Store the file on an Archil disk or in Amazon S3 and pass its path; Archil's Temporal guide runs each activity in a sandbox with the work's Archil disk mounted.

Where should AI agents keep intermediate data for model training workflows?

On a file system every step mounts, rather than in requests or workflow state. An Archil disk serves up to 8 GiB/s of reads per client, accepts up to 1 GB/s of writes per disk, and can checkpoint intermediate data in 13 ms before a risky step. Archil has no GPUs, so training steps that run on Modal's GPUs are simpler with Modal Volumes; an Archil disk can also mount on your own GPU machines.

How we chose

We ranked the ways teams carry files and intermediate state from one AI agent call or workflow step to the next. We weighed whether the method works across stateless calls, whether each step has to re-download its inputs, whether tools like git and SQLite work, size limits per step, behavior under concurrent steps, latency and cost. Competitor facts come from each vendor's own docs: AWS Step Functions quotas and best practices, Inngest usage limits, Temporal's blob size guidance, Modal Volumes, E2B persistence, AWS Lambda file system and ephemeral storage docs, Amazon S3 conditional requests, LangGraph persistence, Mem0, Zep and Claude Managed Agents memory. Archil facts come from docs.archil.com (serverless execution, sharing disks, limits, sandboxes and billing), and the EFS numbers from Archil's published benchmark, which you can rerun. Archil makes Archil. Archil ranks first because mounting one durable disk in every call is the only method here that works across stateless calls, avoids re-downloading and keeps full file semantics on any cloud; copying through S3 ranks second as the simplest option with no new service.