Skip to main content

Module maturity

Module maturity 

Source
Expand description

Feedback-driven consolidation trigger metric.

Opt-in scalar “maturity / generalizability” score per memory cluster that gates crate::query::lifecycle::run_consolidation when the engine is configured with ConsolidationPolicy::MaturityDriven. The fixed-schedule / min-cluster-size behaviour remains the default — this module is purely additive.

§Score

Four components, each normalised to [0, 1] and combined as a weight-normalised sum so a zeroed weight contributes nothing rather than re-weighting the rest:

  • recency — mean access-recency across the cluster, decayed by recency_half_life_hours. A cluster whose members were touched recently scores higher.
  • hit_success — mean access_count, log-scaled to [0, 1] via ln(1 + n) / ln(1 + hit_saturation).
  • edge_degree — mean (incoming + outgoing) graph-relation count per cluster member, normalised by degree_saturation.
  • redundancy — mean pairwise cosine similarity of cluster embeddings (skipped when fewer than two members have embeddings, in which case the component is 0.5 — neutral, neither helpful nor harmful).

Consolidation fires when combined >= threshold AND the cluster has at least min_cluster_size_floor members.

§Prior art

Internal note (not user-facing): FluxMem (arXiv:2605.28773) frames consolidation as a feedback-driven control loop with a scalar maturity score gating the trigger. mnemo’s policy is a structural cousin — same four-axis intuition (recency, hit-feedback, graph degree, neighbour redundancy) wired into the existing tag-overlap clusterer rather than a learned cluster-er. Cited as prior art only.

Structs§

MaturityBreakdown
Per-component maturity score breakdown, returned alongside the combined score for observability.
MaturityPolicy
Feedback-driven consolidation policy. The cluster is consolidated iff combined >= threshold and it has at least min_cluster_size_floor members.
MaturitySaturation
Tunable saturation knobs for the four normalised components. Defaults are chosen so a “typical” working set lands near 0.5 on each axis.
MaturityWeights
Per-component weights for the maturity score.

Enums§

ConsolidationPolicy
Policy for crate::query::lifecycle::run_consolidation.

Functions§

compute_cluster_maturity
Compute the per-cluster maturity breakdown.