pub struct MemoryIndex { /* private fields */ }Expand description
Memory search index.
Implementations§
Source§impl MemoryIndex
impl MemoryIndex
Sourcepub fn index_workspace(workspace: &Path) -> Result<Self, String>
pub fn index_workspace(workspace: &Path) -> Result<Self, String>
Index all memory files in a workspace.
Sourcepub fn search(&self, query: &str, max_results: usize) -> Vec<SearchResult>
pub fn search(&self, query: &str, max_results: usize) -> Vec<SearchResult>
Search the index using BM25-style scoring.
Sourcepub fn search_with_decay(
&self,
query: &str,
max_results: usize,
half_life_days: f64,
) -> Vec<SearchResult>
pub fn search_with_decay( &self, query: &str, max_results: usize, half_life_days: f64, ) -> Vec<SearchResult>
Search with temporal decay (recency weighting).
Recent memory files are boosted using exponential decay with configurable half-life. Files that don’t have a date in their path (like MEMORY.md) are treated as “evergreen” and don’t decay.
§Arguments
query- Search query stringmax_results- Maximum number of results to returnhalf_life_days- Half-life for temporal decay in days (default: 30)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryIndex
impl RefUnwindSafe for MemoryIndex
impl Send for MemoryIndex
impl Sync for MemoryIndex
impl Unpin for MemoryIndex
impl UnsafeUnpin for MemoryIndex
impl UnwindSafe for MemoryIndex
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