Overview
The Allternit Evolution Layer (allternit-evolution-layer) is the kernel’s self-improvement infrastructure. It runs as a Rust library inside the platform runtime and exposes five coordinated engines that continuously adapt agent behavior based on outcomes, cost, and task structure:
- Memory Evolution Engine (MEE) — schema competition and retrieval-strategy selection.
- Skill Evolution Engine (SEE) — trajectory distillation into reusable, evolving skills.
- Confidence Routing Layer (CRL) — adaptive model-tier escalation from small to frontier.
- Organizational Evolution Engine (OEE) — dynamic role specialization and workflow mutation.
- Trajectory Optimization Engine (TOE) — boundary-aware reasoning compression and continuation control.
Architecture
EvolutionLayer struct owns one instance of each engine and is constructed with references to the system-law and harness-engineering engines. Every engine is independently addressable, so callers can use a single engine or coordinate all five.
Key concepts
Memory schema competition (MEE)
A memory schema defines how an agent stores, retrieves, and updates context for a domain. MEE keeps an archive of schemas, evaluates each one on retrieval precision, context compression, and task-success correlation, then promotes the best-performing candidate to active use. Schema lifecycle:- Register a schema for a domain.
- Evaluate it on live tasks to produce scores.
- Generate mutated candidates from high-performing schemas.
- Promote the winner and set it as the active schema.
Skill extraction from trajectories (SEE)
A skill is a reusable pattern distilled from a successful trajectory. SEE records trajectories (ordered steps with tools, observations, and outcomes), extracts behavior patterns and tool sequences, and tracks success rates over time. Skills can be retrieved by trigger signature or domain tag.Confidence-based routing (CRL)
CRL routes requests to a model tier (Small, Medium, Frontier) based on task complexity, historical failure rate, and an uncertainty estimate. When a tier fails, CRL escalates the task signature to the next tier. The layer records every decision so cost and quality can be audited.
Organizational evolution (OEE)
OEE represents multi-agent workflows as workflow configs: a set of roles, iteration cycles, escalation thresholds, and parallelism flags. Workflows mutate over time by adding or removing roles, changing iteration depth, or toggling parallel execution. OEE selects the optimal workflow for a given task complexity.Trajectory optimization (TOE)
TOE manages long reasoning chains by chunking them, tracking average confidence, and summarizing when a boundary condition is reached. An efficiency reward penalizes excessive token use, encouraging concise reasoning.Installation
The crate is a workspace dependency in the Allternit monorepo:EvolutionLayer directly.
Usage
Initialize the layer
Register and evaluate a memory schema
Extract a skill from a trajectory
Route a task and learn from outcomes
Register and mutate a workflow
Optimize a reasoning trajectory
Inspect layer status
EvolutionStatus contains counts for memory schemas, skills, routing decisions, workflows, and tracked trajectories.
Engine reference
Error handling
All fallible engine methods returnResult<T, EvolutionError>:
Observability
The crate usestracing for structured logging. Each engine emits spans around candidate generation, routing decisions, workflow mutation, and trajectory summarization. Downstream services can correlate these spans with the decision_id, schema_id, skill_id, and state_id fields returned by the engines.
Security and policy integration
EvolutionLayer is constructed with SystemLawEngine and HarnessEngineeringEngine references. These provide policy guardrails and evaluation harnesses so that evolved schemas, skills, workflows, and routing decisions can be validated before they are promoted to active use. Individual engines do not bypass these guards; callers should gate promotion behind harness evaluation.
Related pages
- Self-Improve — agents-as-diffs lineage and staged evaluation
- Memory Fabric — persistent memory backend used by MEE schemas
- Gizzi Runtime — runtime that consumes evolved skills and routing decisions
- Orchestration — multi-agent coordination that consumes OEE workflows
- ML Services — model tiers exposed to CRL routing