Weaviate

Open-source vector database combining semantic search, hybrid queries, RAG, and image search in a single cloud-native system built for production scale.

16.5Kstars
1.3Kforks
BSD 3-Clause License
Go

Weaviate is an open-source, cloud-native vector database that stores both objects and their vector embeddings in a unified store, enabling semantic search, hybrid queries, and retrieval-augmented generation at scale. It is written entirely in Go and uses HNSW (Hierarchical Navigable Small World) graphs for approximate nearest neighbor search, delivering millisecond query times even over billions of vectors.

The system integrates directly with leading embedding providers including OpenAI, Cohere, HuggingFace, Google, and dozens more, so data can be vectorized automatically at import without external preprocessing pipelines. Alternatively, developers can bring their own pre-computed vectors for full control over the embedding strategy. Hybrid search combining BM25 keyword matching with semantic similarity is built in and available in a single API call.

Weaviate is built for production from the ground up. It ships with native multi-tenancy that physically isolates tenant data at the shard level, configurable replication via Raft consensus, and fine-grained role-based access control. Vector compression using product quantization, scalar quantization, and rotary quantization reduces memory footprint by up to 80% with minimal accuracy loss, making billion-vector deployments economically viable.

Deployment is flexible: run locally via Docker Compose, self-host on Kubernetes, deploy on AWS or GCP Marketplace, or use the fully managed Weaviate Cloud service. Client libraries are available for Python, JavaScript/TypeScript, Java, Go, and C#, alongside REST, gRPC, and GraphQL APIs.

What You Get

  • HNSW-Powered Semantic Search - Approximate nearest neighbor search over billions of vectors in milliseconds using the production-hardened HNSW algorithm, with configurable ef and M parameters for tuning the speed-recall tradeoff.
  • Built-In Vectorization Modules - 69 pluggable modules spanning text, image, and multimodal embedding providers (OpenAI, Cohere, HuggingFace, Google, Mistral, NVIDIA, Ollama, and more) that vectorize data automatically at import time without external pipelines.
  • Hybrid Search (BM25 + Vector) - Combines semantic vector similarity with BM25 keyword scoring in a single query using configurable alpha weighting, returning more relevant results than either method alone.
  • Native RAG via Generative Modules - Built-in generative search that pipes retrieved objects directly into LLMs (OpenAI, Anthropic, Cohere, Google, Mistral, Ollama, etc.) to produce natural-language answers without external orchestration code.
  • Reranking Support - Cross-encoder reranking modules (Cohere, Voyage AI, JinaAI, Nvidia, Transformers) re-score initial search results for higher precision before returning the final ranked list.
  • Multi-Tenancy with Physical Isolation - Each tenant gets a dedicated set of LSMKV shards on disk, providing true data isolation within a shared collection schema — no logical separation risks.
  • Vector Compression (PQ, SQ, BQ, RQ) - Four compression modes (product quantization, scalar quantization, binary quantization, rotary quantization) reduce in-memory vector footprint by up to 80% with configurable accuracy trade-offs.
  • Object TTL (Time-To-Live) - Configurable per-collection expiry that automatically deletes stale objects on a background cron cycle, with full RBAC and multi-tenancy support.
  • Raft-Based Replication & Clustering - Schema changes, RBAC rules, and membership events are managed via Raft consensus for strong consistency, while data replication uses a configurable replication factor for fault tolerance.
  • Image and Multimodal Search - CLIP-based multi2vec and img2vec modules enable searching by image similarity or combining image and text modalities in a single query.

Common Use Cases

  • Retrieval-augmented generation pipelines - Engineering teams embed documents into Weaviate and use the built-in generative modules to retrieve relevant chunks and send them to an LLM, building accurate Q&A systems without assembling separate retrieval and generation infrastructure.
  • E-commerce semantic product search - Retailers vectorize product descriptions, titles, and reviews, then serve customers search results that surface semantically relevant items even when the exact keywords don’t match, improving conversion rates.
  • AI agent persistent memory - Agentic systems store past interactions, user preferences, and domain knowledge in Weaviate, retrieving contextually relevant memories at each step to make informed, personalized decisions across long-running workflows.
  • Multimodal image and content search - Media platforms and design tools index images using CLIP embeddings, letting users find visually similar assets by uploading an example image rather than typing keywords.
  • Duplicate and near-duplicate detection - Data engineering teams vectorize records and query for high-similarity neighbors to identify and deduplicate near-identical entries in large datasets without writing custom similarity logic.
  • Recommendation engines - E-commerce and content platforms encode user interaction signals and item metadata into embeddings, then use Weaviate’s nearest-neighbor queries to surface personalized recommendations in real time.

Under The Hood

