Skip to main content
Repeated 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’s finally 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 your EVOLVE_API_KEY.
Keep the quickstart’s try/finally cleanup. After a successful foreground run, the response can contain a checkpoint. Save its ID before destroying the sandbox:
An automatic checkpoint failure does not fail the agent run, so check for the checkpoint before relying on it. Background runs do not create automatic checkpoints. A checkpoint preserves workspace files and supported agent history, not a running process. Dependency and cache directories such as 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. Set checkpointId / checkpoint_id to the saved ID. Replace the first run() call with the following; keep the output retrieval and finally cleanup:
Restore creates a fresh sandbox. Do not combine it with withSession() or Python’s sandbox_id, which attach to an existing sandbox.

Download a past trace

The sessions() client reads recorded sessions without starting a sandbox. This example downloads the first ended session returned by the list:
The printed path points to a local JSONL trace. To list, inspect, or share these records from your terminal, use evolve session.
Last modified on November 9, 2026