symfonic.core.learning.phases_entity¶
phases_entity ¶
Phase 12.5 -- EntityLinker consolidation phase (Item 12 / 7.2).
Scans recent episodics, extracts entity mentions with the configured
extractor, resolves them to canonical semantic nodes (creating new
nodes when needed), and emits MENTIONS edges
(provenance='entity_linker') between co-mentioned entity nodes
with the originating episodic ids stored on
MemoryEdge.source_episodic_ids.
Idempotent across re-runs when the configured extractor is
deterministic (regex / spaCy). See design §9. Default-off behind
FrameworkConfig.enable_entity_linker.
Roadmap reference: .claude/docs/2026-05-16-7.1.x-7.2-roadmap.md §11. Design note: .claude/docs/2026-05-23-entity-linker-design.md.
RegexHeuristicExtractor ¶
Decision 4.5 default strategy.
Returns kind='other' and confidence=0.4 for all capitalised
tokens (single or whitespace-joined) that pass a small stoplist.
The default confidence_threshold=0.5 therefore filters every
candidate out by design (§16.0 Q2). Users who want regex
extraction must either lower the threshold to 0.4 or switch to
the spaCy / LLM extractor.
build_entity_links
async
¶
build_entity_links(
graph: Any,
episodic_layer: Any,
scope: TenantScope,
*,
extractor: EntityExtractor,
min_mention_count: int = DEFAULT_MIN_MENTION_COUNT,
max_episodics_per_run: int = DEFAULT_MAX_EPISODICS_PER_RUN,
confidence_threshold: float = DEFAULT_CONFIDENCE_THRESHOLD,
) -> tuple[int, int]
Phase 12.5 implementation.
Returns (entity_nodes_created, mentions_edges_created).
See design §10 for acceptance contract and §9 for idempotency.
Per §16.0 Q6, emitted edges are entity-to-entity MENTIONS with
co-mention episodic ids on MemoryEdge.source_episodic_ids.