pub trait MemoryStore:
Send
+ Sync
+ 'static {
// Required methods
fn put(
&self,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<(), SdkError>> + Send + '_>>;
fn list(
&self,
subject: &str,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, SdkError>> + Send + '_>>;
// Provided methods
fn search(
&self,
_query: &[f32],
_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, SdkError>> + Send + '_>> { ... }
fn delete(
&self,
_id: &str,
) -> Pin<Box<dyn Future<Output = Result<(), SdkError>> + Send + '_>> { ... }
}Expand description
Episodic / semantic / procedural memory store with optional vector search.
Required Methods§
Provided Methods§
Sourcefn search(
&self,
_query: &[f32],
_k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, SdkError>> + Send + '_>>
fn search( &self, _query: &[f32], _k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, SdkError>> + Send + '_>>
Semantic search by embedding (cosine similarity). Returns top-k.
Sourcefn delete(
&self,
_id: &str,
) -> Pin<Box<dyn Future<Output = Result<(), SdkError>> + Send + '_>>
fn delete( &self, _id: &str, ) -> Pin<Box<dyn Future<Output = Result<(), SdkError>> + Send + '_>>
Delete the entry with the given id.
Default returns SdkError::PortNotConfigured — stores that cannot
delete (e.g. append-only audit logs) keep this default. Backends that
support deletion override it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".