Record and replay for Python

The run is over. The execution isn't gone.

Record a Python workflow as it runs. When a test fails, an agent takes an unexpected action, or a customer questions a result, replay the recorded execution and inspect the values and code paths behind it.

Private previewStart with one Python workflow

Recorded in VS Code: a failed CI test replayed, then stepped backwards to the line that set the bad value.

One investigation · illustrative example

One order. Two exchange rates.

The checkout completed and a customer questions the total. A rerun gives the expected result. What happened in the original run?

Original run
thread Aitems 1–2items 3–4sum
thread Brefresh
two rates
unexpected total
Ordinary rerun
thread Aitems 1–2items 3–4sum
thread Brefresh
one rate
expected total
Recorded replay
thread Aitems 1–2items 3–4sum
thread Brefresh
two rates
original evidence
Rerun: a new execution, which can take a different path. Replay: the recorded evidence, on the original path.

The finding

The refresh landed between the second and third items. This order used two rates.

The source shows this could happen. The recording shows that it did. See the same race investigated in a failed CI test →

The questions behind the investigation

An unexpected result deserves an explanation.

Agents and automation

An agent took an unexpected action.

The model and tool responses may be in your trace. You still need to establish the Python state, transformation, retry or branch that turned them into an action.

Which decision path did this workflow actually take?

See how this works for an agent →

Historical calculations

A price, bill or decision is challenged.

The calculation finished successfully. Its inputs or external data may have changed since. Investigate the recorded calculation and the intermediate values that produced this result.

Why did this particular run produce that value?

See how to explain a past result →

CI and SDK support

A failure is hard to reconstruct.

A CI test passes on rerun, or a customer's Python integration fails in a way the support report cannot explain. An agreed recording gives the investigation an original execution to work from.

What happened in the run that failed?

See the failed-test replay walkthrough →

How it works

Record while it runs. Investigate afterwards.

Retrace records your program's interactions with the outside world and the order its threads ran. During replay, your code runs against those recorded results.

While your application runs

Your chosen workload

Record external calls, returned values, exceptions and thread ordering.

The recording

The external interactions and ordering needed to reconstruct the execution.

When an outcome needs investigating

Replay

Re-execute the Python code using the recorded results and ordering.

Investigate

Step forwards and backwards through the replay. Inspect the Python values and code paths behind the result.

The recording needs to exist when the question arrives.

A workflow can look successful and only be questioned later. For a pilot, we agree what to record, which completed runs to retain, and how long they need to remain available. The relevant code and execution environment must remain available too.

Private preview

Start with one Python worker or workflow.

We assess a specific investigation and a manageable workload together. The first step is to establish whether replay can recover evidence that would be useful to your team.

Runtime and dependencies
Retrace supports a defined set of Python versions, libraries and boundaries, listed in the compatibility notes. We check your workload against the current build.
Recording and retention
We agree the recording boundary and the completed runs that need to remain available, including outcomes that appeared successful.
Deployment and data
We agree where recording and replay run, where the data is retained, and who may inspect it.
AI-assisted investigation
Recorded values and code paths can ground an AI-assisted investigation. If you want one, we agree evidence access and data handling as part of the pilot.
A useful first investigation
We choose a concrete question and a way to assess whether the recorded execution supplies the missing evidence.
What a replay can and cannot show

Retrace reconstructs supported Python execution state. It does not recover an execution that was never recorded, the internal computation of a model, opaque native or GPU state, or the internal state of a remote service. Original wall-clock latency and kernel scheduling are not reconstructed by Python replay. Deliberately removed data cannot be assumed recoverable.

For an AI application, the recorded response is what the application received. Replay investigates how the Python code behaved given that response.

Talk to the founders

What was difficult to establish?

Tell us about an investigation your team found difficult: an unexpected agent action, a disputed result, or a Python failure that was hard to explain.

We'll discuss what happened, what your existing tools recovered, and what evidence was missing.

A 25-minute conversation

Bring a recent example. If there is a fit, we'll agree one Python worker or workflow to record and investigate together.

A past incident helps us choose what to record next. Replay needs a recording made while the relevant execution was running.

Submitting opens a draft in your email app. Please send the draft to reach the Retrace team. For recordings, see pilot data handling.

Building a better way to understand software execution.

Retrace is built in London by Henry Yates and Nathan Matthews. We are working with engineering teams to understand where original execution evidence can make an investigation more useful.

FoundersHenry Yates and Nathan Matthews
AdviserYury SelivanovCPython core developer, author of async/await (PEP 492), creator of uvloop
Backed byPreston-Werner Ventures