VectorMemory

Trait VectorMemory 

Source
pub trait VectorMemory: Memory {
    // Required methods
    fn embed<'life0, 'life1, 'async_trait>(
        &'life0 self,
        text: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn similarity_search<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        limit: Option<usize>,
        threshold: Option<f32>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(MemoryEntry, f32)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Extended trait for vector-based semantic search

Required Methods§

Source

fn embed<'life0, 'life1, 'async_trait>( &'life0 self, text: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate embedding for text

Semantic similarity search Returns entries with similarity scores (higher = more similar)

Implementors§