The Microsoft Agent Framework (MAF) is integrated with Foundry to provide a rich SDK for building agents with tools, memory, and structured outputs.
import { Agent, AgentClient } from "@microsoft/agents";
const agent = new Agent({
name: "HelpDeskAgent",
instructions: "You are an IT help desk assistant.",
model: "gpt-4o",
});
const client = new AgentClient(agent);
const response = await client.sendMessage("How do I reset my password?");
console.log(response.text);
import { Tool } from "@microsoft/agents";
const ticketTool = new Tool({
name: "create_ticket",
description: "Create an IT support ticket",
parameters: {
title: { type: "string" },
priority: { type: "string", enum: ["low", "medium", "high"] }
},
handler: async (args) => {
return await createTicketInServiceNow(args);
}
});
agent.addTool(ticketTool);
// Combine knowledge base search + ticket creation
agent.addTools([
knowledgeBaseTool,
ticketTool,
calendarTool,
emailTool
]);
MAF's DevUI provides a visual debugger for agent conversations, tool calls, and memory state. Use it during development to inspect agent behavior.
const agent = new Agent({
name: "DataExtractor",
instructions: "Extract structured data from text.",
outputSchema: {
type: "object",
properties: {
name: { type: "string" },
date: { type: "string" },
amount: { type: "number" }
},
required: ["name", "date", "amount"]
}
});
MAF supports orchestrating multiple agents in sequence (pipeline) or in parallel (fan-out) using the Orchestrator.