pub trait Forgetter: Send + Sync {
// Required method
fn maybe_consolidate<'life0, 'life1, 'async_trait>(
&'life0 self,
store: &'life1 Arc<dyn MemoryStore>,
threshold: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Strategy for pruning/consolidating long-term memory when it grows too large.
Implementations decide which files to merge, how to merge them, and what to discard. The trait is intentionally minimal — the “how” of merging (LLM summarization, simple concatenation, etc.) is left to the implementer.
Required Methods§
Sourcefn maybe_consolidate<'life0, 'life1, 'async_trait>(
&'life0 self,
store: &'life1 Arc<dyn MemoryStore>,
threshold: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn maybe_consolidate<'life0, 'life1, 'async_trait>(
&'life0 self,
store: &'life1 Arc<dyn MemoryStore>,
threshold: usize,
) -> Pin<Box<dyn Future<Output = Result<usize, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run consolidation if the L3 file count exceeds threshold.
Returns the number of files removed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".