pub struct EvolutionTracker<L: LLMProvider, S: StorageBackend> { /* private fields */ }Expand description
Track how memories evolve over time.
Uses LLM to detect relationships between new and existing memories.
§Type Parameters
L: LLM provider for detection (SimLLMProvider for testing)S: Storage backend for entity lookup
§Example
ⓘ
let tracker = EvolutionTracker::new(llm, storage);
let result = tracker.detect(&new_entity, &existing, DetectionOptions::default()).await?;
if let Some(detection) = result {
println!("Evolution: {:?}", detection.evolution_type());
}Implementations§
Source§impl<L: LLMProvider, S: StorageBackend> EvolutionTracker<L, S>
impl<L: LLMProvider, S: StorageBackend> EvolutionTracker<L, S>
Sourcepub async fn detect(
&self,
new_entity: &Entity,
existing_entities: &[Entity],
options: DetectionOptions,
) -> Result<Option<DetectionResult>, EvolutionError>
pub async fn detect( &self, new_entity: &Entity, existing_entities: &[Entity], options: DetectionOptions, ) -> Result<Option<DetectionResult>, EvolutionError>
Detect evolution relationship between new and existing entities.
§Arguments
new_entity- Newly created entityexisting_entities- Related existing entities to compare againstoptions- Detection options
§Returns
Ok(Some(DetectionResult)) if evolution detected above threshold,
Ok(None) if no relationship found or detection failed (graceful degradation),
Err(EvolutionError) for invalid options.
§Graceful Degradation
LLM failures return Ok(None) instead of errors to avoid breaking
the calling code’s flow.
Auto Trait Implementations§
impl<L, S> Freeze for EvolutionTracker<L, S>where
L: Freeze,
impl<L, S> RefUnwindSafe for EvolutionTracker<L, S>where
L: RefUnwindSafe,
S: RefUnwindSafe,
impl<L, S> Send for EvolutionTracker<L, S>
impl<L, S> Sync for EvolutionTracker<L, S>
impl<L, S> Unpin for EvolutionTracker<L, S>
impl<L, S> UnwindSafe for EvolutionTracker<L, S>where
L: UnwindSafe,
S: UnwindSafe,
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
Mutably borrows from an owned value. Read more