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
Python: Bug: Redis connector sends malformed FT.CREATE PREFIX (one prefix per character of collection name) #13894
Describe the bug
The Python Redis connector sends FT.CREATE with the PREFIX argument split into one prefix per character of the collection name, instead of one prefix equal to "<collection_name>:".
Example observed on the wire for a collection named redis_json_list_data_model:
FT.CREATE redis_json_list_data_model ON JSON
PREFIX 27 r e d i s _ j s o n _ l i s t _ d a t a _ m o d e l :
SCORE 1.0 SCHEMA ...
RediSearch on Redis Stack silently accepts the malformed command and the connector appears to work for simple single-collection usage.
Root cause (client-side): python/semantic_kernel/connectors/redis.py:281 passes a plain string to redis-py's IndexDefinition(prefix=...). redis-py treats that argument as an iterable of prefixes and iterates the string character-by-character.
Expected behavior
FT.CREATE for an SK-managed collection should register exactly one key-space prefix equal to "<collection_name>:", so that the index only matches keys written for this collection.
Prerequisites: a Redis Stack server reachable on localhost:6379, redis-cli, and a working Python SK dev environment.
Install Python SK per (python/DEV_SETUP.md):
cd python && make install-sk PYTHON_VERSION=3.12
Start Redis Stack on port 6379. Example:
podman run -d -p 6379:6379 docker.io/redis/redis-stack:latest
In a separate terminal, attach MONITOR to the server:
redis-cli -h localhost -p 6379 MONITOR
From python/, run the Redis integration tests:
REDIS_CONNECTION_STRING="redis://localhost:6379" \
uv run pytest tests/integration/memory/test_vector_store.py -k redis -v
Inspect the MONITOR output for the FT.CREATE lines. Each one contains PREFIX <N> where N equals the length of the collection name, followed by that many single-character prefixes.
On Redis Stack the tests pass (the bug is silent).
Platform
Language: Python
Source: main branch of microsoft/semantic-kernel (SK version 1.41.2 as reported by semantic_kernel.__version__)
Correctness on Redis: indexes register unintended single-character prefixes. In multi-collection deployments on a shared Redis, collections whose names share any character will register overlapping prefixes and can match each other's keys.
changed the title [-]Bug: Redis connector sends malformed `FT.CREATE PREFIX` (one prefix per character of collection name)[/-][+]Python: Bug: Redis connector sends malformed `FT.CREATE PREFIX` (one prefix per character of collection name)[/+]on Apr 20, 2026
Activity
[-]Bug: Redis connector sends malformed `FT.CREATE PREFIX` (one prefix per character of collection name)[/-][+]Python: Bug: Redis connector sends malformed `FT.CREATE PREFIX` (one prefix per character of collection name)[/+]Add unit test asserting FT.CREATE prefix is a list (microsoft#13894)
eavanvalkenburg commentedon Apr 29, 2026
Daria Korenieva (@daric93) Doondi Ashlesh (@Doondi-Ashlesh) Mukunda Rao Katta (@MukundaKatta) Erick Aleman (@EaCognitive) armorbreak001 not sure which of you are agents, but there are now 5 open PR's that fix this issue, please coordinate who will do this and close the others.
daric93 commentedon Apr 29, 2026
Doondi Ashlesh (@Doondi-Ashlesh) Mukunda Rao Katta (@MukundaKatta) Erick Aleman (@EaCognitive) armorbreak001 Thanks everyone for jumping on this! All our PRs apply the same one-line fix. Since I filed the issue and opened #13895 shortly after, and I'm already coordinating the related Redis fixes (#13904, #13896), I think it'd be simplest to go with mine to keep things consolidated. Would you all be okay closing yours?
Fix Redis connector bugs: FT.CREATE PREFIX, vector search, JSON delet…
Fix Redis connector bugs: FT.CREATE PREFIX, vector search, JSON delet…
github-actions commentedon Sep 30, 2026
This issue is stale because it has been open for 90 days with no activity.
github-actions commentedon Oct 15, 2026
This issue was closed because it has been inactive for 14 days since being marked as stale.