Repository navigation
.NET: Adds Valkey to chat message history - issue 5445 - #5542
Merged
westey (westey-m) merged 11 commits intoJun 11, 2026
Merged
Conversation
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5445
branch
from
April 29, 2026 18:05
2598a07 to
4958338
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Completes the new .NET Valkey integration by adding Valkey-backed chat history/context providers, unit tests, and two samples (Azure OpenAI + Amazon Bedrock), plus wiring the new projects into the solution and central package versions.
Changes:
- Added
Microsoft.Agents.AI.Valkeypackage implementation:ValkeyChatHistoryProvider,ValkeyContextProvider, andValkeyProviderScope. - Added a new Valkey unit test project with coverage for provider behavior and scope cloning.
- Added new AgentWithMemory step 03 samples (Azure OpenAI + Bedrock), plus solution and package version updates.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.Valkey.UnitTests/ValkeyContextProviderTests.cs | Adds unit tests for ValkeyContextProvider behaviors (escaping, parsing, disposal, scope/state). |
| dotnet/tests/Microsoft.Agents.AI.Valkey.UnitTests/ValkeyChatHistoryProviderTests.cs | Adds unit tests for ValkeyChatHistoryProvider behaviors (store/retrieve/trim/dispose). |
| dotnet/tests/Microsoft.Agents.AI.Valkey.UnitTests/TestHelpers.cs | Adds shared test helpers for constructing provider invoke contexts and a test AgentSession. |
| dotnet/tests/Microsoft.Agents.AI.Valkey.UnitTests/Microsoft.Agents.AI.Valkey.UnitTests.csproj | Introduces the Valkey unit test project. |
| dotnet/src/Microsoft.Agents.AI.Valkey/ValkeyProviderScope.cs | Adds ValkeyProviderScope including copy constructor and XML docs. |
| dotnet/src/Microsoft.Agents.AI.Valkey/ValkeyContextProvider.cs | Introduces Valkey full-text-search-backed long-term memory/context provider. |
| dotnet/src/Microsoft.Agents.AI.Valkey/ValkeyChatHistoryProvider.cs | Introduces Valkey-backed persistent chat history provider using list operations. |
| dotnet/src/Microsoft.Agents.AI.Valkey/Microsoft.Agents.AI.Valkey.csproj | Adds new Valkey project with dependencies and InternalsVisibleTo for tests. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step03_MemoryUsingValkey_Bedrock/README.md | Adds Bedrock+Valkey sample documentation. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step03_MemoryUsingValkey_Bedrock/Program.cs | Adds Bedrock-powered sample using both Valkey providers. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step03_MemoryUsingValkey_Bedrock/AgentWithMemory_Step03_MemoryUsingValkey_Bedrock.csproj | Adds Bedrock sample project and dependency on AWSSDK.Extensions.Bedrock.MEAI. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step03_MemoryUsingValkey/README.md | Adds Azure OpenAI+Valkey sample documentation. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step03_MemoryUsingValkey/Program.cs | Adds Azure OpenAI powered sample using both Valkey providers. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step03_MemoryUsingValkey/AgentWithMemory_Step03_MemoryUsingValkey.csproj | Adds Azure OpenAI sample project references. |
| dotnet/agent-framework-dotnet.slnx | Registers the new Valkey project, new Valkey unit tests, and new samples in the solution. |
| dotnet/Directory.Packages.props | Adds centrally managed version for AWSSDK.Extensions.Bedrock.MEAI. |
| .gitignore | Ignores .kiro/ folder. |
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5445
branch
7 times, most recently
from
May 5, 2026 20:42
ab4e77d to
4f45ce9
Compare
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5445
branch
3 times, most recently
from
May 14, 2026 14:29
16dc043 to
09145fa
Compare
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5445
branch
3 times, most recently
from
May 20, 2026 15:17
8036db8 to
a3186e1
Compare
Contributor
Author
|
westey (@westey-m) Hoping I can get a review on this this week, tks |
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5445
branch
2 times, most recently
from
May 21, 2026 17:06
786c06a to
ecbe5e6
Compare
…text provider - Switch from StackExchange.Redis to Valkey.Glide 1.1.0 (official Valkey .NET client) - Extract optional params into ValkeyChatHistoryProviderOptions - Add JsonSerializerOptions support, remove [RequiresUnreferencedCode] - Make MaxMessages/MaxMessagesToRetrieve readonly via options - Remove ValkeyContextProvider (overlaps with ChatHistoryMemoryProvider + MEVD) - Remove ValkeyProviderScope (only used by context provider) - Remove connection string constructors (caller manages IConnectionMultiplexer) - Update samples to use new API and gpt-5.4-mini
Use JsonSerializerOptions.GetTypeInfo() for Serialize/Deserialize calls to enable NativeAOT/trimming compatibility without suppress attributes. Default to AgentAbstractionsJsonUtilities.DefaultOptions when no options provided. Signed-off-by: Matthias Howell <matthias.howell@improving.com>
Remove ValkeyContextProvider and long-term memory references from sample READMEs since the context provider was removed from this PR. Simplify Valkey server requirements (no search module needed for chat history). Signed-off-by: Matthias Howell <matthias.howell@improving.com>
Signed-off-by: Matthias Howell <matthias.howell@improving.com>
Matthias Howell (MatthiasHowellYopp)
force-pushed
the
issue-5445
branch
from
June 9, 2026 13:37
0ebf45a to
a18915f
Compare
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
integration
June 9, 2026 13:43 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
integration
June 9, 2026 13:43 — with
GitHub Actions
Inactive
SergeyMenshykh
approved these changes
Jun 10, 2026
Roger Barreto (rogerbarreto)
approved these changes
Jun 10, 2026
…ey.csproj Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
integration
June 10, 2026 14:08 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
integration
June 10, 2026 14:08 — with
GitHub Actions
Inactive
Peter Ibekwe (peibekwe)
approved these changes
Jun 10, 2026
westey (westey-m)
approved these changes
Jun 11, 2026
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
integration
June 11, 2026 09:48 — with
GitHub Actions
Inactive
Matthias Howell (MatthiasHowellYopp)
temporarily deployed
to
integration
June 11, 2026 09:48 — with
GitHub Actions
Inactive
westey (westey-m)
enabled auto-merge
June 11, 2026 13:16
Collaborator
|
Thanks for the contribution Matthias Howell (@MatthiasHowellYopp)! |
5 of 7 tasks
This branch was previously deployed
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
The .NET Agent Framework currently has no dedicated Valkey integration package. Teams running Valkey in production — whether self-hosted or through managed cloud services like AWS ElastiCache for Valkey or GCP Memorystore for Valkey — have no first-party way to use Valkey for persistent chat history or long-term memory context. This has become increasingly common since the Redis license change.
The Microsoft.Agents.AI.Valkey package was scaffolded with working ValkeyChatHistoryProvider and ValkeyContextProvider implementations. This PR completes the package by adding missing pieces identified during review, fixing bugs in the existing sample, and adding a Bedrock-powered sample for AWS users.
Fixes issue #5445
Description
###Valkey package improvements:
###Bug fix in existing sample:
###New Bedrock sample (AgentWithMemory_Step03_MemoryUsingValkey_Bedrock):
###Infrastructure:
Unit tests:
Added tests for ValkeyProviderScope copy constructor (clone all properties, null source throws)
23 tests total, all passing
Contribution Checklist
[x] The code builds clean without any errors or warnings
[x] The PR follows the Contribution Guidelines
[x] 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.