pub trait MemoryStore: Send + Sync {
// Required methods
fn store<'life0, 'async_trait>(
&'life0 self,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 MemoryQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredMemory>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn dedupe_check<'life0, 'life1, 'async_trait>(
&'life0 self,
content_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn expire_stale<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn search_with_embedding<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 MemoryQuery,
_query_embedding: &'life2 [f32],
) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredMemory>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Expand description
Trait for the recall memory storage backend.
Implementations use SQLite (sqlx for general, libSQL for vectors). All writes go through memory policies (dedupe, importance, TTL).
Required Methods§
Sourcefn store<'life0, 'async_trait>(
&'life0 self,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store<'life0, 'async_trait>(
&'life0 self,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store a new memory entry (after policy enforcement).
Sourcefn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 MemoryQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredMemory>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 MemoryQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredMemory>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Search memories using hybrid BM25 + vector + MMR + temporal decay.
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a memory entry by ID.
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a memory entry by ID.
Sourcefn dedupe_check<'life0, 'life1, 'async_trait>(
&'life0 self,
content_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dedupe_check<'life0, 'life1, 'async_trait>(
&'life0 self,
content_hash: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if content with this hash already exists. Returns the existing entry ID if found.
Provided Methods§
Sourcefn search_with_embedding<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 MemoryQuery,
_query_embedding: &'life2 [f32],
) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredMemory>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn search_with_embedding<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 MemoryQuery,
_query_embedding: &'life2 [f32],
) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredMemory>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Search memories using a caller-supplied query embedding when available.