Repository navigation
Description
Motivation
GBrain uses two orthogonal ranking axes: salience (how much it matters — emotional weight, active takes) and recency (how fresh — effective date, per-type decay). This produces much better recall than a single "relevance score" because "what matters about X" and "what's new about X" are different questions.
Uteke currently ranks by embedding similarity score alone (+ small importance boost). Adding salience and recency as controllable axes gives users power to tune queries without changing the query itself.
Proposal
Add two orthogonal boost parameters to recall: salience and recency.
Current State
final_score = embedding_similarity * 0.8 + importance * 0.2
Proposed State
final_score = embedding_similarity * base_weight
+ salience_boost * salience_weight
+ recency_boost * recency_weight
Where salience_weight and recency_weight default to 0 but can be turned on per-query.
Salience (Mattering)
Computed from existing fields — zero LLM:
fn salience_score(memory: &Memory) -> f32 {
let access_freq = (memory.access_count as f32).log10() / 3.0; // normalized log
let importance = memory.importance;
let pinned_bonus = if memory.pinned { 0.2 } else { 0.0 };
let edge_density = edge_count(memory.id) as f32 / 10.0; // well-connected = important
(access_freq * 0.3 + importance * 0.3 + edge_density * 0.2 + pinned_bonus)
.min(1.0)
}Recency (Freshness)
Per-type decay — different memory types age at different rates:
fn recency_score(memory: &Memory, now: DateTime) -> f32 {
let age_days = (now - memory.created_at).days();
let half_life = match memory.memory_type {
Decision | Preference => 365, // evergreen — decays slowly
Fact | Reference => 180, // semi-evergreen
Event => 30, // time-bound — decays fast
_ => 90, // default
};
(-age_days as f32 / half_life as f32).exp() // exponential decay
}CLI Usage
# Default (neither axis active — current behavior preserved)
uteke recall "database choice"
# Salience on — "what matters most about database choice"
uteke recall "database choice" --salience
# Recency on — "what's new about database choice"
uteke recall "database choice" --recency
# Both — "what important and recent things about database choice"
uteke recall "database choice" --salience --recency
# Recency strong — "very latest about database"
uteke recall "database choice" --recency strongWeight Configuration
Configurable via config file or env vars:
[recall]
salience_weight = 0.15 # when --salience flag is on
recency_weight = 0.15 # when --recency flag is onScope
- Implement
salience_score()function - Implement
recency_score()function with per-type half-life - Add
--salience/--recencyflags torecallCLI - Add
salience/recencyparams to recall API (server + MCP) - Integrate dual-axis scoring into
recall_hybrid() - Add config options for weights
- Ensure backward compat (no flags = current behavior)
- Tests: scoring math, flag behavior, backward compat, per-type decay
Non-Goals
- LLM-based intent detection for auto-enabling axes (manual flags only)
- Emotional weight tracking (GBrain has this; too domain-specific for Uteke)
- "Strong" / "off" / "on" enum (keep simple: flag present = on, absent = off,
--recency strong= boosted weight)
References
- GBrain:
skills/conventions/salience-and-recency.md— dual-axis convention - Current:
recall_hybrid()inoperations.rs— single similarity score + importance boost
Activity
fix(#352): reset salience/recency config after each recall
docs(#352): clarify 'half-life' terminology (it's actually τ)
fix(#352): prevent boost config leak on recall error paths
merge: resolve CHANGELOG conflict with develop (#387)
feat(#352): salience + recency dual-axis recall ranking (#387)
merge: resolve conflicts with develop (#388)
feat(#352): salience + recency dual-axis recall ranking (#387)
wire salience/recency boost weights from uteke.toml into server recall (