pub struct MemoryRanker { /* private fields */ }Expand description
Memory ranker for scoring and sorting memories
Implementations§
Source§impl MemoryRanker
impl MemoryRanker
Sourcepub fn with_weights(weights: RankingWeights) -> Self
pub fn with_weights(weights: RankingWeights) -> Self
Create a ranker with custom weights
Sourcepub fn with_recency_half_life(self, hours: f32) -> Self
pub fn with_recency_half_life(self, hours: f32) -> Self
Set recency half-life in hours
Sourcepub fn score(&self, entry: &MemoryEntry, query_embedding: &[f32]) -> f32
pub fn score(&self, entry: &MemoryEntry, query_embedding: &[f32]) -> f32
Calculate composite relevance score
Sourcepub fn rank(
&self,
query_embedding: &[f32],
memories: Vec<MemoryEntry>,
) -> Vec<MemoryEntry>
pub fn rank( &self, query_embedding: &[f32], memories: Vec<MemoryEntry>, ) -> Vec<MemoryEntry>
Rank memories by relevance to query
Sourcepub fn rank_with_scores(
&self,
query_embedding: &[f32],
memories: Vec<MemoryEntry>,
) -> Vec<(f32, MemoryEntry)>
pub fn rank_with_scores( &self, query_embedding: &[f32], memories: Vec<MemoryEntry>, ) -> Vec<(f32, MemoryEntry)>
Rank memories and return with scores
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryRanker
impl RefUnwindSafe for MemoryRanker
impl Send for MemoryRanker
impl Sync for MemoryRanker
impl Unpin for MemoryRanker
impl UnsafeUnpin for MemoryRanker
impl UnwindSafe for MemoryRanker
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