Skip to content

Python: issue-5260 adds valkey message history#5473

Open
MatthiasHowellYopp wants to merge 1 commit intomicrosoft:mainfrom
MatthiasHowellYopp:issue-5260
Open

Python: issue-5260 adds valkey message history#5473
MatthiasHowellYopp wants to merge 1 commit intomicrosoft:mainfrom
MatthiasHowellYopp:issue-5260

Conversation

@MatthiasHowellYopp
Copy link
Copy Markdown

Motivation and Context

Fixes #5260

The current agent-framework-redis package depends on redisvl, which requires Redis Stack's RediSearch module. This creates an incompatibility for teams running Valkey — whether self-hosted or through managed cloud services (AWS ElastiCache, GCP Memorystore) — since RedisVL has known incompatibilities with Valkey's search module. Additionally, even the RedisChatMessageStore (which only needs basic key-value operations) pulls in RedisVL as a transitive dependency.

This PR adds a dedicated agent-framework-valkey package that uses valkey-glide (the official Valkey Python client) directly, with no RedisVL dependency.

Description

New package: agent-framework-valkey (python/packages/valkey/)

Two components:

ValkeyChatMessageStore — Persistent chat message storage implementing the HistoryProvider protocol. Uses only basic Valkey key-value/list operations via valkey-glide, so it works with any Valkey (or Redis OSS) server with no search module required.

ValkeyContextProvider — Long-term memory context provider implementing the ContextProvider protocol. Uses Valkey's native FT.CREATE / FT.SEARCH commands via valkey-glide's custom_command API for full-text and optional hybrid vector search. Requires valkey-search >= 1.2 (ships with valkey-bundle >= 9.1.0).

The package follows the same structure and patterns as agent-framework-redis and agent-framework-mem0. Key design decisions:

Uses valkey-glide (official Valkey client, Apache-2.0 licensed) instead of RedisVL
Vector search uses Valkey's native FT commands directly rather than an abstraction layer, keeping the dependency tree minimal
embed_fn is typed as Callable[[str], Awaitable[list[float]]] — a proper async callable type rather than a framework-specific vectorizer class, making it easy to plug in any embedding provider
numpy is an optional dependency under the [vector] extra, so users who only need ValkeyChatMessageStore don't pull it in
Includes a sample (
valkey_sample.py
) demonstrating both components with Bedrock
Changes:

python/packages/valkey/ — new package with implementation, tests, README, LICENSE
pyproject.toml
— added workspace source and pyright test environment for valkey
PACKAGE_STATUS.md
— registered as alpha
AGENTS.md
— added valkey to Storage & Memory section
uv.lock
— updated with valkey-glide resolution
All checks pass: ruff formatting/linting, pyright, mypy, and 51 unit tests at 84% coverage.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@moonbox3 moonbox3 added documentation Improvements or additions to documentation python labels Apr 24, 2026
@github-actions github-actions Bot changed the title issue-5260 adds valkey message history Python: issue-5260 adds valkey message history Apr 24, 2026
@MatthiasHowellYopp
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree [company="Amazon"]

@MatthiasHowellYopp
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Amazon"

@MatthiasHowellYopp MatthiasHowellYopp force-pushed the issue-5260 branch 3 times, most recently from 88a6432 to 26cbf6d Compare April 27, 2026 13:22
@MatthiasHowellYopp
Copy link
Copy Markdown
Author

@moonbox3 - I'm getting this error:
Run actions/labeler@v6
with:
configuration-path: .github/labeler.yml
sync-labels: false
dot: true
Error: Error: Parameter token or opts.auth is required
Error: Parameter token or opts.auth is required

Is there something that can be done?

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

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Feature]: Add Valkey Context Provider and Chat Message Store

2 participants