Skip to content
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

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to set up the "Session 5: Build AI-Powered Agents Fast with Foundry Local" agent in my project.

Please run this command in my terminal:
# Add AGENTS.md to your project root
curl --retry 3 --retry-delay 2 --retry-all-errors -o AGENTS.md "https://raw.githubusercontent.com/microsoft/edgeai-for-beginners/main/translations/en/Module08/05.AIPoweredAgents.md"

Then explain what the agent does and how to invoke it.

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

Foundry Local enables rapid prototyping of agent-based applications, including system prompts, grounding, and orchestration patterns. When agent support is available, you can standardize on OpenAI-compatible function calling or integrate Azure AI Agents for hybrid cloud designs. > 🔄 Updated for Modern SDK: This module has been updated to align with the latest patterns in the Microsoft Foundry-Local repository and reflects the full implementation in samples/05/. The examples now utilize the modern foundry-local-sdk and OpenAI client instead of manual API requests. 🏗️ Architecture Highlights: • Specialist Agents: Retrieval, Reasoning, and Execution agents with distinct roles • Coordinator Pattern: Manages workflows across multiple agents with feedback loops • Modern SDK Integration: Leverages FoundryLocalManager and OpenAI client • Production Ready: Includes error handling, performance monitoring, and health checks • Comprehensive Examples: Interactive Jupyter notebook showcasing 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 documentation: 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

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 9d ago
Active
Adoption1K+ stars on GitHub
1.4k ★ · Popular
DocsREADME + description
Well-documented

GitHub Signals

Stars1.4k
Forks300
Issues3
Updated9d ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code
Claude.ai