Skip to main content

MemoryProvider

Trait MemoryProvider 

Source
pub trait MemoryProvider: Send + Sync {
    // Required methods
    fn get_all_memories_for_chat<'life0, 'async_trait>(
        &'life0 self,
        chat_id: Option<i64>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_memories_for_context<'life0, 'async_trait>(
        &'life0 self,
        chat_id: i64,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search_memories_with_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        chat_id: i64,
        query: &'life1 str,
        limit: usize,
        include_archived: bool,
        broad_recall: bool,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_memory_by_id<'life0, 'async_trait>(
        &'life0 self,
        id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Memory>, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn insert_memory_with_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        chat_id: Option<i64>,
        content: &'life1 str,
        category: &'life2 str,
        source: &'life3 str,
        confidence: f64,
    ) -> Pin<Box<dyn Future<Output = Result<i64, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn update_memory_with_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        id: i64,
        content: &'life1 str,
        category: &'life2 str,
        confidence: f64,
        source: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn archive_memory<'life0, 'async_trait>(
        &'life0 self,
        id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<bool, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn supersede_memory<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        from_memory_id: i64,
        new_content: &'life1 str,
        category: &'life2 str,
        source: &'life3 str,
        confidence: f64,
        reason: Option<&'life4 str>,
    ) -> Pin<Box<dyn Future<Output = Result<i64, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn touch_memory_last_seen<'life0, 'async_trait>(
        &'life0 self,
        id: i64,
        confidence_floor: Option<f64>,
    ) -> Pin<Box<dyn Future<Output = Result<bool, MicroClawError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn supports_local_semantic_ranking(&self) -> bool { ... }
}

Required Methods§

Source

fn get_all_memories_for_chat<'life0, 'async_trait>( &'life0 self, chat_id: Option<i64>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_memories_for_context<'life0, 'async_trait>( &'life0 self, chat_id: i64, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn search_memories_with_options<'life0, 'life1, 'async_trait>( &'life0 self, chat_id: i64, query: &'life1 str, limit: usize, include_archived: bool, broad_recall: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Memory>, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_memory_by_id<'life0, 'async_trait>( &'life0 self, id: i64, ) -> Pin<Box<dyn Future<Output = Result<Option<Memory>, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn insert_memory_with_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, chat_id: Option<i64>, content: &'life1 str, category: &'life2 str, source: &'life3 str, confidence: f64, ) -> Pin<Box<dyn Future<Output = Result<i64, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn update_memory_with_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: i64, content: &'life1 str, category: &'life2 str, confidence: f64, source: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<bool, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn archive_memory<'life0, 'async_trait>( &'life0 self, id: i64, ) -> Pin<Box<dyn Future<Output = Result<bool, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn supersede_memory<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, from_memory_id: i64, new_content: &'life1 str, category: &'life2 str, source: &'life3 str, confidence: f64, reason: Option<&'life4 str>, ) -> Pin<Box<dyn Future<Output = Result<i64, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Source

fn touch_memory_last_seen<'life0, 'async_trait>( &'life0 self, id: i64, confidence_floor: Option<f64>, ) -> Pin<Box<dyn Future<Output = Result<bool, MicroClawError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§