

Experimental extension for DuckDB that adds HNSW indexing support to accelerate vector similarity search queries using DuckDB's fixed-size ARRAY type. First custom index type provided through a DuckDB extension.
Loading more......
The vss extension is an experimental extension for DuckDB that adds indexing support to accelerate vector similarity search queries using DuckDB's new fixed-size ARRAY type.
The vss extension introduces support for HNSW (Hierarchical Navigable Small Worlds) indexes to accelerate vector similarity search.
By default the HNSW index will be created using the euclidean distance l2sq (L2-norm squared) metric, matching DuckDB's array_distance function, but other distance metrics can be used by specifying the metric option during index creation. Supported metrics include:
The extension can be installed by running:
INSTALL vss;
LOAD vss;
Here's an example of creating an HNSW index:
CREATE INDEX my_hnsw_index
ON my_vector_table
USING HNSW (vec);
Or with a specific metric:
CREATE INDEX my_hnsw_cosine_index
ON my_vector_table
USING HNSW (vec)
WITH (metric = 'cosine');
The extension is based on the usearch library and represents DuckDB's first custom index type provided through an extension.
The index itself is not buffer managed and must be able to fit into RAM memory. However, the index will be persisted into the database if you run DuckDB with a disk-backed database file.
The vector search extension has received new performance optimizations with new features and improvements since the initial release.
Free and open-source as part of DuckDB.