Skip to content

Commit 2cbbae4

Browse files
nkanu17Nitin Kanukolanu
andauthored
Feat/raae 1094 add svs vamana implementation (#404)
Adds SVS-VAMANA support to redis-vl-python, including compression options. **Highlights** - New SVSVectorField + VectorIndexAlgorithm.SVS_VAMANA. - Compression enums: LVQ4, LVQ4x4, LVQ4x8, LVQ8, LeanVec4x8, LeanVec8x8. - Validation: only float16/float32; reduce < dims; reduce allowed only with LeanVec. - Capability checks (sync/async): block create if requirements not met; clear RedisModuleVersionError. - CompressionAdvisor: recommend configs + estimate memory savings. **Requirements** - Redis ≥ 8.2.0 and RediSearch ≥ 2.8.10 (or SearchLight ≥ 2.8.10) for SVS-Vamana - Backwards compatible, just can't use SVS-Vamana. **Compatibility** - No breaking changes for flat/hnsw. - Backwards compatible, just can't use SVS-Vamana. Docs & Tests - Docs: schema.rst adds SVS section + example. - Tests: validation, capability detection, CompressionAdvisor, and basic integration. - Notebook or python guide on usage --------- Co-authored-by: Nitin Kanukolanu <nitin.kanukolanu@redis.com>
1 parent f0d2154 commit 2cbbae4

23 files changed

+3356
-78
lines changed

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ test-all: ## Run all tests including API tests
5858

5959
test-notebooks: ## Run notebook tests
6060
@echo "📓 Running notebook tests"
61-
uv run python -m pytest --nbval-lax ./docs/user_guide -vvv $(ARGS)
61+
@echo "🔍 Checking Redis version..."
62+
@if uv run python -c "import redis; from redisvl.redis.connection import supports_svs; client = redis.Redis.from_url('redis://localhost:6379'); exit(0 if supports_svs(client) else 1)" 2>/dev/null; then \
63+
echo "✅ Redis 8.2.0+ detected - running all notebooks"; \
64+
uv run python -m pytest --nbval-lax ./docs/user_guide -vvv $(ARGS); \
65+
else \
66+
echo "⚠️ Redis < 8.2.0 detected - skipping SVS notebook"; \
67+
uv run python -m pytest --nbval-lax ./docs/user_guide -vvv --ignore=./docs/user_guide/09_svs_vamana.ipynb $(ARGS); \
68+
fi
6269

6370
check: lint test ## Run all checks (lint + test)
6471

docs/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ query
2020
filter
2121
vectorizer
2222
reranker
23+
utils
2324
cache
2425
message_history
2526
router

0 commit comments

Comments
 (0)