You signed in with another tab or window. Reload to 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
# Balanced settings for good recall and performance
150
+
m: 16
151
+
ef_construction: 200
152
+
ef_runtime: 10
153
+
154
+
**High-recall configuration:**
155
+
156
+
.. code-block:: yaml
157
+
158
+
- name: embedding
159
+
type: vector
160
+
attrs:
161
+
algorithm: hnsw
162
+
dims: 768
163
+
distance_metric: cosine
164
+
datatype: float32
165
+
# Tuned for maximum accuracy
166
+
m: 32
167
+
ef_construction: 400
168
+
ef_runtime: 50
116
169
117
170
**SVS-VAMANA Vector Field Specific Attributes**:
118
171
119
-
SVS-VAMANA (Scalable Vector Search with VAMANA graph algorithm) provides fast approximate nearest neighbor search with optional compression support. This algorithm is optimized for Intel hardware and offers reduced memory usage through vector compression.
172
+
SVS-VAMANA - High-performance search with optional compression. **Best for large datasets (>100K vectors) on Intel hardware with memory constraints.**
173
+
174
+
.. dropdown:: When to use SVS-VAMANA & Detailed Guide
175
+
:color: info
176
+
177
+
**Requirements:**
178
+
- Redis >= 8.2.0 with RediSearch >= 2.8.10
179
+
- datatype must be 'float16' or 'float32' (float64/bfloat16 not supported)
180
+
181
+
**Use SVS-VAMANA when:**
182
+
- Large datasets where memory is expensive
183
+
- Cloud deployments with memory-based pricing
184
+
- When 90-95% recall is acceptable
185
+
- High-dimensional vectors (>1024 dims) with LeanVec compression
186
+
187
+
**Performance vs other algorithms:**
188
+
- **vs FLAT**: Much faster search, significantly lower memory usage with compression, but approximate results
189
+
190
+
- **vs HNSW**: Better memory efficiency with compression, similar or better recall, Intel-optimized
191
+
192
+
**Compression selection guide:**
193
+
194
+
- **No compression**: Best performance, standard memory usage
120
195
121
-
- `graph_max_degree`: Maximum degree of the Vamana graph, i.e., the number of edges per node (default: 40).
122
-
- `construction_window_size`: Size of the candidate list during graph construction. Higher values yield better quality graphs but increase construction time (default: 250).
123
-
- `search_window_size`: Size of the candidate list during search. Higher values increase accuracy but also increase search latency (default: 20).
124
-
- `epsilon`: Relative factor for range query boundaries (default: 0.01).
- **LVQ4/LVQ8**: Good balance of compression (2x-4x) and performance
126
197
127
-
- `LVQ4`: 4-bit Learned Vector Quantization
128
-
- `LVQ4x4`: 4-bit LVQ with 4x compression
129
-
- `LVQ4x8`: 4-bit LVQ with 8x compression
130
-
- `LVQ8`: 8-bit Learned Vector Quantization
131
-
- `LeanVec4x8`: 4-bit LeanVec with 8x compression and dimensionality reduction
132
-
- `LeanVec8x8`: 8-bit LeanVec with 8x compression and dimensionality reduction
198
+
- **LeanVec4x8/LeanVec8x8**: Maximum compression (up to 8x) with dimensionality reduction
133
199
134
-
- `reduce`: Reduced dimensionality for LeanVec compression. Must be less than `dims`. Only valid with `LeanVec4x8` or `LeanVec8x8` compression types. Lowering this value can speed up search and reduce memory usage (optional).
135
-
- `training_threshold`: Minimum number of vectors required before compression training begins. Must be less than 100 * 1024 (default: 10 * 1024).
- LeanVec4x8 + reduce to 384: 580 MB (~81% savings)
206
+
207
+
.. autoclass:: SVSVectorFieldAttributes
208
+
:members:
209
+
:undoc-members:
210
+
211
+
**SVS-VAMANA Examples:**
212
+
213
+
**Basic configuration (no compression):**
214
+
215
+
.. code-block:: yaml
216
+
217
+
- name: embedding
218
+
type: vector
219
+
attrs:
220
+
algorithm: svs-vamana
221
+
dims: 768
222
+
distance_metric: cosine
223
+
datatype: float32
224
+
# Standard settings for balanced performance
225
+
graph_max_degree: 40
226
+
construction_window_size: 250
227
+
search_window_size: 20
228
+
229
+
**High-performance configuration with compression:**
138
230
139
231
.. code-block:: yaml
140
232
@@ -145,16 +237,155 @@ SVS-VAMANA (Scalable Vector Search with VAMANA graph algorithm) provides fast ap
145
237
dims: 768
146
238
distance_metric: cosine
147
239
datatype: float32
240
+
# Tuned for better recall
148
241
graph_max_degree: 64
149
242
construction_window_size: 500
150
243
search_window_size: 40
244
+
# Maximum compression with dimensionality reduction
151
245
compression: LeanVec4x8
152
-
reduce: 384
246
+
reduce: 384# 50% dimensionality reduction
153
247
training_threshold: 1000
154
248
155
-
Note:
156
-
- SVS-VAMANA requires Redis >= 8.2 with RediSearch >= 2.8.10.
157
-
- SVS-VAMANA only supports `float16` and `float32` datatypes.
158
-
- The `reduce` parameter is only valid with LeanVec compression types (`LeanVec4x8` or `LeanVec8x8`).
159
-
- Intel's proprietary LVQ and LeanVec optimizations are not available in Redis Open Source. On non-Intel platforms and Redis Open Source, SVS-VAMANA with compression falls back to basic 8-bit scalar quantization.
160
-
- See fully documented Redis-supported fields and options here: https://redis.io/commands/ft.create/
- **Datatype limitations**: SVS-VAMANA only supports `float16` and `float32` datatypes (not `bfloat16` or `float64`).
253
+
- **Compression compatibility**: The `reduce` parameter is only valid with LeanVec compression types (`LeanVec4x8` or `LeanVec8x8`).
254
+
- **Platform considerations**: Intel's proprietary LVQ and LeanVec optimizations are not available in Redis Open Source. On non-Intel platforms and Redis Open Source, SVS-VAMANA with compression falls back to basic 8-bit scalar quantization.
255
+
- **Performance tip**: Start with default parameters and tune `search_window_size` first for your speed vs accuracy requirements.
256
+
257
+
**FLAT Vector Field Specific Attributes**:
258
+
259
+
FLAT - Brute-force exact search. **Best for small datasets (<10K vectors) requiring 100% accuracy.**
260
+
261
+
.. dropdown:: When to use FLAT & Performance Details
262
+
:color: info
263
+
264
+
**Use FLAT when:**
265
+
- Small datasets (<10K vectors) where exact results are required
266
+
- Search accuracy is critical and approximate results are not acceptable
267
+
- Baseline comparisons when evaluating approximate algorithms
268
+
- Simple use cases where setup simplicity is more important than performance
269
+
270
+
**Performance characteristics:**
271
+
- **Search accuracy**: 100% exact results (no approximation)
272
+
- **Search speed**: Linear time O(n) - slower as dataset grows
- **Build time**: Fastest index construction (no preprocessing)
275
+
276
+
**Trade-offs vs other algorithms:**
277
+
- **vs HNSW**: Much slower search but exact results, faster index building
278
+
- **vs SVS-VAMANA**: Slower search and higher memory usage, but exact results
279
+
280
+
.. autoclass:: FlatVectorFieldAttributes
281
+
:members:
282
+
:undoc-members:
283
+
284
+
**FLAT Example:**
285
+
286
+
.. code-block:: yaml
287
+
288
+
- name: embedding
289
+
type: vector
290
+
attrs:
291
+
algorithm: flat
292
+
dims: 768
293
+
distance_metric: cosine
294
+
datatype: float32
295
+
# Optional: tune for batch processing
296
+
block_size: 1024
297
+
298
+
**Note**: FLAT is recommended for small datasets or when exact results are mandatory. For larger datasets, consider HNSW or SVS-VAMANA for better performance.
299
+
300
+
.. _vector-algorithm-comparison:
301
+
302
+
Vector Algorithm Comparison
303
+
===========================
304
+
305
+
This section provides detailed guidance for choosing between vector search algorithms.
306
+
307
+
Algorithm Selection Guide
308
+
-------------------------
309
+
310
+
.. list-table:: Vector Algorithm Comparison
311
+
:header-rows: 1
312
+
:widths: 15 20 20 20 25
313
+
314
+
* - Algorithm
315
+
- Best For
316
+
- Performance
317
+
- Memory Usage
318
+
- Trade-offs
319
+
* - **FLAT**
320
+
- Small datasets (<10K vectors)
321
+
- 100% recall, O(n) search
322
+
- Minimal overhead
323
+
- Exact but slow for large data
324
+
* - **HNSW**
325
+
- General purpose (10K-1M+ vectors)
326
+
- 95-99% recall, O(log n) search
327
+
- Moderate (graph overhead)
328
+
- Fast approximate search
329
+
* - **SVS-VAMANA**
330
+
- Large datasets with memory constraints
331
+
- 90-95% recall, O(log n) search
332
+
- Low (with compression)
333
+
- Intel-optimized, requires newer Redis
334
+
335
+
When to Use Each Algorithm
336
+
--------------------------
337
+
338
+
**Choose FLAT when:**
339
+
- Dataset size < 10,000 vectors
340
+
- Exact results are mandatory
341
+
- Simple setup is preferred
342
+
- Query latency is not critical
343
+
344
+
**Choose HNSW when:**
345
+
- Dataset size 10K - 1M+ vectors
346
+
- Need balanced speed and accuracy
347
+
- Cross-platform compatibility required
348
+
- Most common choice for production
349
+
350
+
**Choose SVS-VAMANA when:**
351
+
- Dataset size > 100K vectors
352
+
- Memory usage is a primary concern
353
+
- Running on Intel hardware
354
+
- Can accept 90-95% recall for memory savings
355
+
356
+
Performance Characteristics
357
+
---------------------------
358
+
359
+
**Search Speed:**
360
+
- FLAT: Linear time O(n) - gets slower as data grows
361
+
- HNSW: Logarithmic time O(log n) - scales well
362
+
- SVS-VAMANA: Logarithmic time O(log n) - scales well
363
+
364
+
**Memory Usage (1M vectors, 768 dims, float32):**
365
+
- FLAT: ~3.1 GB (baseline)
366
+
- HNSW: ~3.7 GB (20% overhead for graph)
367
+
- SVS-VAMANA: 1.6-3.1 GB (depends on compression)
368
+
369
+
**Recall Quality:**
370
+
- FLAT: 100% (exact search)
371
+
- HNSW: 95-99% (tunable via ef_runtime)
372
+
- SVS-VAMANA: 90-95% (depends on compression)
373
+
374
+
Migration Considerations
375
+
------------------------
376
+
377
+
**From FLAT to HNSW:**
378
+
- Straightforward migration
379
+
- Expect slight recall reduction but major speed improvement
380
+
- Tune ef_runtime to balance speed vs accuracy
381
+
382
+
**From HNSW to SVS-VAMANA:**
383
+
- Requires Redis >= 8.2 with RediSearch >= 2.8.10
384
+
- Change datatype to float16 or float32 if using others
385
+
- Consider compression options for memory savings
386
+
387
+
**From SVS-VAMANA to others:**
388
+
- May need to change datatype back if using float64/bfloat16
389
+
- HNSW provides similar performance with broader compatibility
390
+
391
+
For complete Redis field documentation, see: https://redis.io/commands/ft.create/
0 commit comments