pub struct ConsolidationConfig {
pub enabled: bool,
pub namespace_filter: Option<Vec<Namespace>>,
pub time_window_days: Option<u32>,
pub min_memories_to_consolidate: usize,
pub similarity_threshold: f32,
}Expand description
Runtime consolidation configuration.
Controls LLM-powered memory consolidation that summarizes related memories while preserving original details.
§Defaults
enabled: false (requires LLM provider to be useful)namespace_filter: None (all namespaces)time_window_days: Some(30) (last 30 days)min_memories_to_consolidate: 3 (need at least 3 related memories)similarity_threshold: 0.7 (70% semantic similarity)
§Environment Variables
| Variable | Description | Default |
|---|---|---|
SUBCOG_CONSOLIDATION_ENABLED | Enable consolidation | false |
SUBCOG_CONSOLIDATION_TIME_WINDOW_DAYS | Time window in days | 30 |
SUBCOG_CONSOLIDATION_MIN_MEMORIES | Minimum memories to consolidate | 3 |
SUBCOG_CONSOLIDATION_SIMILARITY_THRESHOLD | Similarity threshold (0.0-1.0) | 0.7 |
Fields§
§enabled: boolWhether consolidation is enabled.
namespace_filter: Option<Vec<Namespace>>Filter to specific namespaces (None = all namespaces).
time_window_days: Option<u32>Time window in days for consolidation (None = no time limit).
min_memories_to_consolidate: usizeMinimum number of memories required to trigger consolidation.
similarity_threshold: f32Similarity threshold for grouping related memories (0.0-1.0).
Implementations§
Source§impl ConsolidationConfig
impl ConsolidationConfig
Sourcepub fn from_config_file(file: &ConfigFileConsolidation) -> Self
pub fn from_config_file(file: &ConfigFileConsolidation) -> Self
Creates configuration from config file settings.
Sourcepub fn with_env_overrides(self) -> Self
pub fn with_env_overrides(self) -> Self
Applies environment variable overrides.
Sourcepub const fn with_enabled(self, enabled: bool) -> Self
pub const fn with_enabled(self, enabled: bool) -> Self
Sets whether consolidation is enabled.
Sourcepub fn with_namespace_filter(self, filter: Vec<Namespace>) -> Self
pub fn with_namespace_filter(self, filter: Vec<Namespace>) -> Self
Sets the namespace filter.
Sourcepub const fn with_time_window_days(self, days: Option<u32>) -> Self
pub const fn with_time_window_days(self, days: Option<u32>) -> Self
Sets the time window in days.
Sourcepub const fn with_min_memories(self, min: usize) -> Self
pub const fn with_min_memories(self, min: usize) -> Self
Sets the minimum number of memories to consolidate.
Sourcepub const fn with_similarity_threshold(self, threshold: f32) -> Self
pub const fn with_similarity_threshold(self, threshold: f32) -> Self
Sets the similarity threshold.
Value is clamped to the range [0.0, 1.0].
Sourcepub fn build(self) -> Result<Self, ConfigValidationError>
pub fn build(self) -> Result<Self, ConfigValidationError>
Validates the configuration.
§Errors
Returns an error if:
min_memories_to_consolidateis less than 2similarity_thresholdis not in range [0.0, 1.0]time_window_daysis 0 (if set)
Trait Implementations§
Source§impl Clone for ConsolidationConfig
impl Clone for ConsolidationConfig
Source§fn clone(&self) -> ConsolidationConfig
fn clone(&self) -> ConsolidationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConsolidationConfig
impl Debug for ConsolidationConfig
Auto Trait Implementations§
impl Freeze for ConsolidationConfig
impl RefUnwindSafe for ConsolidationConfig
impl Send for ConsolidationConfig
impl Sync for ConsolidationConfig
impl Unpin for ConsolidationConfig
impl UnwindSafe for ConsolidationConfig
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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].