pub trait MemoryBackend: Send + Sync {
Show 17 methods
// Required methods
fn binding(&self) -> &BackendBinding;
fn activity_json<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn embedder_dim<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
) -> Pin<Box<dyn Future<Output = Result<usize, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn entries<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_full<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<FullMemoryRecord, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn log_recall_with_replay<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'life7, 'life8, 'life9, 'life10, 'life11, 'life12, 'life13, 'life14, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
timestamp: &'life2 str,
scope: Option<&'life3 str>,
query_chars: usize,
hit_count: usize,
full_chars: usize,
injected_chars: usize,
source: &'life4 str,
query_excerpt: Option<&'life5 str>,
client: Option<&'life6 str>,
model: Option<&'life7 str>,
session: Option<&'life8 str>,
turn: Option<&'life9 str>,
task: Option<&'life10 str>,
actor: Option<&'life11 str>,
mode: &'life12 str,
replay_hits: &'life13 str,
replay_context: &'life14 str,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryBackendError>> + 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,
'life6: 'async_trait,
'life7: 'async_trait,
'life8: 'async_trait,
'life9: 'async_trait,
'life10: 'async_trait,
'life11: 'async_trait,
'life12: 'async_trait,
'life13: 'async_trait,
'life14: 'async_trait;
fn metrics_json<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn put<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
name: &'life2 str,
content: &'life3 str,
scope: &'life4 str,
tier: MemoryTier,
) -> Pin<Box<dyn Future<Output = Result<MemoryId, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn recall_scored<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
query: &'life2 str,
limit: usize,
scopes: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<(MemoryEntry, Score)>, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn record_injections<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<(), MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn remember<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
content: &'life2 str,
keywords: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<MemoryEntry, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn scopes<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
query: &'life2 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn try_put<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
name: &'life2 str,
content: &'life3 str,
scope: &'life4 str,
tier: MemoryTier,
) -> Pin<Box<dyn Future<Output = Result<MemoryId, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
scope: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryListRow>, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn remember_consolidated<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
name: &'life2 str,
content: &'life3 str,
keywords: Vec<String>,
threshold: Score,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryEntry>, MemoryBackendError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}Expand description
The single memory surface consumed by the host app routes, tools, and Legion adapters.
Methods retain source-compatible arguments and return aliases while making failure explicit for service, embedded, and future migration implementations.
Required Methods§
fn binding(&self) -> &BackendBinding
fn activity_json<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn embedder_dim<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
) -> Pin<Box<dyn Future<Output = Result<usize, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn entries<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_full<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<FullMemoryRecord, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn log_recall_with_replay<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'life7, 'life8, 'life9, 'life10, 'life11, 'life12, 'life13, 'life14, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
timestamp: &'life2 str,
scope: Option<&'life3 str>,
query_chars: usize,
hit_count: usize,
full_chars: usize,
injected_chars: usize,
source: &'life4 str,
query_excerpt: Option<&'life5 str>,
client: Option<&'life6 str>,
model: Option<&'life7 str>,
session: Option<&'life8 str>,
turn: Option<&'life9 str>,
task: Option<&'life10 str>,
actor: Option<&'life11 str>,
mode: &'life12 str,
replay_hits: &'life13 str,
replay_context: &'life14 str,
) -> Pin<Box<dyn Future<Output = Result<(), MemoryBackendError>> + 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,
'life6: 'async_trait,
'life7: 'async_trait,
'life8: 'async_trait,
'life9: 'async_trait,
'life10: 'async_trait,
'life11: 'async_trait,
'life12: 'async_trait,
'life13: 'async_trait,
'life14: 'async_trait,
fn metrics_json<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
name: &'life2 str,
content: &'life3 str,
scope: &'life4 str,
tier: MemoryTier,
) -> Pin<Box<dyn Future<Output = Result<MemoryId, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn recall_scored<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
query: &'life2 str,
limit: usize,
scopes: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<(MemoryEntry, Score)>, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn record_injections<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<(), MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remember<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
content: &'life2 str,
keywords: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<MemoryEntry, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn scopes<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
query: &'life2 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn try_put<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
name: &'life2 str,
content: &'life3 str,
scope: &'life4 str,
tier: MemoryTier,
) -> Pin<Box<dyn Future<Output = Result<MemoryId, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Sourcefn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
scope: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryListRow>, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
scope: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryListRow>, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Production /list operation recorded by CR-000, retained for route migration.
Sourcefn remember_consolidated<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
name: &'life2 str,
content: &'life3 str,
keywords: Vec<String>,
threshold: Score,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryEntry>, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn remember_consolidated<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 CallContext,
name: &'life2 str,
content: &'life3 str,
keywords: Vec<String>,
threshold: Score,
) -> Pin<Box<dyn Future<Output = Result<Option<MemoryEntry>, MemoryBackendError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Production consolidation operation recorded by CR-000, retained for learning migration.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".