pub struct TreeConfig {
pub enabled: bool,
pub consolidation_provider: ProviderName,
pub sweep_interval_secs: u64,
pub batch_size: usize,
pub similarity_threshold: f32,
pub max_level: u32,
pub context_budget_tokens: usize,
pub recall_top_k: usize,
pub min_cluster_size: usize,
}Expand description
TiMem temporal-hierarchical memory tree configuration (#2262).
When enabled = true, memories are stored as leaf nodes and periodically consolidated
into hierarchical summaries by a background loop. Context assembly uses tree traversal
for complex queries.
Fields§
§enabled: boolEnable the memory tree and background consolidation loop. Default: false.
consolidation_provider: ProviderNameProvider name from [[llm.providers]] for node consolidation.
Should be a fast/cheap model. Falls back to the primary provider when empty.
sweep_interval_secs: u64Interval between consolidation sweeps in seconds. Default: 300.
batch_size: usizeMaximum leaf nodes loaded per sweep batch. Default: 20.
similarity_threshold: f32Cosine similarity threshold for clustering leaves. Default: 0.8.
max_level: u32Maximum tree depth (levels above leaves). Default: 3.
context_budget_tokens: usizeToken budget allocated to tree memory in context assembly. Default: 400.
recall_top_k: usizeNumber of tree nodes retrieved for context. Default: 5.
min_cluster_size: usizeMinimum cluster size before triggering LLM consolidation. Default: 2.
Trait Implementations§
Source§impl Clone for TreeConfig
impl Clone for TreeConfig
Source§fn clone(&self) -> TreeConfig
fn clone(&self) -> TreeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TreeConfig
impl Debug for TreeConfig
Source§impl Default for TreeConfig
impl Default for TreeConfig
Source§impl<'de> Deserialize<'de> for TreeConfigwhere
TreeConfig: Default,
impl<'de> Deserialize<'de> for TreeConfigwhere
TreeConfig: 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 TreeConfig
impl RefUnwindSafe for TreeConfig
impl Send for TreeConfig
impl Sync for TreeConfig
impl Unpin for TreeConfig
impl UnsafeUnpin for TreeConfig
impl UnwindSafe for TreeConfig
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