Note
This project was a quick POC not meant for prduction use.
This project demonstrates how to build a multi-agent system using Azure AI Foundry. It includes a main agent that can delegate tasks to specialized agents for handling specific queries about stock prices and weather information. Tracing is implemented using Azure Application Insights, and the agents can utilize Bing Search for grounding capabilities.
Agents are created in Azure AI Foundry, and the application uses the Azure AI Projects Python SDK to interact with these agents. The main agent coordinates with specialized agents to provide accurate and relevant responses to user queries.
Tracing is implemented to monitor the interactions between agents and the user. The application provides a simple command-line interface for users to interact with the agents, allowing them to ask questions and receive responses based on the agents' capabilities.
The image below shows an example of how to interact with the agents. The main agent routes specific queries to specialized agents (weather, stock prices) that can provide accurate, grounded information.
- Multi-agent architecture: Main agent coordinates with specialized agents
- Agent tools: Integration with Bing Search for grounding capabilities
- Telemetry: Azure Application Insights integration for monitoring
- Interactive chat: Simple command-line interface for interacting with agents
- Azure account with access to Azure AI Services
- Azure AI Foundry project set up with appropriate permissions
- Application Insights resource (for telemetry and tracing)
- Bing Search resource configured as a grounding connection in AI Foundry
- Azure AI Foundry project: Create through the Azure Portal or Azure CLI
- Application Insights: Set up through Azure Portal and get the connection string
- Bing Search Connection: Configure in your AI Foundry project for grounding capabilities
This project includes a dev container configuration for Visual Studio Code, which provides a fully configured development environment with all required dependencies pre-installed.
Prerequisites:
Steps:
- Clone this repository
- Open the project in VS Code
- When prompted to "Reopen in Container", click "Reopen in Container". Alternatively, press F1, type "Remote-Containers: Reopen in Container" and press Enter
- Wait for the container to build and start (this may take a few minutes the first time)
- Copy
.env.templateto.envand update with your Azure resource values:PROJECT_ENDPOINT: Your Azure AI Foundry project endpoint URLAPP_INSIGHTS_CONNECTION_STRING: Connection string for Azure Application InsightsBING_CONNECTION_NAME: Full resource ID for your Bing grounding connection
- Run the application with
python main.py
Login and remembner to choose the correct Azure subscription if you have multiple
az loginRun the application:
python main.pyTo use an existing thread:
python main.py --thread <thread-id>Type your questions in the prompt and the agents will respond accordingly. Type 'exit' to quit the application.
main.py: Entry point for the applicationagent_service.py: Service for creating and managing agentsagent_instructions.py: Instructions for specialized and main agentsconfig.py: Configuration settings using Pydantic.env.template: Template for environment variables configuration.devcontainer/: Dev container configuration for VS Code
- Azure AI Projects Python SDK
- Azure AI Services Agents Quickstart
- Azure AI Services Bing Tool Code Samples
MIT



