Skip to content
Docs

Vector Store Providers — 13 Backends

Beluga AI v2 provides a unified vectorstore.VectorStore interface for storing and searching document embeddings. All providers register via init() and are instantiated through the global registry.

The unified interface means your RAG pipeline works identically across all 13 vector store backends. Start with the in-memory store for development, switch to pgvector or ChromaDB for local testing, and deploy to Pinecone or Qdrant in production — all without changing your application code.

type VectorStore interface {
Add(ctx context.Context, docs []schema.Document, embeddings [][]float32) error
Search(ctx context.Context, query []float32, k int, opts ...SearchOption) ([]schema.Document, error)
Delete(ctx context.Context, ids []string) error
}
import (
"github.com/lookatitude/beluga-ai/config"
"github.com/lookatitude/beluga-ai/rag/vectorstore"
// Register the provider you need via blank import
_ "github.com/lookatitude/beluga-ai/rag/vectorstore/providers/inmemory"
)
func main() {
store, err := vectorstore.New("inmemory", config.ProviderConfig{})
if err != nil {
log.Fatal(err)
}
err = store.Add(ctx, docs, embeddings)
if err != nil {
log.Fatal(err)
}
results, err := store.Search(ctx, queryVec, 10,
vectorstore.WithThreshold(0.7),
)
if err != nil {
log.Fatal(err)
}
}
ProviderRegistry NameTypeDistance Strategies
pgvectorpgvectorPostgreSQL extensionCosine, Dot Product, Euclidean
PineconepineconeManaged cloudCosine
QdrantqdrantSelf-hosted / cloudCosine, Dot Product, Euclidean
MilvusmilvusSelf-hosted / cloudCosine
WeaviateweaviateSelf-hosted / cloudCosine
ChromaDBchromaSelf-hostedCosine
ElasticsearchelasticsearchSelf-hosted / cloudCosine
RedisredisSelf-hosted / cloudCosine
MongoDB AtlasmongodbManaged cloudCosine
SQLite-vecsqlitevecEmbedded (CGO)Euclidean (L2)
TurbopufferturbopufferManaged cloudCosine, Dot Product, Euclidean
VespavespaSelf-hosted / cloudCosine, Dot Product, Euclidean
In-MemoryinmemoryIn-processCosine, Dot Product, Euclidean

All providers support the same functional options for search configuration:

// Filter by metadata
results, err := store.Search(ctx, queryVec, 10,
vectorstore.WithFilter(map[string]any{"category": "technical"}),
)
// Set minimum similarity threshold
results, err := store.Search(ctx, queryVec, 10,
vectorstore.WithThreshold(0.8),
)
// Select distance strategy
results, err := store.Search(ctx, queryVec, 10,
vectorstore.WithStrategy(vectorstore.DotProduct),
)

List all registered providers at runtime:

names := vectorstore.List()
// Returns sorted list: ["chroma", "elasticsearch", "inmemory", ...]

Hooks allow observing vector store operations:

// BeforeAdd is called before each Add operation
// AfterSearch is called after each Search operation
hooks := vectorstore.Hooks{
BeforeAdd: func(ctx context.Context, docs []schema.Document) error {
log.Printf("Adding %d documents", len(docs))
return nil
},
AfterSearch: func(ctx context.Context, results []schema.Document, err error) {
log.Printf("Search returned %d results", len(results))
},
}
Use CaseRecommended ProviderWhy
Testing and developmentIn-MemoryNo setup required, deterministic
Existing PostgreSQL deploymentpgvectorVectors co-located with relational data
Embedded/edge applicationsSQLite-vecFile-based, no server needed
Managed cloud with zero opsPinecone, TurbopufferAutomatic scaling, no infrastructure
Full-text + vector searchElasticsearch, WeaviateCombined keyword and semantic queries
High-performance self-hostedQdrant, MilvusPurpose-built for vector workloads at scale
Existing Redis infrastructureRedisLow-latency, reuses existing deployment
Existing MongoDB AtlasMongoDB AtlasVector search integrated with document DB
Production search engineVespaReal-time indexing, custom ranking models