Skip to content

feat: salience + recency dual-axis recall ranking #352

Closed

Description

@ajianaz

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 strong

Weight 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 on

Scope

  • Implement salience_score() function
  • Implement recency_score() function with per-type half-life
  • Add --salience / --recency flags to recall CLI
  • Add salience / recency params 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() in operations.rs — single similarity score + importance boost

Activity

  1. added this to the milestone on Jun 14, 2026
  2. added
    enhancement
    scope:core
    scope:cli
    type:feature
    epic:memory-engine
    on Jun 14, 2026
  3. modified the milestones: , v0.2.1 — DX & Ecosystem on Jun 14, 2026
  4. added 5 commits that reference this issue on Jun 18, 2026
  5. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepic:memory-enginepriority:mediumscope:cliscope:coretype:feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions