Skip to content

.NET: Add sample to show multiple AIContextProvider usage - #3284

Merged
westey (westey-m) merged 6 commits into
microsoft:mainfrom
westey-m:aicontextprovider-sample
Jan 21, 2026
Merged

.NET: Add sample to show multiple AIContextProvider usage#3284
westey (westey-m) merged 6 commits into
microsoft:mainfrom
westey-m:aicontextprovider-sample

Conversation

@westey-m

Copy link
Copy Markdown
Contributor

Motivation and Context

#2933

Description

  • Adding a sample with an AggregateAIContextProvider that shows how to combine the AIContext from multiple providers together, and shows a couple of sample AIContextProviders at the same time.

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.

CopilotAI review requested due to automatic review settings January 19, 2026 14:10
@markwallace-microsoftMark Wallace (markwallace-microsoft) added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net labels Jan 19, 2026
@github-actionsgithub-actionsBot changed the title Add sample to show multiple AIContextProvider usage.NET: Add sample to show multiple AIContextProvider usageJan 19, 2026

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comprehensive sample demonstrating how to use multiple AIContextProvider instances with agents, addressing issue #2933. The sample shows how to aggregate multiple providers and demonstrates practical use cases including a todo list manager and calendar integration.

Changes:

  • Added a new sample Agent_Step20_AdditionalAIContext that demonstrates AIContextProvider usage
  • Implemented an AggregatingAIContextProvider to combine multiple context providers
  • Updated the main README to reference the new sample

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

FileDescription
dotnet/samples/GettingStarted/Agents/README.mdAdded entry for the new Step 20 sample with description
dotnet/samples/GettingStarted/Agents/Agent_Step20_AdditionalAIContext/Program.csMain sample code implementing TodoListAIContextProvider, CalendarSearchAIContextProvider, and AggregatingAIContextProvider with demonstration usage
dotnet/samples/GettingStarted/Agents/Agent_Step20_AdditionalAIContext/Agent_Step20_AdditionalAIContext.csprojProject file with necessary dependencies and configuration matching other samples
dotnet/agent-framework-dotnet.slnxAdded the new project to the solution file

Comment threaddotnet/samples/GettingStarted/Agents/README.md Outdated
@westey-m
westey (westey-m) added this pull request to the merge queueJan 21, 2026
Merged via the queue into microsoft:main with commit 41cc344Jan 21, 2026
15 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationUsage: [Issues, PRs], Target: documentation in the code base and learn docs.NETUsage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@westey-m@rogerbarreto@SergeyMenshykh@markwallace-microsoft