pub trait ArchivalMemory: Send + Sync {
// Required methods
fn insert(
&self,
text: &str,
metadata: HashMap<String, Value>,
) -> impl Future<Output = Result<String>> + Send;
fn search(
&self,
query: &str,
top_k: usize,
) -> impl Future<Output = Result<Vec<ArchivalRecord>>> + Send;
fn delete(&self, id: &str) -> impl Future<Output = Result<bool>> + Send;
fn count(&self) -> impl Future<Output = Result<usize>> + Send;
}Expand description
Required Methods§
Sourcefn insert(
&self,
text: &str,
metadata: HashMap<String, Value>,
) -> impl Future<Output = Result<String>> + Send
fn insert( &self, text: &str, metadata: HashMap<String, Value>, ) -> impl Future<Output = Result<String>> + Send
Stores a fact and returns its assigned id.
Sourcefn search(
&self,
query: &str,
top_k: usize,
) -> impl Future<Output = Result<Vec<ArchivalRecord>>> + Send
fn search( &self, query: &str, top_k: usize, ) -> impl Future<Output = Result<Vec<ArchivalRecord>>> + Send
Returns up to top_k facts most relevant to query, ordered by
descending relevance.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".