npm install @agent/context --registry https://registry.ai-devtools.eu
A run is one agent invocation from first prompt to final output. Within a run, every piece of content that enters the context window is a record with an origin, a trust label and a timestamp. The SDK is the thing that creates records; the replay tool is the thing that reads them back. Everything else is built on those two.
Wrap the call that returns documents. The wrapper records the query, the source identifier, and each returned chunk, then hands the results back unchanged. Your retrieval logic does not move and your downstream code sees the same objects it saw before.
Content retrieved from outside your own corpus is labelled untrusted at retrieval time. The label travels with the record through summarisation and reranking, so a policy at the tool-call boundary can ask whether any untrusted content contributed to the decision. This does not make a system safe by itself; it makes the question answerable.
Give the replay command a run identifier and it reconstructs the full sequence of context states, one per model call. Output is a diffable tree, so comparing a failing run against a passing one is an ordinary diff rather than an afternoon of reading logs.
Records are stored wherever you point the SDK; we supply backends for local disk, S3-compatible object storage and Postgres. Export produces a self-contained bundle that the replay tool reads without any service running, which matters when the question is being asked months later.