Skip to main content

Module compression

Module compression 

Source
Expand description

Experience compression spectrum (#3305).

This module implements a three-tier memory retrieval policy and a background promotion engine that converts recurring episodic patterns into generated SKILL.md files.

§Tiers

TierDescription
EpisodicRaw conversation snippets, lowest abstraction, highest token cost.
ProceduralTool-use patterns and how-to knowledge.
DeclarativeStable facts and reference knowledge.

§Retrieval policy

RetrievalPolicy maps the current remaining token-budget ratio to a subset of tiers. When the budget is ample (> mid_budget_ratio) all three tiers are queried; as the budget narrows, cheaper tiers are preferred.

§Promotion engine

promotion::PromotionEngine scans a window of recent episodic messages for clustering patterns and promotes qualifying clusters to SKILL.md files.

Re-exports§

pub use promotion::PromotionCandidate;
pub use promotion::PromotionConfig;
pub use promotion::PromotionEngine;
pub use promotion::PromotionInput;

Modules§

promotion
Background skill-promotion engine (#3305).

Structs§

RetrievalPolicy
Token-budget-aware tier selector for context assembly.

Enums§

CompressionLevel
The three abstraction levels in the compression spectrum.