Uh oh!
There was an error while loading. Please reload this page.
.NET: Add Cosmos NoSQL vector memory sample - #7552
Conversation
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a new .NET “AgentWithMemory” sample demonstrating persistent, cross-session chat history recall backed by Azure Cosmos DB for NoSQL vector search.
Changes:
- Introduces Step 08 sample using
CosmosNoSqlVectorStore+ChatHistoryMemoryProviderto persist and recall chat history acrossAgentSessions. - Registers the sample in the parent README, solution, and sample verifier.
- Updates central package versions to include the CommunityToolkit Cosmos NoSQL vector connector and bumps
Microsoft.Azure.Cosmos.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dotnet/samples/02-agents/AgentWithMemory/README.md | Adds Step 08 link to the sample index. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step08_MemoryUsingCosmosNoSql/README.md | Documents prerequisites, env vars, and behavior for the new sample. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step08_MemoryUsingCosmosNoSql/Program.cs | Implements the Cosmos NoSQL vector-store-backed memory sample and cross-session recall. |
| dotnet/samples/02-agents/AgentWithMemory/AgentWithMemory_Step08_MemoryUsingCosmosNoSql/AgentWithMemory_Step08_MemoryUsingCosmosNoSql.csproj | Adds the new sample project and dependencies. |
| dotnet/eng/verify-samples/AgentsSamples.cs | Registers the new sample with the verifier and required env vars. |
| dotnet/agent-framework-dotnet.slnx | Adds the sample project to the solution. |
| dotnet/Directory.Packages.props | Adds CommunityToolkit Cosmos NoSQL connector version and bumps Microsoft.Azure.Cosmos. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Follow-up commit 862b907 addresses all four Copilot comments: embedding dimensions are configurable and validated, sample memory is isolated with a per-run user scope, and the unused direct Newtonsoft.Json reference is removed. The affected sample builds successfully with dotnet build --no-restore, editor diagnostics are clean, git diff --check passes, and all review threads are resolved. The PR is now ready for review; the contributor license check is currently queued. westey (@westey-m), could you review this AgentWithMemory sample when available? |
Saurish (nos-redacted)
commented
Aug 7, 2026
@microsoft-github-policy-service agree company="Microsoft" |
westey (westey-m)
commented
Aug 10, 2026
Saurish (@nos-redacted), thanks for the contribution. Note that there is a small build issue that needs to be resolved:
We'll need to add newtonsoft.json to the sample project |
Motivation & Context
The .NET
AgentWithMemorysamples demonstrate progressively richer memory providers, but they do not show how to use Azure Cosmos DB for NoSQL as a persistent vector store. This adds an Azure-first reference for semantic chat-history recall across independent agent sessions while reusing the existingChatHistoryMemoryProviderandVectorStoreabstractions.Description & Review Guide
CosmosNoSqlVectorStorewith a Microsoft Foundry embedding deployment and passes it toChatHistoryMemoryProvider.AgentSessioninstances to demonstrate cross-session recall.Microsoft.Azure.Cosmosversion from 3.54.0 to 3.61.0, which is required by connector 1.0.0.Related Issue
Fixes#7551
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.