Knowledge bases at scale: halfvec, a text index per collection, ef_search raised to the candidates wanted

A search asking for more than 10 passages got at most 40 candidates from
HNSW, pgvector's default ef_search. The full-text arm scored every chunk
holding a word of the question before limiting, over the whole
organization's GIN index; it now takes candidates by ts_rank from the
collection's own partial index and scores those. New collections index
halfvec on pgvector 0.7 and later (up to 4000 dimensions).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-08 22:08:29 +02:00
1 parent 42d3b7ea22
commit 9c675e7293
7 files changed
+223 -26

No files matched your search

@@ -0,0 +1,5 @@
-- How a collection's vectors are indexed: vector (single precision) or
-- halfvec (half, pgvector 0.7 and later), which halves the index a search
-- has to hold in memory for the same recall. Fixed when the collection is
-- made: its index and its queries name the same type.
ALTER TABLE kb_collections ADD COLUMN vec_type TEXT NOT NULL DEFAULT 'vector';