pub struct SearchExplainer {
pub rrf_k: f32,
pub reranking_active: bool,
}Expand description
Generates SearchExplanation values for search results.
Fields§
§rrf_k: f32RRF k parameter (should match SearchConfig::rrf_k).
reranking_active: boolWhether a cross-encoder reranker was active during this search.
Implementations§
Source§impl SearchExplainer
impl SearchExplainer
Sourcepub fn explain_result(
&self,
memory_id: i64,
rank: usize,
bm25: f32,
vector: f32,
fuzzy: f32,
recency: f32,
importance: f32,
rerank: Option<f32>,
final_score: f32,
) -> SearchExplanation
pub fn explain_result( &self, memory_id: i64, rank: usize, bm25: f32, vector: f32, fuzzy: f32, recency: f32, importance: f32, rerank: Option<f32>, final_score: f32, ) -> SearchExplanation
Explain a single search result.
§Parameters
memory_id— ID of the memory being explained.rank— 1-based rank position in the result set.bm25— BM25 keyword relevance score.vector— Vector/semantic similarity score.fuzzy— Fuzzy match score.recency— Recency boost applied.importance— Importance weight.rerank— Cross-encoder score (Noneif reranker inactive).final_score— Final combined score after fusion/reranking.
Sourcepub fn explain_batch(
&self,
results: Vec<(i64, f32, f32, f32, f32, f32, Option<f32>, f32)>,
) -> Vec<SearchExplanation>
pub fn explain_batch( &self, results: Vec<(i64, f32, f32, f32, f32, f32, Option<f32>, f32)>, ) -> Vec<SearchExplanation>
Explain all results in a batch, assigning ranks 1..N in the order given.
Each tuple is (memory_id, bm25, vector, fuzzy, recency, importance, rerank, final_score).
Sourcepub fn generate_explanation(
&self,
rank: usize,
scores: &ScoreBreakdown,
signals: &[SignalContribution],
) -> String
pub fn generate_explanation( &self, rank: usize, scores: &ScoreBreakdown, signals: &[SignalContribution], ) -> String
Build the human-readable explanation string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SearchExplainer
impl RefUnwindSafe for SearchExplainer
impl Send for SearchExplainer
impl Sync for SearchExplainer
impl Unpin for SearchExplainer
impl UnsafeUnpin for SearchExplainer
impl UnwindSafe for SearchExplainer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.