NOW LET US – AI RAG SaaS Studio TP.HCM
NOW LET US
Digital Product Studio
Back to news
DEV-TOOLS...1 min read

Show HN: DuckDB community extension for prefiltered HNSW using ACORN-1

Share
NOW LET US Article – Show HN: DuckDB community extension for prefiltered HNSW using ACORN-1

A new fork of the duckdb-vss extension introduces the ACORN-1 algorithm, effectively solving the issue of missing results when combining vector search with complex filter predicates.

This is a fork of duckdb/duckdb-vss that adds ACORN-1 filtered HNSW search. The upstream extension has a critical limitation: WHERE clauses are applied after the HNSW index returns results, so SELECT ... WHERE category = 'X' ORDER BY distance LIMIT 10 often returns fewer than 10 rows. This fork pushes filter predicates into the HNSW graph traversal using the ACORN-1 algorithm, ensuring filtered queries return the correct number of results with high recall.

What changed:

  • Filter predicates are evaluated during HNSW graph traversal, not after.
  • ACORN-1 two-hop expansion through failed neighbors recovers graph connectivity under selective filtering.
  • Selectivity-based strategy switching: >60% selectivity uses post-filter, 1-60% uses ACORN-1, <1% uses brute-force exact scan.
  • Per-node expansion threshold (Lucene's 90% rule) skips two-hop when the neighborhood is already well-connected.
  • Configurable thresholds: SET hnsw_acorn_threshold = 0.6 and SET hnsw_bruteforce_threshold = 0.01.

Benchmark (228k movies, 768-dim Nomic embeddings):

  • Filter Selectivity ~1% to 5%: Upstream returns 0/10 results, while ACORN-1 returns 10/10.

Usage is seamless with standard SQL. The optimizer automatically detects the pattern and applies the filtered HNSW search. It supports prepared statements for parameterized query vectors. Currently, only FLOAT vectors are supported, and the index must fit into RAM, though it is persisted to disk during checkpoints.

© 2026 Now Let Us. All rights reserved.

Source: Hacker News

Advertisement
Ad slot ready: 5887729102

More in this category

EXPLORE TOPICS

Discover All Categories

Deep dive into the specific technology sectors that matter most to you.