pub trait Memory: Send + Sync {
// Required methods
fn add_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
role: &'life2 str,
content: &'life3 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn add_structured_message<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
message: ConversationMessage,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_conversation_history<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_recent_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn clear_conversation<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_memory_variables<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<HashMap<String, String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save_context<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
context: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Core memory trait for conversation management
Required Methods§
Sourcefn add_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
role: &'life2 str,
content: &'life3 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
role: &'life2 str,
content: &'life3 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Add a message to the conversation
Sourcefn add_structured_message<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
message: ConversationMessage,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_structured_message<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
message: ConversationMessage,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a structured message
Sourcefn get_conversation_history<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_conversation_history<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get conversation history
Sourcefn get_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get structured conversation history
Sourcefn get_recent_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_recent_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
limit: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<ConversationMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get recent messages with limit
Sourcefn clear_conversation<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn clear_conversation<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Clear conversation history
Sourcefn get_memory_variables<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<HashMap<String, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_memory_variables<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = RragResult<HashMap<String, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get memory variables for prompt injection
Sourcefn save_context<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
context: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_context<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
context: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save arbitrary context
Sourcefn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RragResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check