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:
- Initialization: An agent is created in Azure AI Foundry and registered in AI Refinery with the specified configuration.
- Sending a Query: A user query is forwarded from AI Refinery to the
Azure AI Agent
running on the Microsoft platform. - 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. - 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
underutility_agents
. - Ensure the
agent_name
you chose for yourAzureAIAgent
is listed in theagent_list
underorchestrator
.
Azure AI Agent Creation¶
Users can customize an Azure AI Agent
through Microsoft AI Foundry. To create an agent, follow these steps:
- Log in to AI Foundry.
- In the left sidebar, click on Agents.
- Click Create Agent.
- 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 theAzure AI Agent
Service and typically starts withasst_
.contexts
: allows for the provision of additional information during communication with theAzure AI Agent
.