pub struct EpisodicMemoryStore { /* private fields */ }Expand description
Store for episodic memory operations
Handles reading and writing episodic memory entries to daily log files.
Implementations§
Source§impl EpisodicMemoryStore
impl EpisodicMemoryStore
Sourcepub fn new(
config: EpisodicMemoryConfig,
workspace_dir: impl Into<PathBuf>,
) -> Self
pub fn new( config: EpisodicMemoryConfig, workspace_dir: impl Into<PathBuf>, ) -> Self
Create a new episodic memory store
Sourcepub async fn append_with_category(
&self,
category: &str,
content: &str,
) -> Result<()>
pub async fn append_with_category( &self, category: &str, content: &str, ) -> Result<()>
Append an entry with a specific category
Sourcepub async fn read_today(&self) -> Result<Vec<String>>
pub async fn read_today(&self) -> Result<Vec<String>>
Read today’s log entries
Sourcepub async fn read_date(&self, date: NaiveDate) -> Result<Vec<String>>
pub async fn read_date(&self, date: NaiveDate) -> Result<Vec<String>>
Read entries from a specific date
Sourcepub async fn today_entry_count(&self) -> Result<usize>
pub async fn today_entry_count(&self) -> Result<usize>
Get entry count for today
Sourcepub async fn needs_rolling(&self) -> Result<bool>
pub async fn needs_rolling(&self) -> Result<bool>
Check if today’s log needs rolling (exceeded max entries)
Sourcepub async fn list_log_dates(&self) -> Result<Vec<NaiveDate>>
pub async fn list_log_dates(&self) -> Result<Vec<NaiveDate>>
List all log dates
Sourcepub async fn cleanup_old_logs(&self) -> Result<usize>
pub async fn cleanup_old_logs(&self) -> Result<usize>
Clean up old logs based on retention policy
Sourcepub async fn search(&self, pattern: &str) -> Result<Vec<(NaiveDate, String)>>
pub async fn search(&self, pattern: &str) -> Result<Vec<(NaiveDate, String)>>
Search entries across all logs for a pattern
Sourcepub fn config(&self) -> &EpisodicMemoryConfig
pub fn config(&self) -> &EpisodicMemoryConfig
Get the configuration
Auto Trait Implementations§
impl Freeze for EpisodicMemoryStore
impl RefUnwindSafe for EpisodicMemoryStore
impl Send for EpisodicMemoryStore
impl Sync for EpisodicMemoryStore
impl Unpin for EpisodicMemoryStore
impl UnsafeUnpin for EpisodicMemoryStore
impl UnwindSafe for EpisodicMemoryStore
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