Skip to main content

MemoryStore

Trait MemoryStore 

Source
pub trait MemoryStore: Send + Sync {
    // Required methods
    fn store<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        key: &'life2 str,
        value: Value,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn retrieve<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Value>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn search<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        query: &'life2 str,
        top_k: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryHit>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for memory storage backends

Required Methods§

Source

fn store<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, namespace: &'life1 str, key: &'life2 str, value: Value, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store a memory fact

Source

fn retrieve<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, namespace: &'life1 str, key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Value>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieve a memory fact

Source

fn search<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, namespace: &'life1 str, query: &'life2 str, top_k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryHit>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Semantic search over stored memories

Source

fn delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, namespace: &'life1 str, key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete a memory fact

Implementors§