Architecture Weaviate follows a layered, modular monolith design with clear boundaries between the API surface, the use-case layer, and storage adapters. The usecases/ package encodes all domain logic — schema management, object CRUD, batch operations, authorization — and depends only on abstract interfaces implemented in adapters/. The storage layer in adapters/repos/db/ uses a custom LSM-KV store (lsmkv) for object data and inverted indexes, while vector indexes live in a separate vector/hnsw/ package that implements the HNSW graph with an append-only commit log for durability. Schema metadata and cluster membership are managed through a Raft FSM (cluster/) whose log entries are the single source of truth for schema changes, RBAC rules, and replication configuration — decoupling the control plane from the data plane entirely. Dependency injection wires concrete implementations at startup through an AppState struct, keeping each layer testable in isolation.

Tech Stack The server is written in Go (1.26+), compiled with CGO disabled and static linking for portability and reproducibility across container targets. The custom LSMKV store implements compaction, bloom filters, roaring bitmaps for inverted posting lists, and memory-mapped segment reads. Vector compression is implemented with SIMD-accelerated Assembly routines for product quantization and scalar quantization, enabling fast distance computations over compressed vectors in memory. The cluster layer uses the hashicorp/raft library with gRPC for peer communication and gossip-based node discovery. Sixty-nine external inference modules are implemented as standalone HTTP microservices (typically Python/FastAPI containers), keeping ML inference stateless and independently scalable outside the Go server. Prometheus metrics and structured logrus logging are wired throughout, with Grafana dashboards provided in the docker-compose/ configuration.

Code Quality Weaviate has extensive test coverage: over 1,600 test files including unit, integration, acceptance, and end-to-end suites organized under test/. Integration tests spin up real Docker environments against live Weaviate nodes, and acceptance tests cover the HTTP and gRPC APIs with both Go and Python clients. Error handling follows explicit Go idioms — errors are wrapped with context at each layer boundary using pkg/errors, and invalid states are caught at the use-case layer before they reach storage. The codebase enforces linting via golangci-lint in CI with pre-commit hooks, uses a consistent copyright header in every file, and applies structured type definitions throughout. A codecov badge with tracked branch coverage and a Go Report Card badge reflect ongoing enforcement.

What Makes It Unique Weaviate’s most distinctive technical decision is treating schema, RBAC, and replication configuration as Raft log entries rather than distributed database state — all schema mutations are atomic, versioned, and replicated before acknowledgment, eliminating split-brain schema inconsistencies that affect systems using Zookeeper or gossip for schema propagation. The multi-tenancy implementation goes a step further than logical separation: each tenant in a multi-tenant collection gets dedicated LSMKV segment files and a dedicated HNSW shard on disk, meaning tenant isolation is enforced at the OS file descriptor level. The module system exposes a clean modulecapabilities interface that lets third-party vectorizers, generative models, and rerankers plug in at runtime without recompiling the server, while keeping ML inference in ephemeral microcontainers that can be scaled and replaced independently. Block Max WAND (BMW) for BM25 scoring — a high-performance early-termination algorithm — enables competitive keyword search performance that most vector databases outsource to Elasticsearch.

Self-Hosting

Weaviate is released under the BSD 3-Clause license, which is one of the most permissive open-source licenses available. It allows anyone to use, modify, and redistribute the software for any purpose — including commercial applications — without requiring source disclosure. The only obligations are attribution (keeping the copyright notice) and not using the Weaviate name to endorse derivative products. There are no copyleft provisions, no contributor license restrictions, and no open-core limitations hiding features behind a commercial license. The full self-hosted binary is identical to what powers Weaviate Cloud.

Running Weaviate yourself requires meaningful infrastructure investment. A production deployment typically involves Kubernetes with persistent volumes for the LSMKV data directory, proper resource limits (Weaviate is memory-intensive because HNSW graphs are held in RAM), and separate containers for each inference module you enable. You are responsible for monitoring (Prometheus + Grafana configurations are provided), backup orchestration using the built-in S3, GCS, or Azure backup modules, rolling upgrades across the Raft cluster, and replication factor tuning to meet your availability requirements. The codebase moves quickly — releasing multiple minor versions per week — so maintaining a self-hosted cluster requires active upgrade discipline to stay on supported versions.

The managed Weaviate Cloud service (console.weaviate.cloud) removes that operational burden: it handles provisioning, upgrades, backups, HA configuration, and monitoring. The Cloud tier also includes a Serverless option priced per vector dimension stored and query volume, which eliminates upfront capacity planning for variable workloads. Enterprise customers on Weaviate Cloud additionally get dedicated clusters, SLA guarantees, priority support, and a bring-your-own-cloud deployment option (BYOC). Self-hosters have access to the public GitHub issues, community Slack, and documentation, but no SLA or priority escalation path.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search