symfonic.capabilities.memory.phases.pruning¶
pruning ¶
Consolidation phases 2.5-4: reconcile pending edges, prune, roll up.
Split out of :mod:symfonic.core.learning.phases (439 lines against the
300-line budget), following the convention that module already established --
phases_profile, phases_maintenance and phases_episodic each hold a
band of phases and say so in their docstring.
These three are the reconciling phases. The ones before them read the turn and
add edges and attributes; these settle what that left behind -- pending edges
become real ones or are dropped, stale low-confidence nodes go, and the
survivors roll up into cluster meta-nodes. phases re-exports all three,
plus the constants their tests import, so
from symfonic.core.learning.phases import prune_orphans and its siblings
are unchanged.
consolidate_pending_edges
async
¶
consolidate_pending_edges(graph: GraphMemoryStore, scope: TenantScope, all_nodes: list[MemoryNode], pending_connections: list[dict[str, Any]]) -> int
Write inferred pending_connections as real graph edges.
Source code in src/symfonic/capabilities/memory/phases/pruning.py
generate_meta_nodes
async
¶
generate_meta_nodes(graph: GraphMemoryStore, scope: TenantScope, all_nodes: list[MemoryNode], llm_summarise: Any | None = None) -> int
Create meta-nodes from clusters of related nodes.
Idempotence: generated META: and Entity: nodes are excluded from
the clustering input. Without the first filter, a second consolidation run
groups every META:foo/META:bar node under the shared prefix
META and emits a META:META cascade node -- correct but
cosmetically noisy. Without the second, every entity minted late in DEEP's
roster groups under META:Entity on the next unchanged cycle. Phase 4
clusters raw domain nodes; both kinds are phase outputs, not inputs.
Source code in src/symfonic/capabilities/memory/phases/pruning.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | |
prune_orphans
async
¶
Delete orphan nodes: few edges, stale, low confidence, or TTL-expired.