Back to browse
GitHub Repository

ACORN-1 pre-filtered HNSW search for DuckDB

62 starsC++

DuckDB community extension for prefiltered HNSW using ACORN-1

by cigrainger·Mar 25, 2026·90 points·5 comments

AI Analysis

●●●BangerBig BrainDark HorseSolve My Problem

ACORN-1 pushes WHERE filters into HNSW traversal, fixing pgvector's post-filter limitation.

Strengths
  • Filter predicates evaluated during HNSW traversal instead of post-filtering results.
  • ACORN-1 two-hop expansion recovers graph connectivity under selective filtering.
  • Benchmarks show 10/10 results on 1% selectivity filters where upstream returns 0/10.
Weaknesses
  • Fork of duckdb-vss requires tracking upstream changes and merging manually.
  • ACORN-1 algorithm is recent (2024 paper) with limited production battle-testing.
Category
Target Audience

Data engineers, ML engineers doing hybrid search with DuckDB

Similar To

pgvector · duckdb-vss · usearch

Post Description

Hey folks! As someone doing hybrid search daily and wishing I could have a pgvector-like experience but with actual prefiltered approximate nearest neighbours, I decided to just take a punt on implementing ACORN on a fork of the DuckDB VSS extension. I had to make some changes to (vendored) usearch that I'm thinking of submitting upstream. But this does the business. Approximate nearest neighbours with WHERE prefiltering.

Similar Projects

Algorithms 1.0.0 – Minimal and clean implementations of algorithms

Files are single-purpose and readable: each algorithm comes with docstrings, type hints, complexity notes and runnable examples so you can read, test, or pip-install bits immediately. It isn't breaking new ground — algorithm collections are common — but the focus on clarity, tests, and a tiny surface API (merge_sort, BinaryHeap, dijkstra, etc.) makes this a reliable reference and teaching aid.

Niche GemCrowd Pleaser
kwk236
703mo ago
AI/MLMid

Agentic Algorithm Engineering

Academic methodology doc, not a working tool — agent frameworks already do this loop.

Bold BetNiche Gem
0x23
102mo ago