Expand description
ainl-runtime v0.2 — 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§
- Adapter
Registry - Ainl
Graph Artifact - A loaded, validated AINL graph artifact (memory substrate view for one agent).
- Ainl
Runtime - Orchestrates ainl-memory, persona snapshot state, and graph extraction for one agent.
- Evolution
Engine - Extraction
Report - Graph
Extractor Task - Memory
Context - Compiled memory context for a turn (prompt-side assembly in the host).
- NoOp
Hooks - Default hook implementation (no side effects).
- Patch
Dispatch Result - Result of attempting to dispatch one procedural patch node.
- Persona
Snapshot - RawSignal
- Runtime
Config - Configuration for
AinlRuntimeandRuntimeContext. - Runtime
Context - Host context: optional memory plus optional stateful extractor (legacy / lightweight).
- Turn
Input - Input for a single agent turn (host fills; runtime does not call LLMs).
- Turn
Output - Output of a single agent turn orchestrated by
crate::AinlRuntime.
Enums§
- Memory
Node Type - Patch
Skip Reason - Persona
Axis - Turn
Outcome - High-level turn result (soft limits use variants instead of
ErrwhenOkcarries diagnostics).
Constants§
- EMIT_
TO_ EDGE - Edge label for emit routing (matches
ainl_graph_edges.label). - EVOLUTION_
TRAIT_ NAME - Canonical
ainl_memory::PersonaNode::trait_namefor 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§
- Patch
Adapter - Trait for patch/tool adapters. Implement to give dispatched patches
real execution targets. Register via
crate::AinlRuntime::register_adapter. - Turn
Hooks - 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
GraphExtractorTaskwith a newcrate::PersonaSignalExtractorStateon each call, so streak-based detectors (brevity, formality) cannot fire across invocations. For long-running agent loops, instantiateGraphExtractorTaskdirectly and callGraphExtractorTask::run_passto preserve streak state between passes.