How I build agents
Anatomy of an agent, on Microsoft Agent Framework
One loop, five moves. The model decides, the tools act, the thread remembers, the schema keeps the output honest.
// Microsoft Agent Framework + Microsoft.Extensions.AI
var agent = chatClient.CreateAIAgent(
name: "rda-assistant",
instructions: prompts.PurchaseRequest,
tools: [
AIFunctionFactory.Create(snow.SearchSupplier),
AIFunctionFactory.Create(snow.GetBudget),
AIFunctionFactory.Create(snow.CreateDraft),
]);
var thread = agent.GetNewThread();
var reply = await agent.RunAsync(message, thread);