vector-search
Issue: #123 Date: 2026-01-30T16:27:27-08:00
Summary
Yes, DuckDB does support vector search. DuckDB provides a dedicated Vector Similarity Search (VSS) extension that enables efficient vector similarity queries using HNSW (Hierarchical Navigable Small Worlds) indexes. This allows you to perform embedding-based retrieval and nearest-neighbor searches directly within DuckDB without requiring a separate vector database.
Key Findings
Core Capabilities
- HNSW Indexing: The VSS extension creates HNSW indexes on ARRAY columns to accelerate vector similarity searches
- Distance Metrics: Supports three distance functions:
- L2-norm squared (Euclidean distance)
- Cosine similarity distance
- Negative inner product
- Efficient Queries: Optimizes top-k nearest-neighbor queries with automatic index utilization when using ORDER BY + LIMIT patterns
Installation & Usage
- Install with:
INSTALL vss; LOAD vss;(requires DuckDB v0.10.2+) - Create indexes using standard SQL:
CREATE INDEX ... USING HNSW - Supports dynamic operations (insert, update, delete) on indexed data
- Provides table macros (
vss_join,vss_match) for fuzzy vector joins
Current Limitations
- Only supports 32-bit FLOAT vectors
- Indexes must fit entirely in RAM
- Still considered experimental, though actively maintained with recent feature additions
Active Development
As of October 2024, the VSS extension continues to receive improvements including new distance functions and optimizer enhancements.
Recommendation
If you’re looking for vector search capabilities in DuckDB, the VSS extension is production-ready for most use cases. It’s particularly useful if you want to keep embeddings and analytical queries in a single system rather than managing separate vector and relational databases.