Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions knowledge-graph-api/storage/redis_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@ class RedisVectorStore:
"""Async Redis vector store backed by RedisSearch."""

def __init__(self) -> None:
# Force RESP2 protocol. Redis Stack 7.2+ negotiates RESP3 by
# default, which makes the server reply to FT.SEARCH with a
# dict (``{b'total_results': N, b'results': [...]}``). The
# redis-py ``ft().search()`` helper still parses RESP2 list
# shape, so on RESP3 it silently returns ``total=0, docs=[]``
# for queries that DO match. Pinning protocol=2 makes the
# response a positional list and search results decode correctly.
self._client = aioredis.from_url(
settings.REDIS_URL,
decode_responses=False,
protocol=2,
)
self._index_name = settings.REDIS_INDEX_NAME

Expand Down
Loading