AIStor Memory
Integrations

Daytona

Mount an AIStor Memory Bucket at /workspace in a Daytona linux-vm sandbox, so the agent's work survives sandbox teardown.

A Daytona sandbox is deleted when the agent's run ends. AIStor Memory mounts a Memory Bucket at /workspace, so the files the agent works on and the memory it keeps are stored in your AIStor. The next sandbox mounts the same bucket and starts where the last one stopped.

Use a Daytona linux-vm sandbox. Many Daytona container sandboxes do not have /dev/fuse and cannot create it, so the mount fails there. A linux-vm sandbox has full kernel and device access.

Prerequisites

Use a Memory Bucket

aimem mounts only a Memory Bucket. See Prerequisites.

  • A Daytona API key with the snapshot:create scope. A linux-vm sandbox is created from a snapshot.
  • Python 3 on the machine that runs the example.
  • An AIStor endpoint that Daytona's network can reach, and signing credentials for it. Standard Daytona plans allow outbound HTTPS to public host names.

Quick start

Download the example, then run it from that directory:

mkdir aimem-daytona && cd aimem-daytona
base=https://docs.min.io/aimem/examples/daytona
for f in aimem-mount aimem-setup.sh contract.py usage.py; do
  curl -fsSLO "$base/$f"
done
chmod +x aimem-mount aimem-setup.sh

DAYTONA_API_KEY=... \
AIMEM_BUCKET=my-project \
AIMEM_ENDPOINT=https://aistor.example.com \
AIMEM_ACCESS_KEY=... \
AIMEM_SECRET_KEY=... \
python3 usage.py

If the Daytona Python SDK is not installed, usage.py installs it in ~/.cache/daytona-aimem. The example downloads the released aimem binary, so you do not need to build anything.

When the command returns, the sandbox is still running. The last line on standard error prints the sandbox ID and confirms that /workspace is the AIStor Memory mount. To delete the sandbox when the command ends, set DAYTONA_DELETE_ON_EXIT=1.

What usage.py does

StepAction
SnapshotCreates a linux-vm snapshot from a stock OS image (ubuntu:24.04)
SandboxCreates the sandbox from the snapshot as os_user="root"
InstallUploads and runs aimem-setup.sh, which installs aimem and the aimem-mount wrapper
MountRuns aimem-mount in a Daytona process session, which mounts the bucket at /workspace
Agent commandsRemoves the storage credentials, then runs list, read, and write commands through sandbox.process.exec
Clean upDeletes the snapshot; deletes the sandbox only if DAYTONA_DELETE_ON_EXIT=1

The bucket name, endpoint, and credentials reach the mount through /root/aimem.env, a file only root can read. They never appear on a command line, in env_vars, or in an image layer.

Writes are staged in /tmp/aimem-staging and uploaded to the bucket when the file is closed.

Options

  • AIMEM_MOUNTPOINT sets the mount path. The default is /workspace.
  • AIMEM_LOCAL sets the staging directory. The default is /tmp/aimem-staging.
  • AIMEM_REGION, AIMEM_PREFIX, AIMEM_AGENT, and AIMEM_ALLOW_OTHER=true are passed to aimem-mount.
  • For an offline install, put a Linux aimem binary in bin/ in the example directory. aimem-setup.sh installs it instead of downloading the release.

How FUSE works here

The sandbox runs as root, so aimem opens /dev/fuse and mounts directly, with no setuid helper. If the device node is not there yet, aimem-mount waits for it, and then creates it with mknod, which needs CAP_MKNOD. A sandbox that has neither the device nor CAP_MKNOD cannot mount.

Reference