VectorMemoryAdapter

Trait VectorMemoryAdapter 

Source
pub trait VectorMemoryAdapter: MemoryAdapter {
    // Required methods
    fn upsert_vector<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        run_id: RunId,
        namespace: &'life1 str,
        key: &'life2 str,
        embedding: Vec<f32>,
        metadata: Value,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn query_vector<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        run_id: RunId,
        namespace: &'life1 str,
        embedding: &'life2 [f32],
        top_k: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<VectorMatch>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Optional extension for vector-aware memory backends (e.g., embeddings DB).

Required Methods§

Source

fn upsert_vector<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run_id: RunId, namespace: &'life1 str, key: &'life2 str, embedding: Vec<f32>, metadata: Value, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn query_vector<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, run_id: RunId, namespace: &'life1 str, embedding: &'life2 [f32], top_k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<VectorMatch>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§