pub struct HotCache { /* private fields */ }Expand description
In-memory hot cache for semantic query dedup.
Thin wrapper around totalreclaw_core::hotcache::HotCache<Vec<MemoryEntry>>.
Implementations§
Source§impl HotCache
impl HotCache
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty hot cache with default settings (30 entries, cosine >= 0.85).
Sourcepub fn lookup(&self, query_embedding: &[f32]) -> Option<Vec<MemoryEntry>>
pub fn lookup(&self, query_embedding: &[f32]) -> Option<Vec<MemoryEntry>>
Check if a semantically similar query has already been answered.
Returns cached results if a query with cosine >= 0.85 exists.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HotCache
impl RefUnwindSafe for HotCache
impl Send for HotCache
impl Sync for HotCache
impl Unpin for HotCache
impl UnsafeUnpin for HotCache
impl UnwindSafe for HotCache
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