Agent

Session 5: Build AI-Powered Agents Fast with Foundry Local

by microsoft

AI Summary

A hands-on course teaching developers how to build AI-powered agents using Foundry Local with modern SDK patterns, function calling, and hybrid cloud designs. Benefits beginners and intermediate developers wanting to prototype agentic applications quickly on edge devices.

Install

# Add AGENTS.md to your project root
curl -o AGENTS.md "https://raw.githubusercontent.com/microsoft/edgeai-for-beginners/main/Module08/05.AIPoweredAgents.md"

Description

This course is designed to guide beginners through the exciting world of Edge AI, covering fundamental concepts, popular models, inference techniques, device-specific applications, model optimization, and the development of intelligent Edge AI agents.

Overview

Use Foundry Local to rapidly prototype agentic applications: system prompts, grounding, and orchestration patterns. When agent support is present, you can standardize on OpenAI-compatible function calling or use Azure AI Agents on the cloud side in hybrid designs. > 🔄 Updated for Modern SDK: This module has been aligned with the latest Microsoft Foundry-Local repository patterns and matches the comprehensive implementation in samples/05/. The examples now use the modern foundry-local-sdk and OpenAI client instead of manual requests. 🏗️ Architecture Highlights: • Specialist Agents: Retrieval, Reasoning, and Execution agents with distinct capabilities • Coordinator Pattern: Orchestrates multi-agent workflows with feedback loops • Modern SDK Integration: Uses FoundryLocalManager and OpenAI client • Production Ready: Includes error handling, performance monitoring, and health checks • Comprehensive Examples: Interactive Jupyter notebook with advanced features 📁 Local Implementation: • samples/05/multi_agent_orchestration.ipynb - Interactive examples and benchmarks • samples/05/agents/specialists.py - Agent implementations • samples/05/agents/coordinator.py - Orchestration logic References: • Foundry Local docs: https://learn.microsoft.com/en-us/azure/ai-foundry/foundry-local/ • Azure AI Foundry Agents: https://learn.microsoft.com/en-us/azure/ai-services/agents/overview • Function calling sample (Foundry Local samples): https://github.com/microsoft/Foundry-Local/tree/main/samples/python/functioncalling

tools.py

import json from typing import List, Dict, Any def get_weather(city: str) -> str: return f"Weather in {city}: Sunny, 25C"

Modern tools format for OpenAI API

TOOLS = [ { "type": "function", "function": { "name": "get_weather", "description": "Get current weather for a city", "parameters": { "type": "object", "properties": { "city": {"type": "string", "description": "City name"} }, "required": ["city"] } } } ] ` `python

Example usage

messages = [ {"role": "system", "content": SYSTEM_PROMPT}, {"role": "user", "content": "What's the weather in Paris?"} ] result = process_function_call(messages, TOOLS) print(result) ` Run: `powershell

Quality Score

B

Good

82/100

Standard Compliance72
Documentation Quality75
Usefulness78
Maintenance Signal100
Community Signal100
Scored Today

GitHub Signals

Stars1.3k
Forks279
Issues0
Updated23d ago
View on GitHub

Trust & Transparency

Open Source — MIT

Source code publicly auditable

Verified Open Source

Hosted on GitHub — publicly auditable

Actively Maintained

Last commit 23d ago

1.3k stars — Strong Community

279 forks

My Fox Den

Community Rating

Works With

Claude Code
claude_desktop