Skip to main content

EpisodeStore

Trait EpisodeStore 

Source
pub trait EpisodeStore: Send + Sync {
    // Provided methods
    fn project_episode_memory<'life0, 'async_trait>(
        &'life0 self,
        _episode_id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn get_relevant_episodes<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _query: &'life1 str,
        _limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_relevant_episodes_for_channel<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _query: &'life1 str,
        _limit: usize,
        _channel_id: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn get_relevant_episodes_for_session<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _query: &'life1 str,
        _limit: usize,
        _session_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn last_episode_bound<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<EpisodeBound>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn latest_episode_ends<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn record_session_episode<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _episode: &'life1 SessionEpisode,
    ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Episodic memory storage and retrieval.

Provided Methods§

Source

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

Refresh derived canonical-memory projections for an episode. Stores that do not maintain secondary indexes may keep the default no-op.

Source

fn get_relevant_episodes<'life0, 'life1, 'async_trait>( &'life0 self, _query: &'life1 str, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get episodes relevant to a query.

Source

fn get_relevant_episodes_for_channel<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _query: &'life1 str, _limit: usize, _channel_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get episodes for a specific channel context.

Source

fn get_relevant_episodes_for_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _query: &'life1 str, _limit: usize, _session_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Episode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get episodes only from one canonical session (used by untrusted internal/sub-agent origins).

Source

fn last_episode_bound<'life0, 'life1, 'async_trait>( &'life0 self, _session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<EpisodeBound>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Where the session’s most recent episode stopped, if it has one.

Source

fn latest_episode_ends<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

(session id, latest episode end time) for every session with an episode.

Source

fn record_session_episode<'life0, 'life1, 'async_trait>( &'life0 self, _episode: &'life1 SessionEpisode, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record a session episode; returns its id. A store that keeps episodes also embeds the summary for recall.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§