SemanticCache vector index algorithm is hardcoded to FLAT; no way to configure HNSW
Los mantenedores suelen responder en 5 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Comienza con SemanticCacheIndexSchema.from_params en redisvl/extensions/cache/llm/schema.py:115 e inspecciona el constructor de SemanticCache para rastrear cómo se pasan las configuraciones del índice durante la creación. Añade configuración en el momento de la construcción para el algoritmo vectorial y sus parámetros de HNSW, manteniendo FLAT como valor predeterminado; el trabajo estará terminado cuando las nuevas cachés puedan seleccionar HNSW sin crear el índice manualmente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Current behavior
SemanticCacheIndexSchema.from_params (redisvl/extensions/cache/llm/schema.py:115) hardcodes the vector field's algorithm to "flat":
{
"name": CACHE_VECTOR_FIELD_NAME,
"type": "vector",
"attrs": {
"dims": vector_dims,
"datatype": dtype,
"distance_metric": "cosine",
"algorithm": "flat",
},
},
There is no constructor argument on SemanticCache to override this. FLAT is exact KNN — fine to the low millions of entries, latency-degrading beyond that. For large multi-tenant deployments or per-tenant player-facing caches (10M–100M entries), HNSW is required. Today the only workaround is to bypass SemanticCache entirely and build the index manually.
Proposed API
SemanticCache(
name="cache",
redis_url=...,
vector_index_config={
"algorithm": "hnsw", # or "flat" (default)
"m": 16,
"ef_construction": 200,
"ef_runtime": 10,
},
)
A simpler form taking just algorithm: Literal["flat", "hnsw"] = "flat" plus a default HNSW parameter preset would also be acceptable for a first cut.
Compatibility notes
The algorithm is fixed at index creation; existing FLAT caches cannot be hot-swapped to HNSW. Customers wanting to switch must build a new cache (new name), re-warm, and cut over — same migration shape as a schema change. This is acceptable as long as the option exists at construction time.
Notes
Surfaced while writing a scoped semantic caching architecture spec for customers running large-scale, multi-tenant deployments.
- Lenguaje dominante
- Python
- Estrellas
- 431
- Forks
- 107
- Merge medio
- 5 d 17 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de redis/redis-vl-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
redis/redis-vl-python#773 ·
Los mantenedores suelen responder en 5 días
-
Vector field with index_missing=True cannot be createdPosiblemente ocupada @RaphaelFakhri la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
redis/redis-vl-python#770 ·
Los mantenedores suelen responder en 5 días
-
Add Python 3.15 supportPosiblemente ocupada @vishal-bala la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
redis/redis-vl-python#757 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 5 días
-
SearchIndex.drop_keys does not validate cluster hash-tag co-location (inconsistent with drop_documents)Posiblemente ocupada @Hashim1999164 la tomó hoy. Abiertobug good first issue index
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
redis/redis-vl-python#601 ·
Los mantenedores suelen responder en 5 días
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
redis/redis-vl-python#300 ·
Los mantenedores suelen responder en 5 días
Todos los issues de redis/redis-vl-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
SwiftKickMobile/skai#84 ·
-
Lychee link check failedAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
jxxghp/MoviePilot#7070 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
flop-labs/technocore-chat#997 ·
Los mantenedores suelen responder en 1 día
-
tunneld on Windows: Wi-Fi devices are not discovered because uvicorn runs on a ProactorEventLoopAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
doronz88/pymobiledevice3#2051 ·
Los mantenedores suelen responder en 1 día