SemanticCache vector index algorithm is hardcoded to FLAT; no way to configure HNSW
メンテナーはふだん 5 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
調査の方向性
redisvl/extensions/cache/llm/schema.py:115 の SemanticCacheIndexSchema.from_params から始め、SemanticCache のコンストラクターを調べて、作成時にインデックス設定がどのように渡されるかを追跡します。FLAT をデフォルトとして維持しながら、ベクトルアルゴリズムとその HNSW パラメーターを構築時に設定できるようにします。新しいキャッシュで、インデックスを手動で作成せずに HNSW を選択できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 431
- フォーク
- 107
- 平均マージ
- 5日 17時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
redis/redis-vl-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
redis/redis-vl-python#773 ·
メンテナーはふだん 5 日以内に返信
-
Vector field with index_missing=True cannot be created対応中かも @RaphaelFakhri が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
redis/redis-vl-python#770 ·
メンテナーはふだん 5 日以内に返信
-
Add Python 3.15 support対応中かも @vishal-bala が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
redis/redis-vl-python#757 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 5 日以内に返信
-
SearchIndex.drop_keys does not validate cluster hash-tag co-location (inconsistent with drop_documents)対応中かも @Hashim1999164 が今日担当しました。 オープンbug good first issue index
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
redis/redis-vl-python#601 ·
メンテナーはふだん 5 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
redis/redis-vl-python#300 ·
メンテナーはふだん 5 日以内に返信
redis/redis-vl-python の issue をすべて見る
似ている issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ianktoo/project-monitor#14 ·
-
security
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
btclib-org/btclib-wallet#478 ·
メンテナーはふだん 1 日以内に返信
-
security
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
btclib-org/btclib#2727 ·
メンテナーはふだん 1 日以内に返信
-
good first issue lead variant:container
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
radialmonster/orf-cleanroom#10 ·
メンテナーはふだん 1 日以内に返信
-
gdsa opencode: keep-alive cleanup trap fails with 'keepalive_pid: unbound variable'対応中かも @darribas が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100