Build Your First AI Agent in .NET
AI & .NET
2 days
Duration
10-40 people
Group Size
Intermediate
Level
2-Day Intensive

Build Your First AI Agent in .NET

You write the agent yourself in C#, starting from a raw HTTP call and finishing with something other programs can call. Two days, and an honest answer about when an agent is the wrong tool.

What you'll achieve:

  • An agent you built yourself, running against a .NET backend, on your machine
  • Tool calling, memory and the agent loop written by hand before any framework hides them
  • The hardening work most demos skip, plus your agent exposed over MCP
  • A straight answer to when an agent earns its cost and when a function call does the same job

Prerequisites:

  • You build APIs in C# and are comfortable in the language
  • You have met prompts and completions before, at least in passing
  • Install the .NET 10 SDK and Git before you arrive
  • Create a GitHub account and an Azure account. Expect 5 to 10 euros of Azure usage.
Instructor
Gui Ferreira
Software Engineer Educator | Microsoft MVP

Somebody at your company has already shipped an agent. It books meetings, or it triages support tickets, or it reads invoices and decides something about them. You've seen the demo. What you haven't seen is the code, and you have a suspicion that the demo and the code are quite far apart.

They usually are. A chat box wired to an API is a weekend. An agent that reasons about real data, calls tools without going off the rails, remembers what you told it ten minutes ago and doesn't leak your database to a prompt injection is a different piece of engineering.

What you build

One thing, across two days: a personal finance assistant. It reads a question in plain language, pulls actual transaction data, holds the thread of a conversation, and tells you something useful about your money.

We start with a raw HTTP call to a model. No SDK, no framework, nothing hiding the mechanics. Then we refactor behind a clean abstraction and keep building on it, so that by the end you can look at any agent library and recognise what it's doing, because you already wrote it once by hand.

Day one is the machinery: the model, tool calling, the loop. Day two is everything that stands between a working prototype and something you'd let a colleague use. Memory that doesn't blow the context window. Prompt injection. Asking before it deletes anything. Knowing what it did after the fact.

What this isn't

Not a tour of frameworks. Not a slide deck about what agents might mean for your industry. And not a two-day argument that agents are the answer, because they often aren't. A decent slice of day two is about telling the difference between a problem that needs an agent and a problem that needs a function call, which is a cheaper and more reliable thing to own.

Is this for you?

If you build APIs in C# and you'd rather learn by writing code than by watching someone else's, yes. You don't need any AI background beyond having heard of prompts and completions.

Before you come

Set up the Azure account at home. Every workshop where people do it in the room loses the first hour, and the first hour is the one where we write the raw call that everything else is built on.

Curriculum

You build one thing across the two days: a personal finance assistant that reads natural language, pulls real transaction data, remembers what you told it earlier, and gives you an answer you can check. We use Azure AI services, and the code moves to OpenAI, Anthropic or Google by changing a line.

1

Talking to the model directly

Day 1

We start at the metal, with a raw HTTP call and no library in the way. Then we refactor behind an abstraction you keep using for the rest of the two days.

Key Topics:

  • What the model is actually doing when it answers you
  • Prompting, treated as an engineering problem rather than a folk art
  • One raw API call, no SDK, so you see the shape of the thing
  • Moving to IChatClient, and what that buys you the day the provider changes
2

Tool calling

Day 1

Up to here it can only talk. Now it starts doing things, and you find out that a tool the model quietly ignores is worse than no tool at all.

Key Topics:

  • Structured output, and getting a shape back you can deserialise
  • Declaring the tools it is allowed to reach for
  • Describing a tool well enough that the model picks the right one
  • Pulling real transaction data, and failing safely when the call does not work
3

The agent loop

Day 1

Feed the tool result back in and let it decide what happens next. Then put a ceiling on it, before it decides to do that four hundred times.

Key Topics:

  • What the model is actually deciding at each pass
  • Multi-step runs across several tools
  • Capping the loop, and what an uncapped one costs you by Friday
4

Memory and the context window

Day 2

Every turn starts from nothing unless you carry the history yourself. Carrying it naively walks into the context window at full speed.

Key Topics:

  • Why an agent forgets between turns
  • Keeping conversation history that stays useful
  • Summarising history once it outgrows the window
5

Making it safe to ship

Day 2

The part the demos skip. Make it safe enough to put in front of someone who is not you.

Key Topics:

  • How agents fail, and how you find out before your users do
  • What prompt injection looks like when it lands on your agent
  • Asking before it does something destructive
  • Retries, fallbacks, and enough logging to reconstruct a bad run
6

Putting it behind a protocol

Day 2

Right now it only runs where you run it. Give it an interface another program can call, then see what a framework would have done for you.

Key Topics:

  • What MCP is and what it solves
  • Putting an MCP server in front of what you built
  • Where the Microsoft Agent Framework picks up
  • When a second agent helps, and when it is one agent too many

Catch it in public

When this runs in public it runs at a conference, and the conference sells the seat. Registration goes to them, not to me.

NDC Oslo

2-Day Intensive

September 14-15, 2026
Oslo, Norway
Seats available

Already going? It runs the Monday and Tuesday before the talks start.

NDC Porto

2-Day Intensive

November 17-18, 2026
Porto, Portugal
Seats available

Already going? It runs the Tuesday and Wednesday before the talks start.

NDC London

2-Day Intensive

January 25-26, 2027
London, United Kingdom
Seats available

Already going? It runs the Monday and Tuesday before the talks start.

What participants say

The last time this ran in Oslo, at NDC AI in June 2026, all 20 people who filled in the feedback form rated both the instructor and the content "Very Good". The forms are anonymous, so the quotes below carry no names.

Gui was an excellent instructor, fantastic pace, good explanations and analogies. Covered each topic in depth.
Top notch workshop! The content was relevant and easy to follow, even without prior knowledge about the topic.
The instructor teaches abstract concepts by using hands-on techniques in an efficient way... his teaching style which is engaged, inspiring and honest.

Frequently Asked Questions

Want this for your team?

Private sessions run on-site or remote, against the codebase your team actually works in. Black Lab Studios, the company I founded, handles the scoping and the contract. I run the room.