pub struct RetrievalCandidate {
pub id: Uuid,
pub vector_score: Option<f64>,
pub text_score: Option<f64>,
pub graph_distance: Option<u32>,
pub rrf_score: Option<f64>,
}Expand description
Pre-computed retrieval signals for a single candidate entity.
All fields are Option — a missing signal scores 0.0. The runtime layer
is responsible for populating whichever fields are available before handing
the slice to an objective.
Fields§
§id: UuidStable entity UUID.
vector_score: Option<f64>Cosine similarity to the query vector (0.0–1.0).
text_score: Option<f64>BM25/FTS relevance score (0.0–1.0 normalised, or raw rank score).
graph_distance: Option<u32>Hop distance from the nearest anchor node (0 = anchor itself).
rrf_score: Option<f64>Pre-fused RRF score from FusionStrategy::Rrf.
Trait Implementations§
Source§impl Clone for RetrievalCandidate
impl Clone for RetrievalCandidate
Source§fn clone(&self) -> RetrievalCandidate
fn clone(&self) -> RetrievalCandidate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RetrievalCandidate
impl Debug for RetrievalCandidate
Source§impl HasId for RetrievalCandidate
impl HasId for RetrievalCandidate
Source§impl Objective<RetrievalCandidate> for VectorSimilarityObjective
impl Objective<RetrievalCandidate> for VectorSimilarityObjective
Source§fn score(
&self,
candidate: &RetrievalCandidate,
_context: &ObjectiveContext,
) -> f64
fn score( &self, candidate: &RetrievalCandidate, _context: &ObjectiveContext, ) -> f64
Evaluate a single candidate.
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Precision (inverse variance) of the score estimate; default 1.0 (fully trusted).
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Check if a score passes the threshold; non-finite scores never pass.
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Check if a candidate passes the threshold.
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
Score a batch of candidates and return passing
(index, score) pairs.Source§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>>
Select all passing candidates in score-descending order.
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>>
Select the top N candidates by precision-weighted score.
Source§impl Objective<RetrievalCandidate> for TextRelevanceObjective
impl Objective<RetrievalCandidate> for TextRelevanceObjective
Source§fn score(
&self,
candidate: &RetrievalCandidate,
_context: &ObjectiveContext,
) -> f64
fn score( &self, candidate: &RetrievalCandidate, _context: &ObjectiveContext, ) -> f64
Evaluate a single candidate.
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Precision (inverse variance) of the score estimate; default 1.0 (fully trusted).
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Check if a score passes the threshold; non-finite scores never pass.
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Check if a candidate passes the threshold.
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
Score a batch of candidates and return passing
(index, score) pairs.Source§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>>
Select all passing candidates in score-descending order.
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>>
Select the top N candidates by precision-weighted score.
Source§impl Objective<RetrievalCandidate> for GraphProximityObjective
impl Objective<RetrievalCandidate> for GraphProximityObjective
Source§fn score(
&self,
candidate: &RetrievalCandidate,
_context: &ObjectiveContext,
) -> f64
fn score( &self, candidate: &RetrievalCandidate, _context: &ObjectiveContext, ) -> f64
Evaluate a single candidate.
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Precision (inverse variance) of the score estimate; default 1.0 (fully trusted).
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Check if a score passes the threshold; non-finite scores never pass.
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Check if a candidate passes the threshold.
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
Score a batch of candidates and return passing
(index, score) pairs.Source§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>>
Select all passing candidates in score-descending order.
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>>
Select the top N candidates by precision-weighted score.
Source§impl Objective<RetrievalCandidate> for RrfFusionObjective
impl Objective<RetrievalCandidate> for RrfFusionObjective
Source§fn score(
&self,
candidate: &RetrievalCandidate,
_context: &ObjectiveContext,
) -> f64
fn score( &self, candidate: &RetrievalCandidate, _context: &ObjectiveContext, ) -> f64
Evaluate a single candidate.
Source§fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
fn precision(&self, _candidate: &T, _context: &ObjectiveContext) -> f64
Precision (inverse variance) of the score estimate; default 1.0 (fully trusted).
Source§fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
fn passes_score(&self, score: f64, context: &ObjectiveContext) -> bool
Check if a score passes the threshold; non-finite scores never pass.
Source§fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
fn passes(&self, candidate: &T, context: &ObjectiveContext) -> bool
Check if a candidate passes the threshold.
Source§fn batch_score(
&self,
candidates: &[T],
context: &ObjectiveContext,
) -> Vec<(usize, f64)>
fn batch_score( &self, candidates: &[T], context: &ObjectiveContext, ) -> Vec<(usize, f64)>
Score a batch of candidates and return passing
(index, score) pairs.Source§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>>
Select all passing candidates in score-descending order.
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>>
Select the top N candidates by precision-weighted score.
Auto Trait Implementations§
impl Freeze for RetrievalCandidate
impl RefUnwindSafe for RetrievalCandidate
impl Send for RetrievalCandidate
impl Sync for RetrievalCandidate
impl Unpin for RetrievalCandidate
impl UnsafeUnpin for RetrievalCandidate
impl UnwindSafe for RetrievalCandidate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more