You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RedisVectorStore broken against real RediSearch (binary-field decode, reconnect persistence) — hidden by MagicMock #831
RedisVectorStore (src/synapsekit/retrieval/redis_vector.py) never ran against a real RediSearch — its only test used MagicMock, which hid two bugs. Found while converting to real testcontainers tests (epic #829).
Bugs
UnicodeDecodeError on search — FT.SEARCH was issued without a RETURN clause, so RediSearch also returns the raw FLOAT32 embedding bytes. The result parser then calls .decode() on every field value, crashing on the binary embedding ('utf-8' codec can't decode byte 0xcd). Any real search raised.
No reconnect persistence — search() short-circuited on self._dim is None, so a freshly reconnected instance (which hasn't run add() and has no cached dim) returned [] even when the index and vectors already exist in Redis.
Fix
Add RETURN 3 text metadata score to FT.SEARCH so only parsed fields come back.
Drop the self._dim is None guard; _search_sync returns [] on ResponseError (index genuinely absent), which also correctly handles search-before-add.
Test
Real redis/redis-stack testcontainer: nearest-neighbour ranking (cosine distance ascending), metadata filter, top_k, persistence across reconnect, empty/negative cases. Replaces the MagicMock test. Runs in the CI integration job.
Activity
fix(retrieval): make RedisVectorStore work against real RediSearch (S…