Practical AI Agent Recipes in .NET for Real-World Business Systems
Buch, Englisch, Format (B × H): 155 mm x 235 mm
ISBN: 979-8-8688-3641-1
Verlag: APRESS L.P.
Microsoft Agent Framework is Microsoft's new foundation for building agentic systems on .NET, and it is the direct successor to both Semantic Kernel and AutoGen, from the same teams. It takes AutoGen's simple agent abstractions and pairs them with the enterprise pieces Semantic Kernel was known for: session-based state, type safety, middleware, telemetry. Then it adds graph-based workflows for the times you need explicit control over how multiple agents coordinate.
Underneath sits Microsoft.Extensions.AI and the IChatClient abstraction, which is why the same agent code runs against Microsoft Foundry, Azure OpenAI, OpenAI, Anthropic, Ollama, or any compatible provider.
Most .NET developers who try agentic AI get as far as a demo and stop. Agents that call tools, remember a customer, work together, and can be traced, evaluated and hosted are a different kind of problem, and most material either stays theoretical or hides the technique inside one large project. This book goes the cookbook route instead with a collection of self-contained recipes, each a complete .NET 10 project you can drop into an empty folder and run.
Every recipe starts from a real situation in a running example, such as a guitar shop's advisor and the team behind it. You'll meet an agent that checks the price list through a function tool, one that picks the right instrument from the catalog by meaning instead of by name, one that asks a human before spending money, and one that hands a customer over to a specialist. Each recipe was built and run against the released packages, and the output shown is what actually came back.
You also choose where the model runs, recipe by recipe: locally with Ollama, in Ollama Cloud, or in Microsoft Foundry. Switching takes a single change at the top of the file because nothing below it depends on the provider.
The book closes with a capstone. A team of agents researches, writes, reviews and publishes a monthly newsletter, which pulls concurrent and sequential orchestration, MCP, structured output, human approval, tracing, evaluation, and hosting into one working application.
What You Will Learn:
·Building agents on IChatClient: configuring them safely, streaming responses, and moving between local Ollama, Ollama Cloud, Microsoft Foundry and OpenAI-compatible endpoints without rewriting code
·Function tools, MCP servers, Foundry-hosted tools, and Agent Skills, with validation and a human in the loop where the stakes justify it
·Conversations that hold together: sessions, persisted and trimmed chat history, extra context, RAG, and per-customer memory through context providers
·Middleware at the agent-run, function-call and chat-client layers, for logging, guardrails, and rate limiting
·Structured output from JSON schemas, including what to do when the model hands back something malformed
·Workflows built from executors and edges: fan-out/fan-in, conditional routing, checkpoints, human-in-the-loop gates, declarative YAML
·Multi-agent orchestration with the Sequential, Concurrent, Handoff, Group Chat, and Magentic patterns, or exposing a whole workflow as a single agent
·OpenTelemetry tracing, inspection in DevUI and the Aspire Dashboard, and quality checks through local evaluation and LLM-as-judge
·Hosting in ASP.NET Core and exposing agents over A2A, OpenAI-compatible endpoints and AG-UI, or deploying them as Foundry-hosted agents
·The Agent Harness, for planning, memory, sandboxed shell access, CodeAct and background agents
Who This Book Is For:
This book is for C# and .NET developers and architects who want to build agentic applications with Microsoft Agent Framework, whether agentic AI is new to them or they're coming over from Semantic Kernel or AutoGen. You should be comfortable with C# and modern .NET. No prior experience with LLMs or agent frameworks is required.
Zielgruppe
Professional/practitioner
Autoren/Hrsg.
Fachgebiete
- Mathematik | Informatik EDV | Informatik Betriebssysteme Linux Betriebssysteme, Open Source Betriebssysteme
- Mathematik | Informatik EDV | Informatik Programmierung | Softwareentwicklung Microsoft Programmierung
- Mathematik | Informatik EDV | Informatik Programmierung | Softwareentwicklung Software Engineering
Weitere Infos & Material
Chapter 1 — Introduction to the Book.- Chapter 2 — Providers and Models.- Chapter 3 — Development Environment and the Agent Template.- Chapter 4 — Function Tools.- Chapter 5 — Multi-Turn Conversations and Sessions.- Chapter 6 — Context and Memory.- Chapter 7 — Agent Middleware.- Chapter 8 — Advanced Tools and MCP.- Chapter 9 — Structured Outputs.- Chapter 10 — Introduction to Workflows.- Chapter 11 — Parallel and Conditional Workflows.- Chapter 12 — Checkpointing and Resumption.- Chapter 13 — Human-in-the-Loop in Workflows.- Chapter 14 — Multi-Agent Orchestrations I: Sequential and Concurrent.- Chapter 15 — Multi-Agent Orchestrations II: Handoff and Group Chat.- Chapter 16 — Multi-Agent Orchestrations III: Magentic.- Chapter 17 — Workflows as Agents.- Chapter 18 — Observability with OpenTelemetry.- Chapter 19 — Evaluating Agent Quality.- Chapter 20 — Local Hosting and Exposure.- Chapter 21 — Agent Harness.- Chapter 22 — Capstone Project: Guitar News Newsletter, Written by a Team of Agents.




