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.
Interface
Section titled “Interface”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}Registry Usage
Section titled “Registry Usage”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) }}Available Providers
Section titled “Available Providers”| Provider | Registry Name | Type | Distance Strategies |
|---|---|---|---|
| pgvector | pgvector | PostgreSQL extension | Cosine, Dot Product, Euclidean |
| Pinecone | pinecone | Managed cloud | Cosine |
| Qdrant | qdrant | Self-hosted / cloud | Cosine, Dot Product, Euclidean |
| Milvus | milvus | Self-hosted / cloud | Cosine |
| Weaviate | weaviate | Self-hosted / cloud | Cosine |
| ChromaDB | chroma | Self-hosted | Cosine |
| Elasticsearch | elasticsearch | Self-hosted / cloud | Cosine |
| Redis | redis | Self-hosted / cloud | Cosine |
| MongoDB Atlas | mongodb | Managed cloud | Cosine |
| SQLite-vec | sqlitevec | Embedded (CGO) | Euclidean (L2) |
| Turbopuffer | turbopuffer | Managed cloud | Cosine, Dot Product, Euclidean |
| Vespa | vespa | Self-hosted / cloud | Cosine, Dot Product, Euclidean |
| In-Memory | inmemory | In-process | Cosine, Dot Product, Euclidean |
Search Options
Section titled “Search Options”All providers support the same functional options for search configuration:
// Filter by metadataresults, err := store.Search(ctx, queryVec, 10, vectorstore.WithFilter(map[string]any{"category": "technical"}),)
// Set minimum similarity thresholdresults, err := store.Search(ctx, queryVec, 10, vectorstore.WithThreshold(0.8),)
// Select distance strategyresults, err := store.Search(ctx, queryVec, 10, vectorstore.WithStrategy(vectorstore.DotProduct),)Provider Discovery
Section titled “Provider Discovery”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 operationhooks := 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)) },}Choosing a Provider
Section titled “Choosing a Provider”| Use Case | Recommended Provider | Why |
|---|---|---|
| Testing and development | In-Memory | No setup required, deterministic |
| Existing PostgreSQL deployment | pgvector | Vectors co-located with relational data |
| Embedded/edge applications | SQLite-vec | File-based, no server needed |
| Managed cloud with zero ops | Pinecone, Turbopuffer | Automatic scaling, no infrastructure |
| Full-text + vector search | Elasticsearch, Weaviate | Combined keyword and semantic queries |
| High-performance self-hosted | Qdrant, Milvus | Purpose-built for vector workloads at scale |
| Existing Redis infrastructure | Redis | Low-latency, reuses existing deployment |
| Existing MongoDB Atlas | MongoDB Atlas | Vector search integrated with document DB |
| Production search engine | Vespa | Real-time indexing, custom ranking models |