Skip to main content

EpisodicMemory

Trait EpisodicMemory 

Source
pub trait EpisodicMemory: Send + Sync {
    // Required methods
    fn record(
        &self,
        event_type: &str,
        payload: Value,
    ) -> impl Future<Output = Result<String>> + Send;
    fn query(
        &self,
        query: EpisodicQuery,
    ) -> impl Future<Output = Result<Vec<EpisodicEvent>>> + Send;
    fn clear(&self) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Trait for structured, timestamped event log backends.

Required Methods§

Source

fn record( &self, event_type: &str, payload: Value, ) -> impl Future<Output = Result<String>> + Send

Records an event and returns its assigned id. Implementations stamp timestamp_ms with the current time.

Source

fn query( &self, query: EpisodicQuery, ) -> impl Future<Output = Result<Vec<EpisodicEvent>>> + Send

Returns events matching query, most recent first.

Source

fn clear(&self) -> impl Future<Output = Result<()>> + Send

Removes all recorded events.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§