pub struct ScoringWeights {
pub similarity: f32,
pub recency: f32,
pub reward: f32,
pub success: f32,
pub region_match: f32,
}Expand description
Scoring weights for Bayesian retrieval ranking.
Each weight controls the contribution of a factor to the final score. Higher score = less relevant (distance-like). Factors are normalized to [0, 1] before weighting.
Fields§
§similarity: f32Weight for semantic similarity (HNSW distance, normalized).
recency: f32Weight for recency factor (1 - exp(-λ·age)).
reward: f32Weight for reward (1 - reward, so higher reward = lower score).
success: f32Weight for typed-edge success score (1 - P(success)).
region_match: f32Weight for region match (0 if same region, 1 if different).
Implementations§
Source§impl ScoringWeights
impl ScoringWeights
Sourcepub fn agent_memory() -> Self
pub fn agent_memory() -> Self
Create weights optimized for agent memory retrieval.
Prioritizes reward and success over recency.
Trait Implementations§
Source§impl Clone for ScoringWeights
impl Clone for ScoringWeights
Source§fn clone(&self) -> ScoringWeights
fn clone(&self) -> ScoringWeights
Returns a copy of the value. Read more
1.0.0 · 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 ScoringWeights
impl Debug for ScoringWeights
Source§impl Default for ScoringWeights
impl Default for ScoringWeights
Source§impl<'de> Deserialize<'de> for ScoringWeights
impl<'de> Deserialize<'de> for ScoringWeights
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ScoringWeights
impl RefUnwindSafe for ScoringWeights
impl Send for ScoringWeights
impl Sync for ScoringWeights
impl Unpin for ScoringWeights
impl UnwindSafe for ScoringWeights
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more