Skip to main content

Provenance chain

A provenance chain is the directed acyclic graph (DAG) of derived_from and supersedes edges connecting a memory to the records it was derived from. Chains span agents, sessions, and time.

How chains are built

Every add() call accepts a derived_from=[parent_id, ...] argument. memledger writes the edge into the chain store (a JSON-array store by default; pluggable to Neo4j or Apache AGE for graph-shaped queries) at the same time it writes the record to the vector store. Reads can hydrate any record's full ancestry in a single walk.

triage_id = await ml.add(
content="possible connection-pool exhaustion",
namespace="/ops/incidents/payment-svc",
confidence=0.30,
hedged=True,
created_by="triage-agent",
)

await ml.add(
content="bump maxPoolSize from 10 to 50",
namespace="/ops/incidents/payment-svc",
confidence=0.85,
created_by="diagnosis-agent",
derived_from=[triage_id],
)

Why a DAG, not a list

In a single-agent system you can pretend chains are linear. In a multi-agent flow they are not — Agent C might derive a recommendation from both Agent A's signal and Agent B's hedged guess. Modeling the chain as a DAG keeps min(chain.confidence) honest across all branches.

What chains enable

  • Effective confidencemin(declared, chain.min_confidence). The headline guarantee.
  • RTBF cascades — forgetting a memory propagates to its derivatives.
  • MQS — chain depth and reliability feed the Memory Quality Score.
  • Audit trailswho derived what from where is one query away.

Performance

Chain walks are bounded by max_hops (default 5). For deep agentic flows, raise it; for tight latency budgets, lower it and accept that very old ancestors won't influence the gate.