Back to blog
Abhishek·May 29, 2026·4 min read

InstaVM Volumes: durable memory for long-running agents

AI AgentsAgent MemoryVolumesInstaVMLong-Running AgentsPython SDK

Today we're introducing Volumes: durable storage you can attach to any InstaVM sandbox. A Volume gives an agent a memory that outlives the VM it runs in. A long-running agent can stop, restart on a fresh sandbox, and resume exactly where it left off, and the same Volume scales from a handful of notes to terabytes of data.

Agents are stateful. Sandboxes are not.

Every InstaVM agent runs its tool calls (shell commands, file edits, code) inside a sandbox microVM. That microVM is ephemeral by design: it is created for a session and torn down when the session ends, goes idle, or crashes. Disposable sandboxes are what make it safe to run untrusted, agent-generated code.

The agent is long-running. Over a task it builds up a working set: a scratchpad of notes, retrieved documents, a vector index, intermediate artifacts, downloaded model weights. When the sandbox goes away, that state goes with it, and the next run starts from nothing. Until now, keeping any of it meant copying data out to your own storage and threading it back in by hand.

What Volumes do

A Volume is durable storage you mount into a sandbox at a path. The agent reads and writes it like any directory, and the data stays after the VM is gone. Mount the same Volume into the next sandbox (a different machine, minutes or weeks later) and the agent's memory is already there.

Volumes are backed by object storage, so a single Volume scales to whatever the agent needs: a few kilobytes of notes or terabytes of datasets and weights, with no disk to resize. You can also checkpoint a Volume before a risky change and roll back if an agent corrupts its state.

Built for agentic work

  • Memory that survives a restart. Keep an agent's working set (scratchpad, retrieved context, a vector index) on a Volume so it accumulates across runs instead of resetting every session.
  • Stop and resume long-running agents. Tear the sandbox down between turns or when an agent goes idle, so you stop paying for compute, then resume later by re-mounting the same Volume.
  • Hand off work across a pipeline. Run a series of agents or sandboxes against one Volume, where each stage reads the previous stage's output as its input (scrape, transform, then evaluate) without routing data back through your application.
  • Shared state across many agents. Mount a Volume read-write into one sandbox and read-only into many others, so a fleet of agents can work against the same dataset or index in parallel.
  • Warm caches for faster cold starts. Download model weights, package and Hugging Face caches, or a large repo once, then reuse them on every run instead of refetching gigabytes each session.
  • Datasets and checkpoints for research. Pin a dataset and periodic checkpoints on a Volume so long training or evaluation jobs resume after a restart, and benchmark runs stay reproducible.

Using Volumes

The whole flow is a few SDK calls. Here a Volume serves as an agent's memory across two completely separate sandboxes:

from instavm import InstaVM

client = InstaVM(api_key="...")

# A Volume is the agent's durable memory.
memory = client.volumes.create(name="agent-memory", quota_bytes=50 * 1024**3)  # 50 GiB

# Mount it into a sandbox; the agent reads and writes /memory like any folder.
vm = client.vms.create(wait=True)
client.vms.mount_volume(
    vm_id=vm["vm_id"], volume_id=memory["id"], mount_path="/memory", wait=True,
)

# ... the agent runs, saving notes and artifacts to /memory ...

# Tear the sandbox down. The data on the Volume stays.
client.vms.delete(vm["vm_id"])

# Later, a brand-new sandbox picks up the same memory in one call.
vm2 = client.vms.create(wait=True)
client.vms.mount_volume(
    vm_id=vm2["vm_id"], volume_id=memory["id"], mount_path="/memory", wait=True,
)

You can also seed a Volume from your own machine before any sandbox exists, so an agent starts with its data already in place.

Available today

Volumes are available now to every InstaVM account, through the Python SDK and CLI.

pip install instavm

Grab an API key from the InstaVM Dashboard and create your first Volume. Volumes are durable file storage, not a managed database. For production Postgres or MySQL, run a managed database and reach it from your sandbox over the network.

To go deeper:

Get free execution credits

Run your AI agents in secure, isolated microVMs. $50 in free credits to start.

Get started free
We use cookies to improve your experience. See our cookie policy.