run() calls on one agent reuse its sandbox and conversation.
Checkpoints save state beyond the sandbox’s lifetime. Session traces record
what happened and remain readable after the sandbox ends.
Start with the SDK quickstart. Run the Python fragments
inside an async function, as in that example.
Continue a conversation
Add another call before the quickstart’sfinally block. Wait for the first
run to finish before starting the next.
getOutputFiles() / get_output_files() reads output files written during
the latest run. Pass true / True to include nested directories.
To keep the files but start a fresh conversation, pass resume: false in
TypeScript or resume=False in Python. kill() destroys the sandbox; read
or save the output before calling it.
Save state
Replace the quickstart’s agent configuration with the following to enable storage. This uses yourEVOLVE_API_KEY.
try/finally cleanup. After a successful foreground
run, the response can contain a checkpoint. Save its ID before destroying
the sandbox:
node_modules/, .venv/, and the workspace’s temp/ are excluded;
reinstall dependencies after restoring when needed.
Restore state
In a new copy of the quickstart, enable storage and keep the same harness and workspace mode. SetcheckpointId / checkpoint_id to the saved ID.
Replace the first run() call with the following; keep the output retrieval
and finally cleanup:
withSession() or
Python’s sandbox_id, which attach to an existing sandbox.
Download a past trace
Thesessions() client reads recorded sessions without starting a sandbox.
This example downloads the first ended session returned by the list:
evolve session.
