Skip to main content

VectorClient

Trait VectorClient 

Source
pub trait VectorClient {
    // Required methods
    fn create_vector_index<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        label: &'life1 str,
        property: &'life2 str,
        dimensions: usize,
        metric: DistanceMetric,
    ) -> Pin<Box<dyn Future<Output = GraphmindResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn add_vector<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        label: &'life1 str,
        property: &'life2 str,
        node_id: NodeId,
        vector: &'life3 [f32],
    ) -> Pin<Box<dyn Future<Output = GraphmindResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn vector_search<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        label: &'life1 str,
        property: &'life2 str,
        query_vec: &'life3 [f32],
        k: usize,
    ) -> Pin<Box<dyn Future<Output = GraphmindResult<Vec<(NodeId, f32)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Extension trait for vector search operations.

Only implemented by EmbeddedClient since vector ops need direct store access.

Required Methods§

Source

fn create_vector_index<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, label: &'life1 str, property: &'life2 str, dimensions: usize, metric: DistanceMetric, ) -> Pin<Box<dyn Future<Output = GraphmindResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create a vector index for a given label and property.

Source

fn add_vector<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, label: &'life1 str, property: &'life2 str, node_id: NodeId, vector: &'life3 [f32], ) -> Pin<Box<dyn Future<Output = GraphmindResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Add a vector to the index for a given node.

Search for the k nearest neighbors to a query vector.

Implementors§