pub struct NoteCandidate {
pub id: Uuid,
pub rrf_score: Option<f64>,
pub salience: f64,
pub decay_factor: f64,
pub age_days: f64,
pub effective_salience: f64,
pub rerank_scores: HashMap<String, f64>,
}Expand description
Pre-computed signals for a single memory note candidate.
Used by the recall pipeline’s ComposePipeline to score and rank candidates
via DecayAwareSalienceObjective, TemporalRecencyObjective, and
RerankerObjective without any IO. The runtime layer populates this struct
from stored notes before handing the slice to the pipeline.
See ADR-033 §4.
Fields§
§id: UuidStable note UUID.
rrf_score: Option<f64>Pre-fused RRF score from the retrieval stage (0.0–1.0).
salience: f64Raw salience stored on the note (0.0–1.0).
decay_factor: f64Per-note exponential decay rate (>= 0.0).
age_days: f64Age of the note in days at query time.
effective_salience: f64Salience after applying the configured DecayModel (pre-computed by the caller).
The caller must set this to DecayModel::apply(salience, age_days, decay_factor, half_life)
so that objectives respect the configured decay model variant rather than
always applying exponential decay. When not set, defaults to 0.0.
rerank_scores: HashMap<String, f64>Per-reranker scores populated by the rerank stage. Keyed by reranker name (e.g. “cross_encoder”, “salience”, “graph_proximity”).
Trait Implementations§
Source§impl Clone for NoteCandidate
impl Clone for NoteCandidate
Source§fn clone(&self) -> NoteCandidate
fn clone(&self) -> NoteCandidate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NoteCandidate
impl Debug for NoteCandidate
Source§impl HasId for NoteCandidate
impl HasId for NoteCandidate
Source§impl Objective<NoteCandidate> for AmplifiedDecayAwareSalienceObjective
impl Objective<NoteCandidate> for AmplifiedDecayAwareSalienceObjective
Source§fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
(index, score) pairs. Read moreSource§fn select<'a>(
&self,
candidates: &'a [T],
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select<'a>( &self, candidates: &'a [T], context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§fn select_top<'a>(
&self,
candidates: &'a [T],
n: usize,
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select_top<'a>( &self, candidates: &'a [T], n: usize, context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§impl Objective<NoteCandidate> for DecayAwareSalienceObjective
impl Objective<NoteCandidate> for DecayAwareSalienceObjective
Source§fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
(index, score) pairs. Read moreSource§fn select<'a>(
&self,
candidates: &'a [T],
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select<'a>( &self, candidates: &'a [T], context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§fn select_top<'a>(
&self,
candidates: &'a [T],
n: usize,
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select_top<'a>( &self, candidates: &'a [T], n: usize, context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§impl Objective<NoteCandidate> for RerankerObjective
impl Objective<NoteCandidate> for RerankerObjective
Source§fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
(index, score) pairs. Read moreSource§fn select<'a>(
&self,
candidates: &'a [T],
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select<'a>( &self, candidates: &'a [T], context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§fn select_top<'a>(
&self,
candidates: &'a [T],
n: usize,
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select_top<'a>( &self, candidates: &'a [T], n: usize, context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§impl Objective<NoteCandidate> for RrfFusionObjective
impl Objective<NoteCandidate> for RrfFusionObjective
Source§fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
(index, score) pairs. Read moreSource§fn select<'a>(
&self,
candidates: &'a [T],
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select<'a>( &self, candidates: &'a [T], context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§fn select_top<'a>(
&self,
candidates: &'a [T],
n: usize,
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select_top<'a>( &self, candidates: &'a [T], n: usize, context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Source§impl Objective<NoteCandidate> for TemporalRecencyObjective
impl Objective<NoteCandidate> for TemporalRecencyObjective
Source§fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
fn score(&self, candidate: &NoteCandidate, _context: &ObjectiveContext) -> f64
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
(index, score) pairs. Read more