pub struct EpisodicMemory { /* private fields */ }Expand description
Episodic memory for managing past conversations
Implementations§
Source§impl EpisodicMemory
impl EpisodicMemory
Sourcepub async fn new(
backend: Arc<dyn Memory>,
config: MemoryConfig,
) -> Result<Self, String>
pub async fn new( backend: Arc<dyn Memory>, config: MemoryConfig, ) -> Result<Self, String>
Create a new episodic memory instance
Sourcepub async fn store(&self, entry: EnhancedMemoryEntry) -> Result<String, String>
pub async fn store(&self, entry: EnhancedMemoryEntry) -> Result<String, String>
Store a memory in episodic storage
Sourcepub async fn get(&self, id: &str) -> Result<Option<EnhancedMemoryEntry>, String>
pub async fn get(&self, id: &str) -> Result<Option<EnhancedMemoryEntry>, String>
Retrieve a memory by ID
Sourcepub async fn get_by_time_range(
&self,
agent_id: &str,
range: TimeRange,
) -> Result<Vec<EnhancedMemoryEntry>, String>
pub async fn get_by_time_range( &self, agent_id: &str, range: TimeRange, ) -> Result<Vec<EnhancedMemoryEntry>, String>
Get memories within a time range
Sourcepub async fn get_by_relevance(
&self,
agent_id: &str,
min_score: f32,
limit: usize,
) -> Result<Vec<EnhancedMemoryEntry>, String>
pub async fn get_by_relevance( &self, agent_id: &str, min_score: f32, limit: usize, ) -> Result<Vec<EnhancedMemoryEntry>, String>
Get memories by relevance score
Sourcepub async fn get_by_importance(
&self,
agent_id: &str,
min_importance: ImportanceLevel,
) -> Result<Vec<EnhancedMemoryEntry>, String>
pub async fn get_by_importance( &self, agent_id: &str, min_importance: ImportanceLevel, ) -> Result<Vec<EnhancedMemoryEntry>, String>
Get memories by importance level
Sourcepub async fn search(
&self,
agent_id: &str,
query: &str,
) -> Result<Vec<EnhancedMemoryEntry>, String>
pub async fn search( &self, agent_id: &str, query: &str, ) -> Result<Vec<EnhancedMemoryEntry>, String>
Search memories by content
Sourcepub async fn get_temporal_clusters(
&self,
agent_id: &str,
cluster_gap_hours: u64,
) -> Result<Vec<Vec<EnhancedMemoryEntry>>, String>
pub async fn get_temporal_clusters( &self, agent_id: &str, cluster_gap_hours: u64, ) -> Result<Vec<Vec<EnhancedMemoryEntry>>, String>
Get temporal clusters (conversations grouped by time proximity)
Sourcepub async fn get_activity_summary(
&self,
agent_id: &str,
days: u64,
) -> Result<ActivitySummary, String>
pub async fn get_activity_summary( &self, agent_id: &str, days: u64, ) -> Result<ActivitySummary, String>
Get summary of recent activity
Auto Trait Implementations§
impl Freeze for EpisodicMemory
impl !RefUnwindSafe for EpisodicMemory
impl Send for EpisodicMemory
impl Sync for EpisodicMemory
impl Unpin for EpisodicMemory
impl !UnwindSafe for EpisodicMemory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more