Python: issue-5260 adds valkey message history#5473
Conversation
|
@microsoft-github-policy-service agree [company="Amazon"] |
|
@microsoft-github-policy-service agree company="Amazon" |
88a6432 to
26cbf6d
Compare
|
@moonbox3 - I'm getting this error: Is there something that can be done? |
dd41cae to
b8df739
Compare
b8df739 to
6189cc2
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Python Valkey integration package to avoid RedisVL/RediSearch dependencies and enable Valkey-compatible chat history + long-term memory providers.
Changes:
- Introduces
agent-framework-valkeywithValkeyChatMessageStore(list-based history) andValkeyContextProvider(FT.* search + optional vector/hybrid search). - Adds unit tests, docs, and a runnable sample demonstrating both providers.
- Registers the package in the Python workspace/config and updates repo docs/status listings.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/02-agents/context_providers/valkey_sample.py | Adds an end-to-end sample using the new Valkey providers. |
| python/pyproject.toml | Registers the new workspace package and pyright test environment; adds an additional dependency entry. |
| python/packages/valkey/tests/test_providers.py | Adds unit coverage for Valkey chat store + context provider behaviors. |
| python/packages/valkey/pyproject.toml | New package metadata, deps, extras, and tool configuration. |
| python/packages/valkey/conftest.py | Skips test collection when glide isn’t installed (e.g., Windows). |
| python/packages/valkey/agent_framework_valkey/_context_provider.py | Implements the Valkey long-term memory context provider with FT.CREATE/FT.SEARCH. |
| python/packages/valkey/agent_framework_valkey/_chat_message_store.py | Implements Valkey-backed chat history storage using list operations. |
| python/packages/valkey/agent_framework_valkey/init.py | Exposes the new provider/store as public package API. |
| python/packages/valkey/README.md | Documentation for server requirements and usage. |
| python/packages/valkey/LICENSE | Adds package license file. |
| python/packages/valkey/AGENTS.md | Registers package documentation in repo’s agent docs structure. |
| python/PACKAGE_STATUS.md | Marks agent-framework-valkey as alpha. |
| python/AGENTS.md | Adds Valkey to “Storage & Memory” index. |
| .gitignore | Ignores .kiro/. |
53d142e to
377cb65
Compare
0a6b52a to
9c1e3db
Compare
4509557 to
36c4ee8
Compare
|
@moonbox3 hoping I can get a review on this this week, tks |
36c4ee8 to
9466056
Compare
9466056 to
b603041
Compare
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