symfonic.capabilities.memory.bundle¶
bundle ¶
Memory as something a host can compose, from a store and a scope.
Split from :mod:symfonic.capabilities.memory.factory at the 300-line budget,
and the two halves are two questions: the factory decides what a memory
capability is, and this decides what a host takes away -- the capability
and the grants it needs, as one list to compose.
memory_capabilities ¶
memory_capabilities(store: Any, scope: MemoryScope | Any, *, limit: int = 5, recall_budget: RecallBudget | None = None, extractor: MemoryExtractorPort | None = None, summary: STMSummaryPort | None = None, reflection: ReflectionPort | None = None, consolidation: Any | None = None, conversation: Any | None = None, recent_turns: int = 0, activation: Any | None = None, retrieval_policy: RetrievalPolicy | None = None, retrieval: RetrievalCoordinator | None = None, exclude_speakers: frozenset[str] = frozenset(), episodic_telemetry_sink: EpisodicTelemetrySink | None = None, operation_journal: MemoryOperationJournalPort | None = None, triage: IntentTriageCapability | None = None) -> list[Any]
The capability and the grants it needs, as one list to compose.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store
|
Any
|
an HMS satisfying the retrieval, write and lifecycle ports. |
required |
scope
|
MemoryScope | Any
|
typed paths retain every native kind/ID level. Explicit MemoryScope values retain their version, including positional v0. |
required |
limit
|
int
|
how many memories a turn recalls. |
5
|
recall_budget
|
RecallBudget | None
|
explicit UTF-8 rendered recall ceilings. None preserves legacy character caps; unrelated to the working conversation window. |
None
|
conversation
|
Any | None
|
an optional conversation source. NativeConversationHistory also installs final-only publication when supplied. |
None
|
recent_turns
|
int
|
number of recent utterances; zero skips the window read. |
0
|
extractor
|
MemoryExtractorPort | None
|
a :class: |
None
|
summary
|
STMSummaryPort | None
|
an explicit evicted-turn summary collaborator, normally
:class: |
None
|
reflection
|
ReflectionPort | None
|
a completed-exchange insight collaborator. |
None
|
consolidation
|
Any | None
|
a :class: |
None
|
activation
|
Any | None
|
a :class: |
None
|
retrieval_policy
|
RetrievalPolicy | None
|
the public relevance, salience, layer, and hierarchy policy for the default coordinator. A policy is applied before the block is compiled; changing a floor or blend changes the recalled records, not merely a diagnostic. |
None
|
retrieval
|
RetrievalCoordinator | None
|
a fully composed :class: |
None
|
exclude_speakers
|
frozenset[str]
|
transcript and explicitly tagged recalled speakers omitted. Untagged recalled records remain eligible; speaker is never inferred. |
frozenset()
|
episodic_telemetry_sink
|
EpisodicTelemetrySink | None
|
optional async observer for successful
|
None
|
triage
|
IntentTriageCapability | None
|
the composed |
None
|
Raises:
| Type | Description |
|---|---|
ConfigurationError
|
if |
Returned together because a capability may not grant itself an effect and a caller that forgot one would get a fold refusal naming a grant rather than a missing feature. The three are what memory is.
Prompting is NOT included. Memory is a resolution stage: it reaches the store and leaves an entry in the turn's snapshot. Prompting is the compilation stage that reads that snapshot and renders it. Fold memory by itself and both ports are called, the block is composed, the snapshot is populated -- and the model receives the bare instructions.
It is not added here because a factory named for memory that quietly
composed prompting would decide a deployment's prompt on its behalf. A
composition root wanting recall in the prompt adds a PromptingCapability
beside this.
Source code in src/symfonic/capabilities/memory/bundle.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |