pub struct MemoryManager { /* private fields */ }Expand description
Manages long-term memory storage
Implementations§
Source§impl MemoryManager
impl MemoryManager
Sourcepub fn load_memory(&self) -> Memory
pub fn load_memory(&self) -> Memory
Load the long-term memory
Sourcepub fn save_memory(&self, memory: &Memory) -> Result<()>
pub fn save_memory(&self, memory: &Memory) -> Result<()>
Save the long-term memory
Sourcepub fn load_history(&self) -> String
pub fn load_history(&self) -> String
Load history entries from HISTORY.md
Sourcepub fn append_history(&self, entry: &str) -> Result<()>
pub fn append_history(&self, entry: &str) -> Result<()>
Append an entry to HISTORY.md
Sourcepub fn load_daily_note(&self, date: impl AsRef<str>) -> DailyNote
pub fn load_daily_note(&self, date: impl AsRef<str>) -> DailyNote
Load a daily note
Sourcepub fn load_today_note(&self) -> DailyNote
pub fn load_today_note(&self) -> DailyNote
Load today’s note
Sourcepub fn save_daily_note(&self, note: &DailyNote) -> Result<()>
pub fn save_daily_note(&self, note: &DailyNote) -> Result<()>
Save a daily note
Sourcepub fn list_notes(&self) -> Vec<String>
pub fn list_notes(&self) -> Vec<String>
List all daily notes
Sourcepub fn memory_dir(&self) -> &Path
pub fn memory_dir(&self) -> &Path
Get the memory directory path
Sourcepub fn append_today(&self, content: &str) -> Result<()>
pub fn append_today(&self, content: &str) -> Result<()>
Append content to today’s daily note
Sourcepub fn get_recent_memories(&self, days: usize) -> String
pub fn get_recent_memories(&self, days: usize) -> String
Get memories from the last N days
Sourcepub fn list_memory_files(&self) -> Vec<PathBuf>
pub fn list_memory_files(&self) -> Vec<PathBuf>
List all memory files sorted by date (newest first)
Sourcepub fn get_memory_context(&self) -> String
pub fn get_memory_context(&self) -> String
Get memory context for the agent. The redesigned memory model injects only long-term memory into prompts.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryManager
impl RefUnwindSafe for MemoryManager
impl Send for MemoryManager
impl Sync for MemoryManager
impl Unpin for MemoryManager
impl UnsafeUnpin for MemoryManager
impl UnwindSafe for MemoryManager
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