pub async fn search_memory_bank(
workspace_dir: &Path,
query: &str,
limit: usize,
) -> Result<Vec<MemoryBankEntry>, MemoryBankError>Expand description
Search memory bank entries for relevant content
Performs a case-insensitive substring search across both the summary and content fields of all memory bank entries. Results are sorted using the targeted ranking heuristic and then truncated to the requested limit.
§Arguments
workspace_dir- The workspace directory containing.gestura/memory/query- Search query string (case-insensitive)limit- Maximum number of results to return
§Returns
Vector of matching memory bank entries, sorted by timestamp (newest first)
§Errors
Returns MemoryBankError::Io if directory read fails
§Examples
ⓘ
use gestura_core::memory_bank::search_memory_bank;
use std::path::Path;
let workspace = Path::new("/home/user/project");
let results = search_memory_bank(workspace, "authentication", 5).await?;
for entry in results {
println!("Found: {} - {}", entry.timestamp, entry.summary);
}