Redis 8 introduces Vector Sets as a native data type with integrated HNSW indexing for cosine similarity search. Learn vocabulary for VADD command syntax, VSIM query parameters, EF exploration factor tuning, cosine similarity scoring, filtered search limitations, and comparison with RediSearch vector indexing.
0 / 5 completed
1 / 5
Redis Vector Sets (introduced in Redis 8) store vectors for similarity search. Which command adds a vector to a vector set?
The VADD command syntax is VADD key element FP32|FLOAT16|BFLOAT16|INT8 [dim] [values...] (or providing a BLOB). The element is the name of the vector entry, followed by the type and dimension (for text input) or binary blob. Redis stores the vector with the element name as its identifier for later retrieval.
2 / 5
A developer runs VSIM myvectors ELE query_vec COUNT 10 WITHSCORES. What does the score represent?
Redis Vector Sets use cosine similarity as the default distance metric. The VSIM command returns scores between 0 and 1, where 1.0 indicates identical vectors and 0 indicates orthogonal vectors. Scores are returned in descending order (most similar first) when using WITHSCORES.
3 / 5
A Redis Vector Set is built using HNSW (Hierarchical Navigable Small World) indexing. What parameter controls the search-time accuracy vs performance trade-off during a VSIM query?
EF (exploration factor, set at query time with VSIM ... EF 200) controls the size of the candidate list during HNSW graph traversal. Higher EF values improve recall (more accurate results) at the cost of increased search latency. Lower EF is faster but may miss some nearest neighbors. The build-time M parameter affects graph structure and memory.
4 / 5
A developer wants to filter VSIM results to only return vectors where an associated attribute matches a condition. Redis Vector Sets support this via which mechanism?
As of the initial Redis 8 Vector Sets release, filtered vector search is not built into Vector Sets. The pattern is to perform VSIM for approximate nearest neighbors, then filter results using associated data stored in Hashes or JSON documents. Redis has announced filter support as a planned enhancement.
5 / 5
How does the memory layout of Redis Vector Sets differ from using a Redis Hash with HNSW indexing via RediSearch?
Redis Vector Sets are a native Redis data type (like Strings, Hashes, Lists) with HNSW built directly into the data structure. RediSearch (Redis Stack) implements vector similarity search as a secondary index over data stored in other types (Hashes or JSON). Vector Sets eliminate the need for a separate module for basic vector similarity use cases.