Introduction
Michel Schep
πŸ€– Microsoft Agent Framework

Getting Started
with MAF Agents
1.5

Build production-grade AI agents in .NET β€” from zero to running in minutes.

.NET 8 / 9 / 10 Open Source v1.5 β€” May 2026
Michel Schep πŸ“… May 9, 2026
1.5
Latest version
πŸš€
10K+
GitHub Stars
⭐
.NET + Py
Supported runtimes
πŸ”·
Agenda
Michel Schep

What we'll cover

01

What is an AI Agent?

The concept: LLM, Tools, Reasoning and Context β€” how they work together to create autonomous behaviour.

02

Introducing MAF

What Microsoft Agent Framework is, where it comes from, and why it matters for .NET developers.

03

The 3 Layers of a MAF Agent

OpenAI Client β†’ IChatClient β†’ AIAgent. How the abstraction stack fits together.

04

Live Demo + Aspire Observability

Build your first agent from scratch and watch it run β€” with full GenAI traces in .NET Aspire.

Concepts
Michel Schep

What is an AI Agent?

🧠 LLM β€” The Brain

A large language model (GPT-4o, Claude, Gemini…) that understands language, reasons over input, and decides what to do next.

πŸ”§ Tools β€” The Hands

Functions the agent can call: search the web, query a database, call an API. The LLM decides when and how to use them.

πŸ“š Context β€” The Memory

Conversation history, session state, user profile. Gives the agent awareness of what happened before this turn.

πŸ”„ Autonomous loop 🎯 Goal-driven ⚑ Multi-step
The Agent Reasoning Loop
πŸ‘€ User Input
↓
πŸ—„οΈ RAG: Fetch Context
↓
🧠 LLM Reasoning + Context
↓
πŸ”§ Tool Call?
↓
πŸ“₯ Tool Result
↓
🧠 LLM Reasoning
↓
βœ… Final Answer

An agent is not just a chatbot β€”
it thinks, decides, and acts.

Framework
Michel Schep

What is MAF?

The next generation of Semantic Kernel & AutoGen

Built by the same Microsoft teams. Combines AutoGen's simple agent abstractions with Semantic Kernel's enterprise features β€” session state, middleware, telemetry, and type safety.

🌐 Multi-provider support

Azure OpenAI Β· OpenAI Β· Anthropic Β· Gemini Β· GitHub Copilot Β· Ollama Β· Bedrock β€” switch with one line of code.

MIT License Open Source GA April 2026

🀝 Agents

Individual agents that use LLMs, call tools and MCP servers, and generate responses. Simple API, powerful runtime.

πŸ•ΈοΈ Workflows

Graph-based multi-agent orchestration: sequential, concurrent, group chat, handoff, and Magentic patterns.

πŸ“‘ Interoperability

A2A (Agent-to-Agent), AG-UI protocol, MCP servers, Azure Foundry hosting β€” works with the whole ecosystem.

Architecture
Michel Schep

The 3 Layers of a MAF Agent

πŸ”Œ

Layer 1 β€” OpenAI Client

The raw connection to your LLM provider. Handles authentication, endpoint routing, and HTTP. Swap providers without changing anything above.

Azure.AI.OpenAI
β†’
πŸ”

Layer 2 β€” IChatClient

The standard AI abstraction from Microsoft.Extensions.AI. Provider-agnostic interface β€” swap models without changing agent code above.

M.Extensions.AI
β†’
πŸ€–

Layer 3 β€” AIAgent

The MAF agent: adds tools, context, session state, instructions, and multi-turn conversation on top of IChatClient.

Microsoft.Agents.AI

πŸ’‘ Each layer adds capabilities β€” but you only need the ones you use. Start with just OpenAI Client + AIAgent and add layers as you grow.

Observability
Michel Schep

Visibility into your agent β€” two lines

πŸ“‹ .UseLogging(loggerFactory)

Plugs into the standard Microsoft.Extensions.Logging pipeline. Every agent action β€” LLM calls, tool invocations, errors β€” appears as structured log entries. Works with any log sink: console, Seq, Application Insights.

M.Extensions.Logging

πŸ“‘ .UseTelemetry()

Emits OpenTelemetry spans following the GenAI semantic conventions. Captures model name, token counts, prompt content, tool calls, and latency β€” all as structured trace data.

OpenTelemetry GenAI conventions

πŸ’‘ Add both to your AIAgentBuilder chain β€” they're composable middleware. Zero config required beyond a LoggerFactory.

What you get out of the box
πŸ” Every LLM call logged

Model, tokens used, latency, prompt + completion content

πŸ”§ Every tool call traced

Function name, input args, result, duration β€” as child spans

πŸ’° Token usage tracked

Prompt tokens, completion tokens, per call and aggregated

🚨 Errors surfaced

Failed tool calls and LLM errors appear as error spans with full context

Code
Michel Schep

From zero to running in 15 lines

Program.cs
// Layer 1 β€” Connect to your LLM provider
var openAiClient = new OpenAIClient(
    new ApiKeyCredential(Environment.GetEnvironmentVariable("OPENAI_API_KEY")!));

// Layer 2 β€” Wrap as IChatClient (Microsoft.Extensions.AI)
IChatClient chatClient = openAiClient
    .AsChatClient(modelId: "gpt-4o-mini");

// Layer 3 β€” Build your AIAgent with observability
AIAgent agent = new AIAgentBuilder()
    .WithInstructions("You are a helpful assistant.")
    .UseChatClient(chatClient)
    .UseLogging(loggerFactory)    // β†’ structured logs in Aspire
    .UseTelemetry()              // β†’ OpenTelemetry GenAI traces
    .Build();

// Run it!
string answer = await agent.RunAsync("What is MAF 1.5?");
Console.WriteLine(answer);

πŸ“¦ NuGet packages

Microsoft.Agents.AI
Microsoft.Agents.AI.OpenAI
Microsoft.Extensions.AI

πŸ”Œ Layer 1

Raw provider connection. Swap to AzureOpenAIClient, Anthropic or Gemini without touching anything else.

πŸ” Layer 2

IChatClient is the standard .NET abstraction β€” works with any AI extension in the ecosystem.

πŸ“Š Observability

Two lines give you full GenAI trace data in .NET Aspire β€” token counts, latency, tool calls.

Observability
Michel Schep

See exactly what your agent does

πŸ’¬ Prompt & response inzichtelijk

Aspire toont de exacte user input en assistant output per LLM call β€” geen zwarte doos meer. Ideaal voor debugging en prompt tuning.

⏱️ Duration & token count

Elke LLM span toont duration (bijv. 1.79s) en token gebruik (bijv. 26 tokens) β€” direct zichtbaar zonder extra logging code.

🌳 Volledige trace hiërarchie

Van HTTP request β†’ AgentRunner β†’ invoke_agent β†’ chat gpt-5.1: zie precies waar in de call stack de LLM wordt aangeroepen.

⚑ Gewoon .UseTelemetry()

Één regel in je AIAgentBuilder. Aspire pikt het automatisch op via OpenTelemetry β€” zero extra configuratie.

Demo
Michel Schep
πŸ’»

Let's build it live

Building a MAF 1.5 agent from scratch β€” in the IDE, step by step.

πŸ”Œ OpenAI Client
β†’
πŸ” IChatClient
β†’
πŸ€– AIAgent
β†’
πŸ“Š Aspire
Get Started
Michel Schep
πŸ€–

Start building today

MAF 1.5 is production-ready, open source, and designed for .NET developers. Three layers, fifteen lines of code, and you have a running AI agent with full observability.

Michel Schep Questions? πŸ™‹