Skip to content

RunRecord

A RunRecord bundles one execution into a single JSON-serialisable object: the chain snapshot, the input, the full result and the timing. MAESTRO’s maestro replay command reads such files back (see generate & run).

from datetime import datetime, timezone
from mmar_carl import RunRecord
started = datetime.now(timezone.utc)
result = await chain.execute_async(context)
record = RunRecord.from_run(
chain=chain,
context=context,
result=result,
started_at=started,
chain_id="my-chain", # optional
chain_version="v3", # optional
)

from_run stores chain.to_dict(), captures outer_context and memory plus the context metadata (dropping framework-internal __-prefixed keys), and sets finished_at to now if you don’t pass it.

FieldMeaning
chain_id / chain_versionIdentity of the executed chain (optional).
chain_dictThe serialized chain. Subject to the same limits as JSON serialization.
inputouter_context, memory and context_metadata the run started from.
resultThe ReasoningResult, serialized in full form.
started_at / finished_atTimestamps.
runtime_infoLibrary version and environment info.
record.save("runs/run-001.json")
loaded = RunRecord.load("runs/run-001.json")
d = record.to_dict(); RunRecord.from_dict(d)
s = record.to_json(); RunRecord.from_json(s)

The desktop app keeps its own execution receipts (chain and input digests, a bounded per-step preview) rather than RunRecord files; see Runs. maestro replay accepts a RunRecord file as well as a bare ReasoningResult.