pub struct ReasoningConfig {Show 13 fields
pub enabled: bool,
pub extract_provider: ProviderName,
pub distill_provider: ProviderName,
pub top_k: usize,
pub store_limit: usize,
pub max_messages: usize,
pub max_message_chars: usize,
pub context_budget_tokens: usize,
pub min_messages: usize,
pub extraction_timeout_secs: u64,
pub distill_timeout_secs: u64,
pub self_judge_window: usize,
pub min_assistant_chars: usize,
}Expand description
ReasoningBank: distilled reasoning strategy memory configuration (#3342).
When enabled = true, each completed agent turn is evaluated by a self-judge LLM call.
Successful and failed reasoning chains are compressed into short, generalizable strategy
summaries. At context-build time, top-k strategies are retrieved by embedding similarity
and injected into the prompt preamble.
All LLM work (self-judge, distillation) runs asynchronously — never on the turn thread.
§Example
[memory.reasoning]
enabled = true
extract_provider = "fast"
distill_provider = "fast"
top_k = 3
store_limit = 1000Fields§
§enabled: boolEnable the reasoning-bank pipeline. Default: false.
extract_provider: ProviderNameProvider name from [[llm.providers]] for the self-judge step.
Falls back to the primary provider when empty. Default: "".
distill_provider: ProviderNameProvider name from [[llm.providers]] for the distillation step.
Falls back to the primary provider when empty. Default: "".
top_k: usizeNumber of strategies retrieved per turn for context injection. Default: 3.
store_limit: usizeMaximum stored strategies; oldest unused are evicted when limit is reached. Default: 1000.
max_messages: usizeMaximum number of recent messages passed to the self-judge LLM. Default: 6.
max_message_chars: usizePer-message content truncation limit (chars) before building the judge transcript. Default: 2000.
context_budget_tokens: usizeMaximum token budget for injected reasoning strategies in context. Default: 500.
min_messages: usizeMinimum number of messages required before self-judge fires. Default: 2.
extraction_timeout_secs: u64Timeout in seconds for the self-judge LLM call. Default: 30.
distill_timeout_secs: u64Timeout in seconds for the distillation LLM call. Default: 30.
self_judge_window: usizeMaximum number of recent messages passed to the self-judge evaluator.
Narrowing to the last user+assistant pair improves classification accuracy.
Default: 2.
min_assistant_chars: usizeMinimum characters in the assistant response to trigger self-judge.
Short or trivial responses are skipped. Default: 50.
Trait Implementations§
Source§impl Clone for ReasoningConfig
impl Clone for ReasoningConfig
Source§fn clone(&self) -> ReasoningConfig
fn clone(&self) -> ReasoningConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReasoningConfig
impl Debug for ReasoningConfig
Source§impl Default for ReasoningConfig
impl Default for ReasoningConfig
Source§impl<'de> Deserialize<'de> for ReasoningConfigwhere
ReasoningConfig: Default,
impl<'de> Deserialize<'de> for ReasoningConfigwhere
ReasoningConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ReasoningConfig
impl RefUnwindSafe for ReasoningConfig
impl Send for ReasoningConfig
impl Sync for ReasoningConfig
impl Unpin for ReasoningConfig
impl UnsafeUnpin for ReasoningConfig
impl UnwindSafe for ReasoningConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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