Skip to main content

Crate ainl_graph_extractor

Crate ainl_graph_extractor 

Source
Expand description

Graph extractor task: bump semantic recurrence_count from retrieval deltas, then run persona evolution.

Alpha: API may change before 1.0.

Persona evolution rows use ainl_persona::EVOLUTION_TRAIT_NAME — import that constant from ainl-persona when matching evolution bundles; do not duplicate the string.

Note: GraphExtractorTask::evolution_engine is the canonical in-process handle to ainl_persona::EvolutionEngine. ainl-runtime exposes the same engine for direct ingest_signals / correction_tick / evolve calls; this crate’s run_pass is one signal path, not the only one.

Structs§

ExtractionReport
GraphExtractorTask
PersonaSignalExtractorState
Rolling state for debounce / streak detectors (in-memory, per GraphExtractorTask).

Constants§

AXIS_EVOLUTION_SNAPSHOT
Stable alias for the same trait string (documentation / import ergonomics).
EVOLUTION_TRAIT_NAME
Canonical ainl_memory::PersonaNode::trait_name for axis-evolution bundles. graph_extractor (Prompt 2) should import this from the crate root when selecting persona rows for domain / formality signals — do not duplicate the string.

Functions§

extract_pass
Episode-ordered heuristics plus semantic domain pass; updates state and may patch episode rows.
run_extraction_pass
Convenience wrapper for one-off extraction. Creates a fresh GraphExtractorTask with a new crate::PersonaSignalExtractorState on each call, so streak-based detectors (brevity, formality) cannot fire across invocations. For long-running agent loops, instantiate GraphExtractorTask directly and call GraphExtractorTask::run_pass to preserve streak state between passes.
update_semantic_recurrence
For each semantic node for agent_id, if reference_count increased since the last extractor snapshot, increment recurrence_count by at most 1 and refresh _last_ref_snapshot.