Install and load
Run these commands in a Haybarn SQL session. The extension is available from the community repository.
INSTALL turbovec FROM community;
LOAD turbovec FROM community;
Using upstream DuckDB? Follow the maintainer’s installation instructions.
Usage example
Build a compressed vector index (8-dim vectors, 3 sub-vectors)
-- Build a compressed vector index (8-dim vectors, 3 sub-vectors)
SELECT * FROM turboquant_build_list(
[0.0::FLOAT,1.0,2.0,3.0,4.0,5.0,6.0,7.0],
3, 'my_index'
);
-- Add a vector
SELECT * FROM turboquant_add(
[8.0::FLOAT,9.0,10.0,11.0,12.0,13.0,14.0,15.0],
'my_index'
);
-- Search nearest neighbors
SELECT * FROM turboquant_search('my_index', 'l2', 3);
-- Build concatenated indexes
SELECT * FROM turboquant_build_concat('my_index', 'my_index', 'union');
-- Build IVF index for faster search
SELECT * FROM turboquant_build_ivf('my_index', 10, 'ivf_index', 'l2');
SELECT * FROM turboquant_search_ivf('ivf_index', 'l2', [0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5]::FLOAT[], 3);
Provided by alitrack. Not yet verified on Haybarn 2.0.0.
Sample data & setupAbout this extension
High-performance approximate nearest neighbor (ANN) search using Google's TurboQuant for product quantization and IVF indexing.
Platforms: Linux x64, macOS arm64/x64. Windows and WASM excluded (OpenBLAS dependency).
Project overview from the community descriptor.
Documentation and resources
Project and build details
- Repository
- alitrack/duckdb_turbovec
- License
- MIT
- Maintainers
- alitrack
- Written in
- Rust
- Build source
5d5448d0ae17- Build definition
- Community descriptor