Python: issue-5260 adds valkey message history#5473
Open
MatthiasHowellYopp wants to merge 1 commit intomicrosoft:mainfrom
Open
Python: issue-5260 adds valkey message history#5473MatthiasHowellYopp wants to merge 1 commit intomicrosoft:mainfrom
MatthiasHowellYopp wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Author
|
@microsoft-github-policy-service agree [company="Amazon"] |
Author
|
@microsoft-github-policy-service agree company="Amazon" |
88a6432 to
26cbf6d
Compare
Author
|
@moonbox3 - I'm getting this error: Is there something that can be done? |
26cbf6d to
dd41cae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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