Skip to main content

MemoryExtractor

Trait MemoryExtractor 

Source
pub trait MemoryExtractor: Send + Sync {
    // Required method
    fn extract<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        namespace: &'life1 str,
        user_input: &'life2 str,
        assistant_output: &'life3 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryItem>, MemoryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Turns a completed conversation turn into durable memories.

Implementations call an LLM, apply heuristics, or simply filter; returning an empty vector means “nothing worth remembering from this turn”. The agent executor runs this on a detached task so a slow extractor never blocks the control loop.

Required Methods§

Source

fn extract<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, namespace: &'life1 str, user_input: &'life2 str, assistant_output: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryItem>, MemoryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Extracts zero or more memories from one user/assistant exchange.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§