Persistence
Persistent vs Ephemeral
Section titled “Persistent vs Ephemeral”| Feature | Ephemeral | Persistent |
|---|---|---|
| State across calls | ✅ Yes | ✅ Yes |
| Survives gateway restart | ❌ No | ✅ Yes |
| Filesystem snapshots | ❌ No | ✅ Yes |
| Pause/Resume | ❌ No | ✅ Yes |
| Default | ❌ | ✅ |
Creating Persistent Sandboxes
Section titled “Creating Persistent Sandboxes”cell = Cell(persistent=True) # DefaultSnapshots
Section titled “Snapshots”# Create a snapshotsnapshot = cell.pause()print(snapshot.snapshot_id)
# List snapshotssnapshots = cell.snapshots()
# Resume from snapshotcell.resume()Reconnecting
Section titled “Reconnecting”# Save the cell IDcell_id = cell.cell_id
# Later, reconnectcell = Cell.connect(cell_id)result = cell.run("print('I remember everything!')")