Skip to main content

Module vectorstore

Module vectorstore 

Source
Expand description

Vector Store Abstraction Layer

This module provides a unified interface for vector database operations, allowing the application to work with multiple vector store backends (LanceDB, Qdrant, pgvector, ChromaDB, Pinecone) through a common trait.

§Architecture

┌─────────────────────────────────────────────────────────────┐
│                      VectorStore Trait                       │
├─────────────────────────────────────────────────────────────┤
│  create_collection  │  search  │  upsert  │  delete  │ ... │
└─────────────────────────────────────────────────────────────┘
         ▲                ▲            ▲           ▲
         │                │            │           │
   ┌─────┴────┐    ┌─────┴────┐  ┌────┴────┐  ┌───┴────┐
   │ LanceDB  │    │  Qdrant  │  │pgvector │  │Pinecone│
   │ (default)│    │          │  │         │  │(cloud) │
   └──────────┘    └──────────┘  └─────────┘  └────────┘

§Example

use ares::db::vectorstore::{VectorStore, VectorStoreProvider};

// Create a LanceDB store (default, local-first)
let store = VectorStoreProvider::LanceDB {
    path: "./data/lancedb".into(),
}.create_store().await?;

// Create a collection
store.create_collection("documents", 384).await?;

// Upsert documents with embeddings
store.upsert("documents", &documents).await?;

// Search
let results = store.search("documents", &query_embedding, 10, 0.5).await?;

Structs§

CollectionInfo
Information about a collection.
CollectionStats
Statistics about a vector collection.
InMemoryVectorStore
In-memory vector store for testing purposes.

Enums§

VectorStoreProvider
Configuration for vector store providers.

Traits§

VectorStore
Abstract trait for vector database operations.