symfonic.capabilities.memory.coordinator¶
coordinator ¶
The component that decides what a turn remembers.
Everything the facade did inline between a store call and a prompt string lives here: which layers are searched, what each hit is worth, which hits are too weak to earn a slot, how far up the hierarchy a memory may have come from, and which neighbours come along with it. The facade could not be described without describing all of it; this class can be handed a different store and keep every one of those decisions unchanged, which is the whole point of the extraction.
The coordinator is a :class:~.ports.MemoryRetrievalPort — the bridge holds
it and knows nothing else. :meth:RetrievalCoordinator.coordinate is the same
pass with its work shown, for the hydration layer and for anything that wants
the activation provenance. Nothing about a turn is stored on the instance: the
log rides the return value, so two concurrent invocations cannot read each
other's recall.
Transport degrades, contracts propagate — and the two halves differ. An
unreachable store raises :class:~.errors.MemoryUnavailable out of
:meth:retrieve, because the port's contract says an empty result means "this
scope remembers nothing" and the bridge is the component licensed to collapse
the two. An unreachable association source does not: by the time expansion
runs the recall is in hand, and failing the turn to protect its neighbours
trades the answer for the garnish.
CoordinatedRetrieval
dataclass
¶
CoordinatedRetrieval(result: RetrievalResult, activation: ActivationLog = ActivationLog(), layers: frozenset[MemoryLayer] = frozenset())
One retrieval pass with its work shown.
RetrievalCoordinator ¶
RetrievalCoordinator(*, source: CandidateSource, policy: RetrievalPolicy | None = None, activation: SpreadingActivation | None = None)
Owns layers, scoring, gates, scope blending, and activation.
Source code in src/symfonic/capabilities/memory/coordinator.py
coordinate
async
¶
Retrieve for query, returning the result and its provenance.
Source code in src/symfonic/capabilities/memory/coordinator.py
retrieve
async
¶
The :class:~.ports.MemoryRetrievalPort surface: just the result.
RetrievalPolicy
dataclass
¶
RetrievalPolicy(enabled_layers: frozenset[MemoryLayer] = RETRIEVABLE_LAYERS, weights: RelevanceWeights = DEFAULT_WEIGHTS, blend: ScopeBlend = ScopeBlend(), min_relevance: float = 0.0, min_salience: float = 0.0, profile_slots: int = 1)
The deployment's retrieval decisions, in one value.
Frozen and validated at construction so a deployment that mis-states a gate
fails at wiring time rather than by quietly retrieving nothing on every turn
— the failure mode a floor of 1.5 actually has.
effective_layers ¶
The layers actually searched: what is enabled, narrowed by the query.