pub struct LearningConfig {Show 59 fields
pub enabled: bool,
pub auto_activate: bool,
pub min_failures: u32,
pub improve_threshold: f64,
pub rollback_threshold: f64,
pub min_evaluations: u32,
pub max_versions: u32,
pub cooldown_minutes: u64,
pub correction_detection: bool,
pub correction_confidence_threshold: f32,
pub detector_mode: DetectorMode,
pub judge_model: String,
pub judge_provider: String,
pub feedback_provider: ProviderName,
pub judge_adaptive_low: f32,
pub judge_adaptive_high: f32,
pub judge_llm_timeout_secs: u64,
pub correction_recall_limit: u32,
pub correction_min_similarity: f32,
pub auto_promote_min_uses: u32,
pub auto_promote_threshold: f64,
pub auto_demote_min_uses: u32,
pub auto_demote_threshold: f64,
pub cross_session_rollout: bool,
pub min_sessions_before_promote: u32,
pub min_sessions_before_demote: u32,
pub max_auto_sections: u32,
pub domain_success_gate: bool,
pub arise_enabled: bool,
pub arise_min_tool_calls: u32,
pub arise_trace_provider: ProviderName,
pub stem_enabled: bool,
pub stem_min_occurrences: u32,
pub stem_min_success_rate: f64,
pub stem_provider: ProviderName,
pub stem_retention_days: u32,
pub stem_pattern_window_days: u32,
pub erl_enabled: bool,
pub erl_extract_provider: ProviderName,
pub erl_max_heuristics_per_skill: u32,
pub erl_dedup_threshold: f32,
pub erl_min_confidence: f64,
pub d2skill_enabled: bool,
pub d2skill_max_corrections: u32,
pub d2skill_provider: ProviderName,
pub trace_extraction_enabled: bool,
pub trace_extraction_provider: ProviderName,
pub trace_extraction_embedding_provider: ProviderName,
pub trace_extraction_max_turns: u32,
pub trace_extraction_max_sessions_queued: usize,
pub trace_extraction_max_input_bytes: usize,
pub skill_merge_enabled: bool,
pub skill_merge_provider: ProviderName,
pub merge_threshold: f32,
pub dedup_threshold: f32,
pub heuristic_promotion_enabled: bool,
pub heuristic_promotion_provider: ProviderName,
pub heuristic_promotion_threshold: u32,
pub heuristic_promotion_interval_hours: u64,
}Expand description
Self-learning and skill evolution configuration, nested under [skills.learning] in TOML.
When enabled = true, Zeph tracks skill performance and can automatically improve or roll
back skill definitions based on usage outcomes (ARISE, STEM, D2Skill pipelines).
§Example (TOML)
[skills.learning]
enabled = true
auto_activate = false
min_failures = 3Fields§
§enabled: boolEnable self-learning pipelines. Default: false.
auto_activate: boolAutomatically activate improved skill versions without user confirmation. Default: false.
min_failures: u32§improve_threshold: f64§rollback_threshold: f64§min_evaluations: u32§max_versions: u32§cooldown_minutes: u64§correction_detection: bool§correction_confidence_threshold: f32§detector_mode: DetectorModeDetector strategy: “regex” (default) or “judge”.
judge_model: StringNamed provider from [[llm.providers]] for the judge detector (legacy field, prefer judge_provider). Empty = use primary provider.
judge_provider: StringNamed provider from [[llm.providers]] for the judge detector (detector_mode = "judge").
When set, overrides the model-level fallback: the named provider is resolved and used instead of the primary provider. Empty = use primary provider (same as leaving unset).
feedback_provider: ProviderNameProvider name from [[llm.providers]] for detector_mode = "model" (LlmClassifier).
Empty = use the primary provider. Named but not found in registry = log warning, degrade to regex-only. Never fails startup.
judge_adaptive_low: f32Regex confidence below this value is treated as “not a correction” — judge not invoked.
judge_adaptive_high: f32Regex confidence at or above this value is accepted without judge confirmation.
judge_llm_timeout_secs: u64Maximum seconds to wait for the judge LLM to respond before timing out.
Applies to detector_mode = "judge" only.
correction_recall_limit: u32§correction_min_similarity: f32§auto_promote_min_uses: u32§auto_promote_threshold: f64§auto_demote_min_uses: u32§auto_demote_threshold: f64§cross_session_rollout: boolWhen true, auto-promote and auto-demote decisions require the skill to have been used
across at least min_sessions_before_promote (for promotion) or
min_sessions_before_demote (for demotion) distinct conversation sessions.
Prevents trust transitions from a single long session.
min_sessions_before_promote: u32Minimum number of distinct conversation_id values in skill_outcomes before
auto-promotion is eligible. Only checked when cross_session_rollout = true.
min_sessions_before_demote: u32Minimum distinct sessions before auto-demotion when cross_session_rollout = true.
Default 1 (demotion can happen after a single bad session by default). Separate from
min_sessions_before_promote because demotion should be fast (low threshold) while
promotion benefits from conservative validation (higher threshold).
max_auto_sections: u32Maximum number of top-level content sections (markdown H2 headers) allowed in
auto-generated skill bodies. Bodies exceeding this limit are rejected by
validate_body_sections().
domain_success_gate: boolWhen true, auto-generated skill versions must pass a domain-conditioned evaluation before promotion. If the improved body drifts from the original skill’s domain, activation is skipped (the version is still saved for manual review).
arise_enabled: boolEnable ARISE trace-based skill improvement (disabled by default).
arise_min_tool_calls: u32Minimum tool calls in a turn to trigger ARISE trace improvement.
arise_trace_provider: ProviderNameProvider name from [[llm.providers]] for ARISE trace summarization.
Empty = fall back to primary provider.
stem_enabled: boolEnable STEM automatic tool pattern detection and skill generation (disabled by default).
stem_min_occurrences: u32Minimum occurrences of a tool sequence before generating a skill candidate.
stem_min_success_rate: f64Minimum success rate of the pattern before generating a skill candidate.
stem_provider: ProviderNameProvider name from [[llm.providers]] for STEM skill generation.
Empty = fall back to primary provider.
stem_retention_days: u32Days to retain rows in skill_usage_log before pruning.
stem_pattern_window_days: u32Window in days for pattern detection queries (limits scan cost on large tables).
erl_enabled: boolEnable ERL post-task heuristic extraction (disabled by default).
erl_extract_provider: ProviderNameProvider name from [[llm.providers]] for ERL heuristic extraction.
Empty = fall back to primary provider.
erl_max_heuristics_per_skill: u32Maximum heuristics prepended per skill at match time.
erl_dedup_threshold: f32Text similarity threshold (Jaccard) for heuristic deduplication.
When exact text match exceeds this, increment use_count instead of inserting.
erl_min_confidence: f64Minimum confidence to include a heuristic at match time.
d2skill_enabled: boolEnable D2Skill step-level error correction (disabled by default).
Requires arise_enabled = true to populate corrections from ARISE traces.
If d2skill_enabled = true and arise_enabled = false, existing corrections
are still applied but no new ones are generated via ARISE.
d2skill_max_corrections: u32Maximum corrections to inject per failure event.
d2skill_provider: ProviderNameProvider name from [[llm.providers]] for correction extraction from ARISE traces.
Empty = fall back to primary provider.
trace_extraction_enabled: boolEnable background skill extraction from completed conversation traces. Default: false.
trace_extraction_provider: ProviderNameProvider name from [[llm.providers]] for trace extraction LLM calls.
Empty = fall back to the primary provider.
trace_extraction_embedding_provider: ProviderNameProvider name from [[llm.providers]] for embedding calls during trace extraction.
Must reference a provider that supports embed(). Empty = fall back to the primary provider.
trace_extraction_max_turns: u32Maximum user messages to include per extraction session. Default: 200.
trace_extraction_max_sessions_queued: usizeMaximum concurrent background extraction tasks before dropping oldest. Default: 10.
trace_extraction_max_input_bytes: usizeMaximum total bytes of user messages to send to the extraction LLM. Default: 131072 (128 KB).
skill_merge_enabled: boolEnable the Merge branch in the Add/Merge/Discard decision flow. Default: true.
When false, candidates in the merge zone (merge_threshold <= sim < dedup_threshold)
are Discarded instead of merged.
skill_merge_provider: ProviderNameProvider name from [[llm.providers]] for LLM merge calls.
Empty = fall back to the primary provider.
merge_threshold: f32Minimum cosine similarity to trigger a merge with the nearest skill. Default: 0.75.
Must be strictly less than dedup_threshold (validated at startup).
dedup_threshold: f32Minimum cosine similarity to discard a candidate as a near-exact duplicate. Default: 0.90.
Must be strictly greater than merge_threshold (validated at startup).
heuristic_promotion_enabled: boolEnable periodic heuristic promotion from ERL to full skills. Default: false.
When true, a background task runs every heuristic_promotion_interval_hours hours
and evaluates whether accumulated ERL heuristics are substantial enough for promotion.
heuristic_promotion_provider: ProviderNameProvider name from [[llm.providers]] for heuristic promotion LLM calls.
Use a quality provider — promotion is an offline, non-latency-sensitive analysis. Empty = fall back to the primary provider.
heuristic_promotion_threshold: u32Minimum heuristic count per skill to trigger promotion evaluation. Default: 5.
Skills with fewer heuristics (above erl_min_confidence) are skipped.
heuristic_promotion_interval_hours: u64Interval in hours between promotion evaluation runs. Default: 24.
Implementations§
Trait Implementations§
Source§impl Clone for LearningConfig
impl Clone for LearningConfig
Source§fn clone(&self) -> LearningConfig
fn clone(&self) -> LearningConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LearningConfig
impl Debug for LearningConfig
Source§impl Default for LearningConfig
impl Default for LearningConfig
Source§fn default() -> LearningConfig
fn default() -> LearningConfig
Source§impl<'de> Deserialize<'de> for LearningConfig
impl<'de> Deserialize<'de> for LearningConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LearningConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LearningConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for LearningConfig
impl Serialize for LearningConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for LearningConfig
impl RefUnwindSafe for LearningConfig
impl Send for LearningConfig
impl Sync for LearningConfig
impl Unpin for LearningConfig
impl UnsafeUnpin for LearningConfig
impl UnwindSafe for LearningConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request