Skip to content

Python: Fix RedisProvider HybridQuery compatibility with redisvl 0.14.0#3880

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-redisprovider-alpha-issue
Draft

Python: Fix RedisProvider HybridQuery compatibility with redisvl 0.14.0#3880
Copilot wants to merge 2 commits intomainfrom
copilot/fix-redisprovider-alpha-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Fix RedisProvider HybridQuery incompatibility with redisvl 0.14.0

Merge conflicts resolved - Rebased onto main and applied fix to updated codebase.

Changes

Context

This PR was rebased onto main after PR #3850 (Breaking PR2) which:

  • Deleted _provider.py
  • Renamed _RedisContextProvider to RedisContextProvider in _context_provider.py
  • Consolidated tests into test_providers.py

The fix now applies to the updated code structure.

Original prompt

This section details on the original issue you should resolve

<issue_title>Python: RedisProvider._redis_search() incompatible with redisvl 0.14.0: 'alpha' renamed to 'linear_alpha' in HybridQuery</issue_title>
<issue_description>## Bug Report

Description

RedisProvider._redis_search() passes alpha to redisvl.query.HybridQuery, but redisvl v0.14.0 renamed this parameter to linear_alpha.

Error

TypeError: HybridQuery.__init__() got an unexpected keyword argument 'alpha'

Wrapped as:

agent_framework.exceptions.ServiceInvalidRequestError: Redis text search failed: HybridQuery.__init__() got an unexpected keyword argument 'alpha'

Location

agent_framework_redis/_provider.py, in _redis_search():

query = HybridQuery(
    text=q,
    text_field_name="content",
    vector=vector,
    vector_field_name=self.vector_field_name,
    text_scorer=text_scorer,
    filter_expression=combined_filter,
    alpha=alpha,  # <-- this parameter no longer exists in redisvl 0.14.0
    dtype=self.redis_vectorizer.dtype,
    num_results=num_results,
    return_fields=return_fields,
    stopwords=None,
)

Expected Fix

Replace alpha=alpha with linear_alpha=alpha to match the redisvl 0.14.0 API:

query = HybridQuery(
    ...
    linear_alpha=alpha,
    ...
)

The redisvl 0.14.0 HybridQuery signature expects linear_alpha: float = 0.3 instead of alpha.

Steps to Reproduce

  1. Install agent-framework-redis (at commit 98cd72839e) which pulls redisvl>=0.14.0
  2. Create a RedisProvider with a vectorizer configured (e.g., AzureOpenAITextVectorizer)
  3. Run an agent with the provider — the first invoking() call triggers _redis_search() which fails

Environment

  • agent-framework-redis at commit 98cd72839e
  • redisvl==0.14.0
  • Python 3.12</issue_description>

<agent_instructions>Fix the bug reported in this issue. Add a unit test to prevent regressions. Run the pre-commit hooks and fix any formatting errors.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: markwallace-microsoft <127216156+markwallace-microsoft@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix RedisProvider._redis_search() for redisvl v0.14.0 compatibility Python: Fix RedisProvider HybridQuery compatibility with redisvl 0.14.0 Feb 12, 2026
@markwallace-microsoft
Copy link
Member

@copilot Resolve the merge conflicts

Copy link
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot Resolve the merge conflicts

Merge conflicts resolved. I've rebased the PR onto main (commit e981bf2).

Changes after rebase:

The branch needs a force push to update the remote. Since I cannot push directly, the PR tools will handle this automatically on the next sync.

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.

Python: RedisProvider._redis_search() incompatible with redisvl 0.14.0: 'alpha' renamed to 'linear_alpha' in HybridQuery

2 participants