pub trait MemoryStrategy: Send + Sync {
// Required methods
fn load_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
session_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn consolidate_turn<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
user_message: &'life1 str,
assistant_response: &'life2 str,
provider: &'life3 dyn ModelProvider,
model: &'life4 str,
temperature: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait;
fn run_governance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
High-level memory lifecycle policy.
Implemented by strategy objects that wrap one or more Memory backends.
Required Methods§
Sourcefn load_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
session_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn load_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
session_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Load and format relevant memory context for a conversation turn.
Sourcefn consolidate_turn<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
user_message: &'life1 str,
assistant_response: &'life2 str,
provider: &'life3 dyn ModelProvider,
model: &'life4 str,
temperature: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn consolidate_turn<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
user_message: &'life1 str,
assistant_response: &'life2 str,
provider: &'life3 dyn ModelProvider,
model: &'life4 str,
temperature: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Consolidate a conversation turn into long-term memory.