portable • AI Agent SDK

Move a durable run between processes.

portable

AI Agent

Move a durable run between processes.

Durable execution is real and thorough — `agent/durable.py` replays a run from a journal — but the journal is a local SQLite file, so a run could only resume where it started. Pausing on a web worker, putting the state in a queue and resuming it somewhere that shares no disk was not possible.

This exports a run’s journal (its metadata and every event) as a plain dict, and imports it into another journal:

blob = export_run(journal, run_id) # -> JSON-safe dict redis.set(key, export_run_json(journal, run_id))

# elsewhere, no shared disk run_id = import_run(other_journal, blob) # resume as usual: the replay index is rebuilt from these events

Deliberately a JOURNAL export rather than a new state format: the journal is already the single source of truth that `DurableRunContext` replays from, so a second representation would be a second thing to keep correct.

Import

python
from praisonaiagents.runtime import portable

Classes

Functions

Constants

NameValue
PORTABLE_RUN_VERSION1