Skip to main content

Crate ainl_runtime

Crate ainl_runtime 

Source
Expand description

ainl-runtime v0.3 — orchestration layer for the unified AINL graph (memory substrate + extraction).

This crate does not call LLMs, parse AINL IR, or implement tool adapters. It coordinates ainl_memory, persona axis state via ainl_persona::EvolutionEngine (shared with ainl_graph_extractor::GraphExtractorTask), and scheduled graph extraction — with TurnHooks for host integration (e.g. OpenFang).

Evolution: EvolutionEngine lives in ainl-persona. AinlRuntime::evolution_engine_mut and helpers (AinlRuntime::apply_evolution_signals, AinlRuntime::persist_evolution_snapshot, …) drive it without going through the extractor. GraphExtractorTask::run_pass remains one signal producer (graph extract + recurrence + pattern heuristics), not the only way to evolve persona axes.

For a minimal “record episodes + run extractor” path without the full engine, see RuntimeContext.

Structs§

AdapterRegistry
AinlGraphArtifact
A loaded, validated AINL graph artifact (memory substrate view for one agent).
AinlRuntime
Orchestrates ainl-memory, persona snapshot state, and graph extraction for one agent.
EvolutionEngine
ExtractionReport
GraphExtractorTask
GraphPatchAdapter
Reference adapter registered as Self::NAME. Used as a fallback when no label-specific PatchAdapter is registered for the procedural patch label.
MemoryContext
Compiled memory context for a turn (prompt-side assembly in the host).
NoOpHooks
Default hook implementation (no side effects).
PatchDispatchContext
Per-patch inputs for crate::PatchAdapter::execute_patch (procedural / GraphPatch nodes).
PatchDispatchResult
Result of attempting to dispatch one procedural patch node.
PersonaSnapshot
RawSignal
RuntimeConfig
Configuration for AinlRuntime and RuntimeContext.
RuntimeContext
Host context: optional memory plus optional stateful extractor (legacy / lightweight).
TurnInput
Input for a single agent turn (host fills; runtime does not call LLMs).
TurnOutput
Output of a single agent turn orchestrated by crate::AinlRuntime.

Enums§

MemoryNodeType
PatchSkipReason
PersonaAxis
TurnOutcome
High-level turn result (soft limits use variants instead of Err when Ok carries diagnostics).

Constants§

EMIT_TO_EDGE
Edge label for emit routing (matches ainl_graph_edges.label).
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.
INGEST_SCORE_EPSILON
Minimum absolute score delta on an axis for a signal to count as “applied” in EvolutionEngine::ingest_signals.

Traits§

GraphPatchHostDispatch
Optional host hook: receives the normalized GraphPatch envelope (see module docs).
PatchAdapter
Trait for patch/tool adapters. Implement to give dispatched patches a host execution target. Register via crate::AinlRuntime::register_adapter.
TurnHooks
Hooks for observability and host wiring. Every method has a default empty body.

Functions§

default_axis_map
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.