feat: add native support for Microsoft Agent Framework - #13
Merged
Conversation
philasmar
force-pushed
the
asmarp/native-ms-agent-framework-support
branch
from
May 7, 2026 15:54
dd91f78 to
ae66901
Compare
philasmar
force-pushed
the
asmarp/native-ms-agent-framework-support
branch
from
May 7, 2026 16:18
ae66901 to
05905de
Compare
philasmar
marked this pull request as ready for review
May 7, 2026 16:31
GarrettBeatty
approved these changes
May 7, 2026
normj
requested changes
May 7, 2026
normj
approved these changes
May 7, 2026
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.
Issue #, if available:
DOTNET-8638
Description of Changes
Integrates Microsoft Agent Framework into AWS.AgentCore so that users get the full MS AF pipeline (middleware, context providers, sessions, tool calling) when building agents deployed to AgentCore Runtime.
What changed
Core library (
src/AWS.AgentCore/)AgentCoreOptions— AddedChatClient,AgentOptions,ConfigureAgentproperties.ModelIdis now nullable/optional (no longer throws if unset).AddAgentCore()— Refactored to registerAIAgentandChatClientAgentin DI with IChatClient priority resolution: explicitChatClient> pre-registered DI >ModelIdBedrock fallback. Also registersAgentCoreRuntimeContextProvider.AgentCoreRuntimeContextProvider— AnAIContextProviderthat makes AgentCore runtime context available in the MS AF pipeline.AgentCoreSessionFactory— Internal helper for creating sessions with AgentCore session IDs stored in the session state bag.InternalsVisibleTofor the unit test project.Sample apps (all updated to new pattern)
MicrosoftAgentFrameworkSample— Demonstrates agent middleware, function-calling middleware, system instructions, and multiple tools configured viaAgentOptionsandConfigureAgent.StreamingAgent— UsesChatClientAgentfrom DI withRunStreamingAsync.AnnotationsSample— UsesChatClientAgentvia constructor injection, instance-method tools viaChatClientAgentRunOptions.AnnotationsStreamingAgent— Same pattern with streaming.NativeAotAnnotations/NativeAotExtensions— Updated to new pattern, NativeAOT compatible.Tests
AgentCoreRuntimeContextProvider.AgentCoreSessionFactory.Design philosophy
Thin layer — we don't wrap MS AF features. Users configure tools, middleware, and context providers through standard MS AF APIs (
ChatClientAgentOptions,AsBuilder().Use()). When Microsoft adds new features, our library doesn't need changes to support them.How to use
Breaking changes
AgentCoreOptions.ModelIdchanged fromstring(default"") tostring?(defaultnull). Existing code that sets ModelId continues to work.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.