pub struct MemoryStore { /* private fields */ }Implementations§
Source§impl MemoryStore
impl MemoryStore
Sourcepub fn load(workspace: &Path) -> Self
pub fn load(workspace: &Path) -> Self
Load memory for workspace, or start empty if none exists.
Sourcepub fn from_path(path: PathBuf) -> Self
pub fn from_path(path: PathBuf) -> Self
Load memory from a specific file path (useful for testing).
Sourcepub fn upsert(&mut self, key: &str, value: &str)
pub fn upsert(&mut self, key: &str, value: &str)
Add or update a fact by key (case-insensitive key match).
Sourcepub fn search(&self, query: &str) -> Vec<&ProjectFact>
pub fn search(&self, query: &str) -> Vec<&ProjectFact>
Search facts whose key or value contains query (case-insensitive).
Sourcepub fn all_facts(&self) -> Vec<&ProjectFact>
pub fn all_facts(&self) -> Vec<&ProjectFact>
All facts, most recently updated first.
Sourcepub fn add_episode(
&mut self,
session_id: &str,
summary: &str,
files: Vec<String>,
outcome: &str,
)
pub fn add_episode( &mut self, session_id: &str, summary: &str, files: Vec<String>, outcome: &str, )
Append a session episode (keeps at most 50).
Sourcepub fn format_for_prompt(&self) -> Option<String>
pub fn format_for_prompt(&self) -> Option<String>
Format facts and recent episodes as a prompt section.
Returns None if memory is empty.
pub fn facts_count(&self) -> usize
pub fn episodes_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
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