Module evolution

Module evolution 

Source
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§

DetectionOptions
Options for evolution detection.
DetectionResult
Result of evolution detection.
EvolutionTracker
Track how memories evolve over time.

Enums§

EvolutionError
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.