symfonic.capabilities.memory.recall¶
recall ¶
The vocabulary a deployment needs to compose memory recall.
memory_capabilities(..., activation=...) accepts a
:class:SpreadingActivation, which follows graph associations after the direct
query recall. This surface publishes the values needed to construct that
collaborator without inspecting memory internals: :class:Association describes
an edge, :class:AssociationSource supplies a frontier's edges, and
:class:SpreadingActivation applies the bounded traversal.
The conversation-window types live beside them because they are the other
public recall collaborator. A kernel-native host supplies its own
:class:ConversationSource to form a :class:WorkingWindow; both the working
window and graph expansion contribute to one hydrated recall.
Retrieval and hydration own ranking, floors, scope blend, spreading activation, and provenance that the former facade decided inline. This is a curated public surface rather than a mirror of memory internals, so a composition imports the collaborators it needs without making the broad hub grow for each recall seam.
The names remain available from :mod:symfonic.capabilities.memory for
compatibility. New compositions should import this focused surface.
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.
AssociationSource ¶
Bases: Protocol
The graph half of the memory system, as activation needs it.
neighbours
async
¶
Every edge out of record_ids, one round trip per frontier.
Takes the whole frontier rather than one id so a hop costs one query
instead of one per seed. Raises :class:~.errors.MemoryUnavailable when
the graph cannot be reached.
Source code in src/symfonic/capabilities/memory/activation.py
ConversationSource ¶
Bases: Protocol
The working layer, as hydration needs it.
recent
async
¶
The last limit turns at scope, oldest first.
Raises :class:~.errors.MemoryUnavailable when the working store cannot
be reached; :class:WorkingWindow degrades rather than failing the turn.
Source code in src/symfonic/capabilities/memory/working.py
ConversationTurn
dataclass
¶
One thing that was said, as the working layer holds it.
line ¶
The rendered form: layer prefix, speaker, single-line text.
Source code in src/symfonic/capabilities/memory/working.py
SpreadingActivation
dataclass
¶
SpreadingActivation(source: AssociationSource, max_hops: int = 1, decay: float = 0.5, max_nodes: int = 10)
Expands a recall through the association graph, with decay and a cap.
expand
async
¶
expand(scope: MemoryScope, seeds: Sequence[RetrievedMemory]) -> tuple[tuple[RetrievedMemory, ...], ActivationLog]
Walk out from seeds and return what lit up, plus the provenance.
Source code in src/symfonic/capabilities/memory/activation.py
WorkingContext
dataclass
¶
WorkingContext(turns: tuple[ConversationTurn, ...] = (), dropped: tuple[tuple[str, str], ...] = (), degraded: bool = False)
The conversation window as it will render, and what it left out.
WorkingWindow
dataclass
¶
WorkingWindow(source: ConversationSource, recent_turns: int = 0, exclude_speakers: frozenset[str] = frozenset())
Reads the last few turns of a conversation, ungated.
read
async
¶
Read the window at scope, dropping only what would corrupt it.