Skip to main content

VectorStore

Trait VectorStore 

Source
pub trait VectorStore: Send + Sync {
    // Required methods
    fn insert<'life0, 'async_trait>(
        &'life0 self,
        entry: MemoryEntry,
    ) -> Pin<Box<dyn Future<Output = ArgentorResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query_embedding: &'life1 [f32],
        top_k: usize,
        session_filter: Option<Uuid>,
    ) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<SearchResult>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = ArgentorResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
        session_filter: Option<Uuid>,
    ) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<MemoryEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn count<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ArgentorResult<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for vector storage backends.

Required Methods§

Source

fn insert<'life0, 'async_trait>( &'life0 self, entry: MemoryEntry, ) -> Pin<Box<dyn Future<Output = ArgentorResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Insert a memory entry.

Source

fn search<'life0, 'life1, 'async_trait>( &'life0 self, query_embedding: &'life1 [f32], top_k: usize, session_filter: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<SearchResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Search for the top-k most similar entries to a query embedding.

Source

fn delete<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = ArgentorResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete a memory entry by ID.

Source

fn list<'life0, 'async_trait>( &'life0 self, session_filter: Option<Uuid>, ) -> Pin<Box<dyn Future<Output = ArgentorResult<Vec<MemoryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all entries (optionally filtered by session).

Source

fn count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ArgentorResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count entries.

Implementors§