Skip to main content

Memory Provenance

Every memory in Kernle carries provenance metadata — a detailed record of its origin, relationships, and confidence evolution over time. This enables self-examination (“why do I believe this?”), belief debugging, and identity archaeology.
Provenance answers three fundamental questions about any memory:
  • Where did this come from? — Source type and creation context
  • What was it derived from? — Direct lineage chain
  • How has it changed? — Confidence history and verification record

Universal Provenance Fields

Every memory type (episode, belief, note, value, etc.) carries these provenance fields:

Source Types

Source types are entity-neutral — we don’t distinguish between human and synthetic sources:

Direct Experience

Firsthand observation or experience. Default for raw captures and manual entries.

Inference

Derived through reasoning over other memories. Common for beliefs formed by pattern recognition.

Consolidation

Emerged during memory consolidation/reflection. Insights from reviewing experiences.

External

Information received from another being. Includes both human and SI sources.

Seed

Pre-loaded during initialization. Inherited wisdom from roundtable discussions.

Observation

External observation from documents, web, etc. Non-conversational sources.

Lineage vs Evidence

Two critical fields serve different purposes:
Direct creation lineage — “This memory was literally created FROM these.”
Used when a memory is created, including:
  • raw-to-episode promotion (raw:...episode:...)
  • episode-to-belief promotion (episode:...belief:...)
  • belief revision (belief:old_idbelief:new_id)
Never conflate derived_from and source_episodes. Lineage is about creation; evidence is about support.

The Promotion Chain

Raw memories flow upward through promotion, with each step recording lineage:
At each step, derived_from creates a traceable chain:

Confidence Decay

Memories that aren’t verified or reinforced gradually lose confidence over time:

CLI Commands

Provenance is integrated into all memory operations:

Provenance Enforcement (v0.10.0)

Provenance is enforced by default. Every memory (except raw entries) must cite its sources via derived_from.
Creating a belief without citing an episode or note will raise ProvenanceError. This is intentional — memories must have traceable origins.

Hierarchy Rules

Stack Lifecycle and Enforcement

Provenance requirements depend on stack state:
  • INITIALIZING: Seed writes with source_type="seed" bypass provenance (for bootstrap)
  • ACTIVE: All writes must have valid provenance (default state)
  • MAINTENANCE: Writes blocked entirely (admin operations only)

Opting Out

For testing or migration, provenance can be disabled:

Strength Cascade (v0.10.0)

When a memory’s strength changes, effects cascade through the provenance chain:
  • Forget/Weaken cascade: When a source memory is forgotten or weakened below 0.2, derived memories are flagged for review via audit entries
  • Verify boost: When a memory is verified, its source memories get a +0.02 strength boost
  • Ungrounded detection: If ALL source memories of a belief are forgotten/deleted, the belief is flagged as “ungrounded”
Cascade depth is 1 (direct children only). All cascades except verify are advisory — they create audit entries but don’t auto-modify child strength.

Belief Revision

Beliefs evolve through three mechanisms:

Reinforcement

When experience confirms a belief, confidence increases with diminishing returns.

Supersession

When a belief evolves, the old one is deactivated and linked to its replacement.

Contradiction

Kernle detects conflicts between beliefs. Contradictions are features, not bugs.

Revision Example

supersedes/superseded_by are legacy compatibility fields retained for pre-v0.14 stacks. In normal operation, revision is reconstructed from audit entries (belief.revised, belief.deactivated) rather than from these fields.

Design Principles

Automatic, Not Manual

Provenance is recorded at creation time without requiring explicit caller intervention.

Write-Once Links

Forward and backward links are birth certificates — recorded once, never updated.

Trace Up, Don't Cascade Down

Upward tracing is cheap. Downward propagation is an exponential trap.

Entity-Neutral Sources

Source types don’t distinguish human from SI. A being is a being.

MCP Integration

Provenance is exposed through MCP tools for external clients:
Provenance transforms memory from a black box into an archaeological dig. Every belief can be traced back to its roots, every decision can be examined for its foundations.