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 byrecency_half_life_hours. A cluster whose members were touched recently scores higher.hit_success— meanaccess_count, log-scaled to[0, 1]vialn(1 + n) / ln(1 + hit_saturation).edge_degree— mean (incoming + outgoing) graph-relation count per cluster member, normalised bydegree_saturation.redundancy— mean pairwise cosine similarity of cluster embeddings (skipped when fewer than two members have embeddings, in which case the component is0.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§
- Maturity
Breakdown - Per-component maturity score breakdown, returned alongside the combined score for observability.
- Maturity
Policy - Feedback-driven consolidation policy. The cluster is consolidated
iff
combined >= thresholdand it has at leastmin_cluster_size_floormembers. - Maturity
Saturation - Tunable saturation knobs for the four normalised components. Defaults
are chosen so a “typical” working set lands near
0.5on each axis. - Maturity
Weights - Per-component weights for the maturity score.
Enums§
Functions§
- compute_
cluster_ maturity - Compute the per-cluster maturity breakdown.