Memory and State Management

Memory and State Management

Memory Provenance

58 of 69 in this book · 3 min read

What it is

Recording, for every stored memory, where its content came from and how it got there: the utterance, document, tool result, or earlier memory it derives from; whether it was stated, observed, or inferred; and which agent, model, and extractor version wrote it. Provenance travels with the item, survives merging and consolidation, and is what makes a stored claim re-checkable and retractable later. It is about the origin of a remembered belief, not about attributing the passages in an assembled prompt.

Why it matters

A memory store accumulates derived content, and derived content is indistinguishable from observed content unless something records the difference. The moment anyone asks why the agent believes something, or a bad fact has to be traced to the conversation that created it, or an extraction bug is found that was active for three weeks, provenance is the only thing that makes the question answerable rather than a content-matching hunt. It is also the precondition for targeted deletion: without a derivation graph, "remove everything that came from this conversation" cannot be computed.

Key decisions

  • Granularity: a source identifier per item, a full derivation chain, or a signed lineage. The chain is what makes retraction possible and it is the first thing dropped when cost is questioned.
  • Whether origin distinguishes a statement by the subject, an observation from a system of record, and an inference by a model. These three deserve different trust, different conflict handling, and different wording when the agent repeats them.
  • Whether the writing model, prompt version, and extractor revision are recorded, since that is what turns a discovered defect into an identifiable cohort rather than an unbounded review.
  • How provenance survives merging and consolidation: the surviving item inherits one source, the union of sources, or a structured derived-from set.
  • Whether any of it is shown to the user, and in what form. "You told me this in March" is a different product from an opaque confidence score.
  • Retention of the provenance records themselves, since they can outlive their sources and thereby become a surviving record of deleted content.

Failure modes

  • Consolidation writes derived items with no link to their inputs, so the derived layer cannot be checked, corrected, or swept when a source is retracted.
  • Provenance points at a conversation identifier that has since been deleted, leaving a dangling reference the interface renders as unknown.
  • Only the immediate parent is stored, so a third-generation claim traces to a second-generation claim and the chain stops there.
  • Inference and statement are recorded identically, and a model's guess wins a conflict against the subject's own correction because both look like claims of equal standing.
  • The provenance record retains the verbatim text of the source utterance, so deleting the conversation leaves a copy of it in the provenance table.
  • Model and prompt versions are not recorded, so when an extraction defect is found there is no way to scope which memories need re-checking, and the choice is between reviewing everything and reviewing nothing.
  • Provenance is written but never read by anything, so it degrades silently and nobody discovers it is wrong until the one occasion it was needed.
  • Two agents write the same claim and each records itself as the origin, so the store appears to hold independent corroboration of something that has one source.

Related capabilities


Applies: Production readiness · Design questions