symfonic.capabilities.memory.provenance¶
provenance ¶
What activation records about itself, so a surprising recall can be explained.
A memory that reached a prompt because the query matched it needs no explanation. A memory that reached it because it is two hops from something the user mentioned is the one a user asks "how did you know that?" about — and the one an operator has to be able to audit when the answer is "it should not have".
So this module holds the vocabulary, separate from the walk that produces it
(:mod:.activation). The split is not bookkeeping: these types are read by
event mapping, by the hydration record, and eventually by a consolidation pass
deciding which inferred edges to make real, none of which want the traversal.
Provenance rides the record. :attr:~.records.MemoryRecord.origin is the
field T3.3.1 reserved for it, and :func:activation_origin is the one place its
format is decided, so "where did this come from?" is answered by the memory
rather than by a side table that can drift from it.
ActivatedNode
dataclass
¶
ActivatedNode(record_id: str, label: str, layer: MemoryLayer, score: float, hop: int = 0, source_id: str = '', relationship: str = '')
One memory the activation pass lit up, and how it got there.
of
classmethod
¶
of(record: MemoryRecord, *, score: float, hop: int = 0, source_id: str = '', relationship: str = '') -> ActivatedNode
Build a node from the memory it stands for, with a bounded label.
Source code in src/symfonic/capabilities/memory/provenance.py
ActivationEdge
dataclass
¶
ActivationEdge(source_id: str, target_id: str, relationship: str = 'associated', weight: float = 1.0)
One traversal, kept so a later correction pass can see what was believed.
ActivationLog
dataclass
¶
ActivationLog(nodes: tuple[ActivatedNode, ...] = (), edges: tuple[ActivationEdge, ...] = (), paths: tuple[tuple[str, ...], ...] = (), truncated: bool = False, degraded: bool = False)
The provenance of one activation pass.
Returned from the walk rather than stored on it, so two concurrent turns cannot read each other's expansion.
Association
dataclass
¶
Association(source_id: str, target: MemoryRecord, relationship: str = 'associated', weight: float = 1.0)
One edge out of a memory, as a backend reports it.