Skip to main content

MemoryBackend

Trait MemoryBackend 

Source
pub trait MemoryBackend: Send + Sync {
    // Required methods
    fn store_fact<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        category: &'life2 str,
        subject: &'life3 str,
        predicate: &'life4 str,
        object: &'life5 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, ActionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait;
    fn recall<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        top_k: usize,
        namespace: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryFact>, ActionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Optional backend that provides real memory read/write operations.

Required Methods§

Source

fn store_fact<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, namespace: &'life1 str, category: &'life2 str, subject: &'life3 str, predicate: &'life4 str, object: &'life5 str, ) -> Pin<Box<dyn Future<Output = Result<String, ActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Source

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

Implementors§