pub struct LearningEngine { /* private fields */ }Expand description
Learning engine that improves search quality over time.
The engine uses several mechanisms inspired by the ruvector-gnn crate:
- Experience replay for stable learning
- GNN-style message passing for relevance propagation
- Elastic weight consolidation to prevent catastrophic forgetting
Implementations§
Source§impl LearningEngine
impl LearningEngine
Sourcepub fn rerank(
&self,
query_embedding: &[f32],
candidates: Vec<(Uuid, f32)>,
vectors: &DashMap<Uuid, Vec<f32>>,
) -> Vec<(Uuid, f32)>
pub fn rerank( &self, query_embedding: &[f32], candidates: Vec<(Uuid, f32)>, vectors: &DashMap<Uuid, Vec<f32>>, ) -> Vec<(Uuid, f32)>
Re-rank candidates based on learned patterns.
Sourcepub fn record_query(
&mut self,
query_embedding: &[f32],
results: &[SearchResult],
)
pub fn record_query( &mut self, query_embedding: &[f32], results: &[SearchResult], )
Record a query and its results for learning.
Sourcepub fn record_feedback(&mut self, result_embedding: &[f32], positive: bool)
pub fn record_feedback(&mut self, result_embedding: &[f32], positive: bool)
Record user feedback on a search result.
Sourcepub fn query_count(&self) -> u64
pub fn query_count(&self) -> u64
Get the current query count.
Sourcepub fn stats(&self) -> LearningStats
pub fn stats(&self) -> LearningStats
Get learning statistics.
Auto Trait Implementations§
impl Freeze for LearningEngine
impl !RefUnwindSafe for LearningEngine
impl Send for LearningEngine
impl Sync for LearningEngine
impl Unpin for LearningEngine
impl UnsafeUnpin for LearningEngine
impl UnwindSafe for LearningEngine
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request