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§
- Collection
Info - Information about a collection.
- Collection
Stats - Statistics about a vector collection.
- InMemory
Vector Store - In-memory vector store for testing purposes.
Enums§
- Vector
Store Provider - Configuration for vector store providers.
Traits§
- Vector
Store - Abstract trait for vector database operations.