pub trait MemoryService: Send + Sync {
// Required methods
fn add_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
session_id: &'life3 str,
entries: Vec<MemoryEntry>,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait;
fn search<'life0, 'async_trait>(
&'life0 self,
req: SearchRequest,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided methods
fn delete_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn delete_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
session_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn add_entry<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait { ... }
fn delete_entries<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
query: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<u64, AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait { ... }
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
}Available on crate feature
memory only.Required Methods§
fn add_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
session_id: &'life3 str,
entries: Vec<MemoryEntry>,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn search<'life0, 'async_trait>(
&'life0 self,
req: SearchRequest,
) -> Pin<Box<dyn Future<Output = Result<SearchResponse, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Provided Methods§
Sourcefn delete_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn delete_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Delete all memory entries for a specific user.
Required for GDPR right-to-erasure compliance. Removes all stored memories (including embeddings) for the given app and user.
Sourcefn delete_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
session_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn delete_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
session_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Delete all memory entries for a specific session.
Sourcefn add_entry<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn add_entry<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Add a single memory entry directly (not tied to a session).
Sourcefn delete_entries<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
query: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<u64, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn delete_entries<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
app_name: &'life1 str,
user_id: &'life2 str,
query: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<u64, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Delete entries matching a query. Returns count of deleted entries.
Sourcefn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Verify backend connectivity.
Returns Ok(()) if the backend is reachable and responsive.
The default implementation always succeeds (suitable for in-memory).