EpisodicMemory

Struct EpisodicMemory 

Source
pub struct EpisodicMemory { /* private fields */ }
Expand description

Episodic memory for long-term context

Implementations§

Source§

impl EpisodicMemory

Source

pub fn new(storage: Arc<dyn Memory>, agent_id: String) -> Self

Create a new episodic memory

Source

pub fn with_max_episodes(self, max: usize) -> Self

Create episodic memory with custom max episodes

Source

pub async fn store_episode(&self, episode: Episode) -> RragResult<()>

Store an episode

Source

pub async fn get_episode(&self, episode_id: &str) -> RragResult<Option<Episode>>

Retrieve an episode by ID

Source

pub async fn get_recent_episodes( &self, limit: usize, ) -> RragResult<Vec<Episode>>

Get recent episodes

Source

pub async fn find_by_topic(&self, topic: &str) -> RragResult<Vec<Episode>>

Find episodes by topic

Source

pub async fn find_by_importance( &self, min_importance: f64, ) -> RragResult<Vec<Episode>>

Find episodes by importance threshold

Source

pub async fn find_by_date_range( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> RragResult<Vec<Episode>>

Find episodes within a date range

Source

pub async fn get_all_episodes(&self) -> RragResult<Vec<Episode>>

Get all episodes

Source

pub async fn delete_episode(&self, episode_id: &str) -> RragResult<bool>

Delete an episode

Source

pub async fn count(&self) -> RragResult<usize>

Count episodes

Source

pub async fn clear(&self) -> RragResult<()>

Clear all episodes

Source

pub async fn generate_context_summary( &self, num_episodes: usize, ) -> RragResult<String>

Generate a summary from recent episodes

Source

pub async fn create_episode_from_messages( &self, messages: &[ChatMessage], llm_client: &Client, ) -> RragResult<Episode>

Available on crate feature rexis-llm-client only.

Create an episode from conversation messages using LLM summarization (requires ‘rsllm-client’ feature)

Source

pub async fn generate_llm_summary( &self, num_episodes: usize, llm_client: &Client, ) -> RragResult<String>

Available on crate feature rexis-llm-client only.

Generate a comprehensive summary of recent episodes using LLM (requires ‘rsllm-client’ feature)

Source

pub async fn extract_insights( &self, episode: &Episode, llm_client: &Client, ) -> RragResult<Vec<String>>

Available on crate feature rexis-llm-client only.

Extract insights from an episode using LLM analysis (requires ‘rsllm-client’ feature)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,