Skip to main content

Module tiers

Module tiers 

Source
Expand description

AOI three-layer memory tier promotion.

Provides a background sweep loop that promotes frequently-accessed episodic messages to the semantic tier by:

  1. Finding candidates with session_count >= promotion_min_sessions.
  2. Grouping near-duplicate candidates by cosine similarity (greedy nearest-neighbor).
  3. For each cluster with >= 2 messages, calling the LLM to distill a merged fact.
  4. Validating the merge output (non-empty, similarity >= 0.7 to at least one original).
  5. Inserting the semantic fact and soft-deleting the originals.

The sweep respects a CancellationToken for graceful shutdown, following the same pattern as eviction.rs.

Structs§

TierPromotionConfig
Configuration for the tier promotion sweep, passed from zeph-config::TierPromotionConfig.

Functions§

start_tier_promotion_loop
Start the background tier promotion loop.