Skip to content

Azure AI Agent

Azure AI Agent is a third-party agent hosted on Microsoft Azure through the AI Foundry. This cloud-hosted agent handles tasks such as interpreting user queries, determining when to invoke specific tools, executing these tools, and returning processed results to the user.

Our AI Refinery SDK allows seamless integration with a user's customized Azure AI Agent using the AzureAIAgent class. This integration brings the full power of the Azure AI Agent to applications, enhancing performance and capabilities on our AI Refinery platform.

Workflow Overview

The workflow of the AzureAIAgent class consists of four components:

  1. Initialization: An agent is created in Azure AI Foundry and registered in AI Refinery with the specified configuration.
  2. Sending a Query: A user query is forwarded from AI Refinery to the Azure AI Agent running on the Microsoft platform.
  3. Microsoft-Side Processing: The Azure AI Agent decides whether to use predefined tools, knowledge bases, or other resources and processes the query in the Microsoft platform.
  4. Receiving and Parsing the Response: The Azure AI Agent returns the processed results to AI Refinery, where they are then parsed to extract the final answer.

Usage and Quickstart

To quickly set up an AI Refinery project with an AzureAIAgent, the user should first create their own Azure AI Agent in AI Foundry. Once the agent is ready, use the YAML configuration template below to integrate it into the AI Refinery project. Specifically, ensure the following configurations are included:

  • Add a utility agent with agent_class: AzureAIAgent under utility_agents.
  • Ensure the agent_name you chose for your AzureAIAgent is listed in the agent_list under orchestrator.

Azure AI Agent Creation

Users can customize an Azure AI Agent through Microsoft AI Foundry. To create an agent, follow these steps:

  1. Log in to AI Foundry.
  2. In the left sidebar, click on Agents.
  3. Click Create Agent.
  4. Interact with the Copilot Helper, which will guide you step-by-step in providing:
    • Name of the agent
    • Description
    • Simple instructions for the agent to follow

Once created, users can optionally customize their agent by:

  • Adjusting the temperature (controls creativity vs. determinism)
  • Uploading files to the Knowledge Base
  • Enabling built-in tools such as the Code Interpreter

Template YAML Configuration of AzureAIAgent

See the YAML template below for the AzureAIAgent configuration.

orchestrator:  
  agent_list:  
    - agent_name: <name of the agent>  # The name you choose for your AzureAIAgent.  

utility_agents:
  - agent_class: AzureAIAgent
    agent_name:  <name of the agent>  # The name you choose for your AzureAIAgent  
    agent_description: <description of the agent>  # Description of functionality
    config:
      connection_string: <project connection string> # A connection string to access the project in Azure AI Foundry
      agent_id: <unique agent ID> # A unique agent ID assigned after creation
      contexts:
        - "date"
        - "chat_history"

In this template:

  • connection_string is required to authenticate and connect the application to the Azure AI Foundry project.
  • agent_id is a unique identifier assigned to each agent within the Azure AI Agent Service and typically starts with asst_.
  • contexts: allows for the provision of additional information during communication with the Azure AI Agent.