Skip to content

Feat/raae 1322/hybrid support#639

Merged
rbs333 merged 7 commits into
mainfrom
feat/RAAE-1322/hybrid_support
Jun 25, 2026
Merged

Feat/raae 1322/hybrid support#639
rbs333 merged 7 commits into
mainfrom
feat/RAAE-1322/hybrid_support

Conversation

@rbs333

@rbs333 rbs333 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Adds ft.hybrid support to SQL query.

This ships as part of sql-redis 0.7.0 release.


Note

Medium Risk
Introduces a new search path (FT.HYBRID) behind stricter Redis/redis-py/sql-redis version requirements; incorrect docs or dependency pins could mislead adopters, but runtime code changes are minimal.

Overview
Documents SQL hybrid search via hybrid_vector_search(cosine_distance(...), fulltext(...), rrf()|linear()), which maps to Redis FT.HYBRID through the upgraded sql-redis dependency (now >=0.7.1 in pyproject.toml and the lockfile).

Coverage spans the SQLQuery docstring, API/concepts docs, and a new notebook section with an executable example. Integration tests exercise RRF and linear fusion, WHERE filters, RRF knobs, redis_query_string() output, and async AsyncSearchIndex—all gated on Redis 8.4+ and redis-py >= 7.1.0.

No new RedisVL translation logic in this PR; behavior comes from sql-redis 0.7.x on the existing SQLQueryindex.query() path.

Reviewed by Cursor Bugbot for commit 1e5bad8. Bugbot is set up for automated code reviews on this repo. Configure here.

rbs333 added 2 commits June 24, 2026 09:28
Adds tests/integration/test_sql_redis_hybrid.py exercising hybrid_vector_search()
through SQLQuery against a native FT.HYBRID command (RRF and LINEAR fusion, WHERE
filter, redis_query_string inspection, sync + async). Version-gated with
skip_if_redis_version_below(..., "8.4.0") and a redis-py>=7.1.0 skipif, matching
test_hybrid.py.

Adds a "Hybrid search (FT.HYBRID)" example cell to the SQL-to-Redis user guide and
a packaging spec under docs/proposals/. Requires sql-redis with hybrid support.

Jira: RAAE-1322
@jit-ci

jit-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 69df859. Configure here.

Comment thread pyproject.toml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates RedisVL’s optional SQLQuery integration to support server-side hybrid fusion (FT.HYBRID) by bumping the sql-redis extra to >=0.7.0, adding a new integration test suite for hybrid SQL queries, and updating user-facing documentation/spec materials.

Changes:

  • Bump optional dependency sql-redis (and all extra) from >=0.6.0 to >=0.7.0.
  • Add integration tests validating hybrid_vector_search(...) execution and redis_query_string() rendering for FT.HYBRID (sync + async).
  • Update docs with a new SQL user-guide section and a draft proposal/spec for SQLQuery hybrid support.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/integration/test_sql_redis_hybrid.py Adds integration coverage for SQLQuery hybrid fusion via FT.HYBRID (including async).
pyproject.toml Bumps sql-redis optional dependency minimum version to >=0.7.0 (and in all).
docs/user_guide/12_sql_to_redis_queries.ipynb Adds a “Hybrid search (FT.HYBRID)” section with an example using hybrid_vector_search(...).
docs/proposals/sqlquery-ft-hybrid.md Introduces a draft spec describing SQLQuery hybrid fusion support and expected behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Copilot AI review requested due to automatic review settings June 24, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Comment thread redisvl/query/sql.py Outdated
Comment thread docs/api/query.rst
Comment thread docs/concepts/queries.md
""", params={"vec": embedding_bytes})
```

Requires Redis 8.4+ and `redis-py >= 7.1.0`.
},
{
"cell_type": "markdown",
"source": "### Hybrid search (FT.HYBRID)\n\nUse `hybrid_vector_search()` to fuse a full-text query and a vector query into a single ranking **server-side** with Redis's native `FT.HYBRID`. It composes the `cosine_distance()` (vector leg) and `fulltext()` (text leg) functions, with `rrf()` or `linear()` selecting the fusion method (reciprocal rank fusion or a linear weighting).\n\nThis differs from the *pre-filter* hybrid search above (a `WHERE` clause narrowing a KNN search): here both legs are ranked independently and fused, rather than text acting only as a filter.\n\n> Requires Redis 8.4+ and `redis-py >= 7.1.0`.",
@rbs333 rbs333 added the auto:release Create a release when this PR is merged label Jun 25, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 25, 2026 22:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Comment thread redisvl/query/sql.py
Comment on lines +26 to +28
- ``hybrid_vector_search(cosine_distance(field, :vec), fulltext(field, 'query'), rrf())`` fuses a text and a vector query server-side via Redis ``FT.HYBRID``
(requires ``sql-redis >= 0.7.0``, Redis 8.4+, and redis-py >= 7.1.0). Use
``rrf()`` or ``linear()`` to select the fusion method
Comment thread docs/api/query.rst
Comment on lines +265 to +269
.. note::
SQLQuery supports hybrid search via ``hybrid_vector_search(cosine_distance(...), fulltext(...), rrf())``, which translates to a native Redis ``FT.HYBRID`` command
fusing a text and a vector query server-side. This is the SQL front-end to
:class:`HybridQuery` and requires ``sql-redis >= 0.7.0``, Redis 8.4+, and
redis-py >= 7.1.0.

@abrookins abrookins left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! 👍

@rbs333 rbs333 merged commit 1605b88 into main Jun 25, 2026
53 of 58 checks passed
@rbs333 rbs333 deleted the feat/RAAE-1322/hybrid_support branch June 25, 2026 23:03
@applied-ai-release-bot

Copy link
Copy Markdown

🚀 PR was released in v0.22.0 🚀

@applied-ai-release-bot applied-ai-release-bot Bot added the released This issue/pull request has been released. label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:release Create a release when this PR is merged released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants