pub trait Store {
// Required methods
fn index(
&mut self,
project_id: &str,
content: &str,
meta: &SessionMeta,
) -> Result<String, Error>;
fn search(
&mut self,
project_id: &str,
query: &str,
limit: usize,
) -> Result<Vec<SearchResult>, Error>;
fn delete_by_session(
&mut self,
project_id: &str,
session_id: &str,
) -> Result<usize, Error>;
fn cleanup_stale(
&mut self,
project_id: &str,
max_age_secs: i64,
) -> Result<usize, Error>;
}Expand description
Backend for storing and searching indexed command output.
Implementations can use different storage mechanisms (SQLite, Vipune, etc.) to persist and retrieve command output for later recall.
Required Methods§
Sourcefn index(
&mut self,
project_id: &str,
content: &str,
meta: &SessionMeta,
) -> Result<String, Error>
fn index( &mut self, project_id: &str, content: &str, meta: &SessionMeta, ) -> Result<String, Error>
Index a command output entry for later retrieval.
Returns the unique identifier of the indexed entry.
Sourcefn search(
&mut self,
project_id: &str,
query: &str,
limit: usize,
) -> Result<Vec<SearchResult>, Error>
fn search( &mut self, project_id: &str, query: &str, limit: usize, ) -> Result<Vec<SearchResult>, Error>
Search for indexed entries matching a query.
Returns up to limit results ordered by relevance.