pub trait RecallStore: FactStore {
// Required methods
fn query_filtered(
&self,
embedding: &[f32],
k: usize,
filter: &Metadata,
offset: usize,
) -> Result<Vec<(u64, f32, String)>, MemoryError>;
fn query_excluding(
&self,
embedding: &[f32],
k: usize,
exclude: &Metadata,
) -> Result<Vec<(u64, f32, String)>, MemoryError>;
}Expand description
Vector recall over stored facts — the surface every
crate::service::MemoryService::recall/search call goes through.
FactStore is a supertrait because these queries return the content
of the facts they rank; a backend cannot rank what it cannot store.
Required Methods§
Sourcefn query_filtered(
&self,
embedding: &[f32],
k: usize,
filter: &Metadata,
offset: usize,
) -> Result<Vec<(u64, f32, String)>, MemoryError>
fn query_filtered( &self, embedding: &[f32], k: usize, filter: &Metadata, offset: usize, ) -> Result<Vec<(u64, f32, String)>, MemoryError>
Vector search for up to k ids, narrowed to facts whose metadata
exactly matches every key in filter.
§Errors
Returns MemoryError if the query fails.
Sourcefn query_excluding(
&self,
embedding: &[f32],
k: usize,
exclude: &Metadata,
) -> Result<Vec<(u64, f32, String)>, MemoryError>
fn query_excluding( &self, embedding: &[f32], k: usize, exclude: &Metadata, ) -> Result<Vec<(u64, f32, String)>, MemoryError>
Vector search for up to k ids, dropping facts whose metadata matches
every key in exclude.
§Errors
Returns MemoryError if the query fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl RecallStore for NativeStore
Available on crate feature
persistence only.