pub trait VectorStore: Send + Sync {
// Required methods
fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Vec<f32>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
limit: usize,
filters: Option<&'life2 Filters>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Option<Vec<f32>>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
) -> Pin<Box<dyn Future<Output = Result<usize, VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn collection_exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn create_collection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for vector storage backends
Required Methods§
Sourcefn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Vec<f32>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn insert<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Vec<f32>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Insert a record with its embedding
Sourcefn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
limit: usize,
filters: Option<&'life2 Filters>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn search<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
limit: usize,
filters: Option<&'life2 Filters>,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Search for similar vectors
Sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a single record by ID
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a record by ID
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Option<Vec<f32>>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
embedding: Option<Vec<f32>>,
payload: Payload,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update a record
Sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorSearchResult>, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all records with optional filters
Sourcefn delete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
) -> Pin<Box<dyn Future<Output = Result<usize, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
filters: Option<&'life1 Filters>,
) -> Pin<Box<dyn Future<Output = Result<usize, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete all records matching filters
Sourcefn collection_exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn collection_exists<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if collection/index exists
Sourcefn create_collection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_collection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create collection/index if it doesn’t exist