Skip to main content
Every learning entry in SenseLab carries provenance — who learned it, in which session, and when. Provenance is what makes the loop attributable: an outcome can be credited to the agent whose learning it relied on, a procedure can be scoped to the environment it was learned in, and when a run goes wrong you can tell whether the agent changed or its knowledge did.

Provenance Fields


Automatic Provenance

Provenance is recorded automatically. You don’t need to set it manually:

Pattern References

Use pattern_refs to cross-reference related entries:
Pattern refs are free-form strings. Use them to build a web of related knowledge that agents can follow.

Agent Identity

In the MCP server, agent identity is auto-detected from the environment: In headless contexts — CI, scripts, servers — set the identity with an environment variable:
IDE signals are checked before AMFS_AGENT_ID, so the variable does not rename an agent running inside Cursor or Claude Code. That is deliberate: it stops a server-side value inherited by your shell from relabelling local sessions. Inside an IDE, call amfs_set_identity instead.

Session Metadata

Provenance answers who wrote an entry. A parallel record answers what was running — the model, the client, and the tools it had available: Agents set this by passing model= to amfs_set_identity. It is stored on the agent’s profile and on decision traces rather than on Provenance itself, so when you audit a decision later you can tell which model made it.

Environment

The SDKs extend this with the run’s environment — model, agent_version, runtime and platform — stamped on every sealed trace and sent with every briefing and retrieval. Two things depend on it:
  • A procedure whose preconditions name a different environment is set apart in the briefing as not applicable, instead of being handed to an agent it will not work for.
  • When a long-validated rule starts failing, the environment on the traces is how SenseLab tells a change in your agent — a new model, a new version — from a change in what it knows.
In the Python SDK, pass them to Run.begin(...) or set them with set_session_attributes(); see Environment scoping.

Provenance Tiers

SenseLab computes a provenance tier for each entry from the agent ID and the outcome history. It is a coarse answer to “how was this learned?” — in production and confirmed by outcomes, in production but unconfirmed, in development, or seeded by hand — and retrieval and training both prefer the top of the scale.
The tier is a computed property — it derives from provenance.agent_id and outcome_count, not stored as a separate field.

Querying by Provenance

Search for entries written by a specific agent: