Skip to content

feat(redis): Add retrieve_online_documents_v2 support with Redis vect…#6478

Open
falloficaruss wants to merge 6 commits into
feast-dev:masterfrom
falloficaruss:feat/redis-vector-search
Open

feat(redis): Add retrieve_online_documents_v2 support with Redis vect…#6478
falloficaruss wants to merge 6 commits into
feast-dev:masterfrom
falloficaruss:feat/redis-vector-search

Conversation

@falloficaruss

@falloficaruss falloficaruss commented Jun 8, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

Adds Redis 8 Vector Set support to the Redis online store for retrieve_online_documents_v2, so Feast can do ANN/vector similarity search without bypassing the SDK.

This PR:

  • indexes vector fields into Redis Vector Sets using VADD
  • queries vectors through VSIM
  • supports COSINE and L2 metrics from Feast vector metadata
  • keeps vector-set state aligned with hash writes and TTL behavior
  • cleans up vector-set members when entities/tables are deleted
  • adds unit coverage for indexing, deletion, and retrieval behavior

Which issue(s) this PR fixes:

Fixes #6461

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

@falloficaruss falloficaruss marked this pull request as ready for review June 10, 2026 02:47
@falloficaruss falloficaruss requested a review from a team as a code owner June 10, 2026 02:47
…or sets

Signed-off-by: Abhishek Shinde <norizzabhii@gmail.com>
@falloficaruss falloficaruss force-pushed the feat/redis-vector-search branch from 10ea7b7 to ab39cdb Compare June 11, 2026 01:49
@falloficaruss falloficaruss changed the title feat(redis): add retrieve_online_documents_v2 support with Redis vect… feat(redis): Add retrieve_online_documents_v2 support with Redis vect… Jun 11, 2026

@franciscojavierarceo franciscojavierarceo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few inline comments on the Redis vector-set implementation. The main blockers are around the claimed L2 semantics and Redis < 8 capability detection.

return self._vadd_supported
try:
info = client.execute_command("COMMAND", "INFO", "VADD")
self._vadd_supported = info is not None and len(info) > 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can report VADD as supported on Redis versions that do not have it. COMMAND INFO <name> returns a nil entry for unknown commands, so a response shaped like [None] still has len(info) > 0; writes would then proceed into VADD and fail instead of cleanly skipping/raising the intended unsupported-server path. Can we inspect the actual command entry/value, not just the container length?

floats = [float(v) for v in python_vector]
if not floats:
continue
if metric in {"COSINE", "L2"}:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the advertised L2 mode behave like cosine/angular search. Normalizing indexed vectors and the query discards magnitude, so vectors like [2, 0] and [100, 0] become equivalent even though true L2 distances are very different. Since VSIM WITHSCORES returns Redis's similarity score, Redis should either reject L2 here or use a backend/query path that preserves real L2 semantics.

deleted_count += 1
pipe.execute()

# Also delete the Vector Set key if it exists

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cleanup is skipped when delete_table() returns early because no hash keys were found. That can leave the vector set behind after hash TTL expiry or partial cleanup. Could we delete vs_key before the if not all_keys: return path, or otherwise ensure table cleanup always removes the vector set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add retrieve_online_documents_v2 support to Redis online store

2 participants