Skip to content

Commit b789b62

Browse files
authored
Provide support for the SVS-VMANA index (#3385) (#3386)
* Provide support for the SVS-VMANA index * Enable VAMANA tests for Redis 8.2+
1 parent 6567f2d commit b789b62

File tree

3 files changed

+443
-3
lines changed

3 files changed

+443
-3
lines changed

src/main/java/io/lettuce/core/search/arguments/VectorFieldArgs.java

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,51 @@ public class VectorFieldArgs<K> extends FieldArgs<K> {
3636
* Vector similarity index algorithms.
3737
*/
3838
public enum Algorithm {
39+
3940
/**
4041
* Brute force algorithm.
4142
*/
4243
FLAT,
4344
/**
4445
* Hierarchical, navigable, small world algorithm.
4546
*/
46-
HNSW
47+
HNSW,
48+
/**
49+
* SVS-VAMANA algorithm provides high-performance approximate vector search optimized for specific use cases with
50+
* advanced compression and optimization features.
51+
*
52+
* <p>
53+
* Characteristics:
54+
* <ul>
55+
* <li>High-performance approximate search</li>
56+
* <li>Support for vector compression (LVQ, LeanVec)</li>
57+
* <li>Configurable graph construction and search parameters</li>
58+
* <li>Optimized for Intel platforms with fallback support</li>
59+
* </ul>
60+
*
61+
* <p>
62+
* Note: This algorithm may have specific requirements and limitations. Consult the Redis documentation for detailed
63+
* usage guidelines.
64+
*
65+
* @since Redis 8.2
66+
*/
67+
SVS_VAMANA("SVS-VAMANA");
68+
69+
private final String redisName;
70+
71+
Algorithm() {
72+
this.redisName = name();
73+
}
74+
75+
Algorithm(String redisName) {
76+
this.redisName = redisName;
77+
}
78+
79+
@Override
80+
public String toString() {
81+
return redisName;
82+
}
83+
4784
}
4885

4986
/**
@@ -169,13 +206,32 @@ public Builder<K> flat() {
169206

170207
/**
171208
* Use the HNSW (hierarchical, navigable, small world) algorithm.
172-
*
209+
*
173210
* @return the instance of the {@link Builder} for the purpose of method chaining
174211
*/
175212
public Builder<K> hnsw() {
176213
return algorithm(Algorithm.HNSW);
177214
}
178215

216+
/**
217+
* Use the SVS-VAMANA algorithm for high-performance approximate vector search.
218+
*
219+
* <p>
220+
* SVS-VAMANA provides advanced features including:
221+
* <ul>
222+
* <li>Vector compression support (LVQ, LeanVec)</li>
223+
* <li>Configurable graph construction parameters</li>
224+
* <li>Runtime search optimization</li>
225+
* <li>Intel platform optimizations</li>
226+
* </ul>
227+
*
228+
* @return the instance of the {@link Builder} for the purpose of method chaining
229+
* @since Redis 8.2
230+
*/
231+
public Builder<K> svsVamana() {
232+
return algorithm(Algorithm.SVS_VAMANA);
233+
}
234+
179235
/**
180236
* Set the vector data type.
181237
*
@@ -211,7 +267,7 @@ public Builder<K> distanceMetric(DistanceMetric metric) {
211267

212268
/**
213269
* Add a custom attribute.
214-
*
270+
*
215271
* @param name the attribute name
216272
* @param value the attribute value
217273
* @return the instance of the {@link Builder} for the purpose of method chaining

0 commit comments

Comments
 (0)