pub trait VecStore: Send + Sync {
// Required methods
fn add<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
items: &'life1 [VecStoreItem],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn search<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query_vector: &'life1 [f32],
top_k: usize,
filter: Option<&'life2 HashMap<String, Value>>,
collection: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VecSearchHit>, VecStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn get_by_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VecStoreItem>, VecStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn upsert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
items: &'life1 [VecStoreItem],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Vector store abstraction (subset of MemOS BaseVecDB).
Required Methods§
Sourcefn add<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
items: &'life1 [VecStoreItem],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
items: &'life1 [VecStoreItem],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Add items (id, vector, payload).
Sourcefn search<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query_vector: &'life1 [f32],
top_k: usize,
filter: Option<&'life2 HashMap<String, Value>>,
collection: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VecSearchHit>, VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn search<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
query_vector: &'life1 [f32],
top_k: usize,
filter: Option<&'life2 HashMap<String, Value>>,
collection: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VecSearchHit>, VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Search by vector.
Sourcefn get_by_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VecStoreItem>, VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_by_ids<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VecStoreItem>, VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get by ids.
Sourcefn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ids: &'life1 [String],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete by ids.
Sourcefn upsert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
items: &'life1 [VecStoreItem],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upsert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
items: &'life1 [VecStoreItem],
collection: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), VecStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Upsert items: insert or replace by id. Ensures full payload and avoids delete+add window.