You signed in with another tab or window. Reload t
8000
o refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pointed out by @Parikalp-Bhardwaj in #697: VSIM compares the query against every element (src/commands/vset.rs), while Redis 8 vector sets keep an HNSW graph (M and EF on VADD, EF and EPSILON on VSIM). Query time therefore grows linearly with the set size; at 1M+ vectors VSIM throughput will be far below Redis's regardless of how vectors are stored.
We already have an HNSW index for FT.SEARCH vector fields; reusing it (or its design) for vector sets is the obvious first option to check. Things to settle:
recall@10 vs. exact search at Redis's default M/EF, and that EF / EPSILON / TRUTH (exact search on request) behave as in Redis;
welcome @KrishPatel1905, and thanks for offering! this one is staying with the core team though, since it's tied up with the vector-set work already under way in #697. for a first contribution, these are open and well defined: #657 (DEBUG SLEEP with a non-number gives the wrong error), #654 (a consumer created by a timed-out XREADG
BD9D
ROUP is missing after AOF replay) and #655 (the IDMP duplicate counter isn't restored by AOF replay). comment on whichever you pick and it's yours
Plan, decided by the maintainer after reading the code:
One shared HNSW index for FT vector fields and vector sets: generalize src/vector's graph rather than build a second one. It needs byte-string element names, pluggable vector storage (f32 now, Q8/BIN later), and proper deletion (VREM repairs neighbours' links instead of leaving stale in-links). Vectors are stored once, inside the index (~800 B/vector at dim 128 f32, ~450-500 B with Q8, vs 608 today and Redis's 884).
Build order, each step its own PR, measured with benchmarks/vector-sets (recall@10 next to throughput):
0. benchmark: delete-and-re-add phase, FILTER phase, real datasets;
generalize the HNSW with no behaviour change (FT vector benchmarks are the gate);
vector sets on the graph: honour M/EF/EPSILON/TRUTH, real VINFO/VLINKS;
Persistence: rebuild the graph from the vectors on load at first, so the snapshot format doesn't change and 1.2.x downgrades keep working. Saving the graph comes later only if load times at 1M vectors are too slow.
Query planner (our own design, not Redis's fixed-EF approach): for each VSIM, choose by cost:
exact SIMD scan when the set is small, or when a FILTER leaves a small candidate set (recall 1.0, and fast at that size);
graph search when the set is large, with EF picked automatically from the set size to hit a recall target, instead of one fixed default. An explicit EF still overrides it, and TRUTH always scans exactly.
This is the same candidate-first approach that makes our filtered FT.SEARCH faster than Redis and Dragonfly today. The filtered FT benchmark (>= 1.2x Redis) stays a gate for every step.
Also found while reading: DUMP refuses vector-set and time-series keys (#722).
Activity
KrishPatel1905 commentedon Nov 13, 2026
Hi @murtazayusuf,
I'd like to take up this issue as my first contribution to KiviDB.
I've gone through the issue description and understand that it involves improving vector search performance using HNSW indexing.
Since this is my first contribution to the project, could you suggest a smaller, well-defined part of this issue that I can start working on?
I'd be happy to explore the codebase, investigate the existing implementation, and contribute.
Thanks!
murtazayusuf commentedon Nov 13, 2026
welcome @KrishPatel1905, and thanks for offering! this one is staying with the core team though, since it's tied up with the vector-set work already under way in #697. for a first contribution, these are open and well defined: #657 (DEBUG SLEEP with a non-number gives the wrong error), #654 (a consumer created by a timed-out XREADG BD9D ROUP is missing after AOF replay) and #655 (the IDMP duplicate counter isn't restored by AOF replay). comment on whichever you pick and it's yours
murtazayusuf commentedon Nov 13, 2026
Plan, decided by the maintainer after reading the code:
One shared HNSW index for FT vector fields and vector sets: generalize
src/vector's graph rather than build a second one. It needs byte-string element names, pluggable vector storage (f32 now, Q8/BIN later), and proper deletion (VREM repairs neighbours' links instead of leaving stale in-links). Vectors are stored once, inside the index (~800 B/vector at dim 128 f32, ~450-500 B with Q8, vs 608 today and Redis's 884).Build order, each step its own PR, measured with benchmarks/vector-sets (recall@10 next to throughput):
0. benchmark: delete-and-re-add phase, FILTER phase, real datasets;
Persistence: rebuild the graph from the vectors on load at first, so the snapshot format doesn't change and 1.2.x downgrades keep working. Saving the graph comes later only if load times at 1M vectors are too slow.
Query planner (our own design, not Redis's fixed-EF approach): for each VSIM, choose by cost:
EFstill overrides it, andTRUTHalways scans exactly.This is the same candidate-first approach that makes our filtered FT.SEARCH faster than Redis and Dragonfly today. The filtered FT benchmark (>= 1.2x Redis) stays a gate for every step.
Also found while reading: DUMP refuses vector-set and time-series keys (#722).
Merge pull request #991 from kividbio/feat/vset-hnsw
Suite 09 (vector sets): baseline recorded on master, with the HNSW gr…