Documentation

Quick install
npm install @agent/context --registry https://registry.ai-devtools.eu

Concepts

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.

Instrumenting a retrieval step

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.

Trust labels

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.

Replay

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.

Retention and export

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.

Questions

Do you send our prompts anywhere?

No. The SDK writes to a backend you configure. The hosted control plane is optional and reads only what you push to it.

Does this stop prompt injection?

No, and we are careful not to claim it does. It records what entered the context and labels where it came from, so a policy you write can act on that and so an incident can be reconstructed afterwards.

What is the overhead?

A few milliseconds per recorded item and the storage the records occupy. Recording can be sampled, though for audit purposes most teams keep everything.

Which frameworks are supported?

Adapters ship for the common ones, and the underlying interface is small enough that writing one takes an afternoon.