Expand description
Evolution Tracking - Memory Relationship Detection (ADR-016)
TigerStyle: Sim-first, deterministic, graceful degradation.
§Overview
Detects how memories evolve over time by comparing new entities with existing ones using LLM-powered analysis:
- Update: New info replaces old (e.g., “Alice moved to NYC”)
- Extend: New info adds to old (e.g., “Alice also likes hiking”)
- Derive: New info is concluded from old (e.g., “Alice prefers outdoor activities”)
- Contradict: New info conflicts with old (e.g., “Alice hates hiking” vs “Alice loves hiking”)
§Example
ⓘ
use umi_memory::evolution::{EvolutionTracker, DetectionOptions};
use umi_memory::{SimLLMProvider, SimStorageBackend, SimConfig};
#[tokio::main]
async fn main() {
let llm = SimLLMProvider::new(SimConfig::with_seed(42));
let storage = SimStorageBackend::new(SimConfig::with_seed(42));
let tracker = EvolutionTracker::new(llm, storage);
// Detect if new entity evolves from existing
let result = tracker.detect(&new_entity, &existing, DetectionOptions::default()).await;
}Structs§
- Detection
Options - Options for evolution detection.
- Detection
Result - Result of evolution detection.
- Evolution
Tracker - Track how memories evolve over time.
Enums§
- Evolution
Error - Errors that can occur during evolution detection.
Constants§
- EVOLUTION_
DETECTION_ PROMPT - Evolution detection prompt template.
Functions§
- build_
detection_ prompt - Build the evolution detection prompt.
- format_
entity_ for_ prompt - Format an entity for the existing memories list.