VectorStore

Trait VectorStore 

Source
pub trait VectorStore: Send + Sync {
    // Required methods
    fn add_passages<'life0, 'async_trait>(
        &'life0 self,
        passages: Vec<Passage>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query_embedding: &'life1 [f32],
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Passage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A trait defining the capabilities of a vector database backend.

Required Methods§

Source

fn add_passages<'life0, 'async_trait>( &'life0 self, passages: Vec<Passage>, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Ingests a list of passages into the store.

Source

fn search<'life0, 'life1, 'async_trait>( &'life0 self, query_embedding: &'life1 [f32], limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Passage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Searches for the nearest neighbors given a query embedding.

Implementors§