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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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