Skip to main content

ExperienceExtractor

Trait ExperienceExtractor 

Source
pub trait ExperienceExtractor: Send + Sync {
    // Required method
    fn extract<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        conversation: &'life1 [Message],
        outcome: &'life2 AgentOutcome,
        context: &'life3 ExtractionContext,
    ) -> Pin<Box<dyn Future<Output = Vec<NewExperience>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Trait for extracting experiences from an agent’s conversation history.

The default implementation (provided by the framework) uses simple rules to create experiences from the agent’s outcome. Products can override this to implement custom extraction logic (e.g., LLM-based summarization).

Required Methods§

Source

fn extract<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, conversation: &'life1 [Message], outcome: &'life2 AgentOutcome, context: &'life3 ExtractionContext, ) -> Pin<Box<dyn Future<Output = Vec<NewExperience>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Extract experiences from a completed agent conversation.

Called after the agentic loop completes. Returns experiences to be stored in the substrate for future perception by other agents.

Implementors§