Provenance Fields
Automatic Provenance
Provenance is recorded automatically. You don’t need to set it manually:Pattern References
Usepattern_refs to cross-reference related entries:
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.
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.provenance.agent_id and outcome_count, not stored as a separate field.
