Building Autonomous Agents with Copilot Studio

4 minute read

Building Autonomous Agents with Copilot Studio

Introduction

In the era of AI-driven automation, Copilot Studio is revolutionizing how businesses build and deploy autonomous agents. These agents can handle tasks independently, make intelligent decisions, and enhance user interactions across various domains.

This article explores how to build an autonomous agent using Copilot Studio, its key features, and practical applications.

What is an Autonomous Agent?

Autonomous agents are AI-driven systems that operate independently, making decisions and performing tasks without continuous human intervention. These agents perceive their environment, process information, and take actions based on predefined goals or learned behaviours.

Key Characteristics:

  • Autonomy: Operate without direct human control.
  • Perception: Sense and interpret their environment.
  • Decision-making: Analyze data and decide on actions.
  • Adaptability: Learn from interactions and improve over time.
  • Goal-driven: Work towards specific objectives.

Why Use Copilot Studio for Autonomous Agents?

Copilot Studio simplifies the creation of autonomous agents by providing a low-code/no-code environment with powerful AI capabilities. Key benefits include:

  • Declarative Agent Building: Define logic and workflows without extensive coding.
  • Integration with Microsoft 365 & External APIs: Access data from SharePoint, Teams, Dataverse, and third-party services.
  • AI-Powered Responses: Leverage Azure OpenAI for generating dynamic, human-like conversations.
  • Automation & Workflows: Automate repetitive tasks like customer support, travel planning, and document generation.

Use Case: Margie Travels Autonomous Agent

Margie Travels is leveraging Copilot Studio to build an autonomous travel assistant that enhances the travel planning experience for users. The Margie Travels Copilot acts as a virtual travel assistant, providing personalized city exploration recommendations, hotel accommodations, and itinerary suggestions based on user preferences.

User Journey Example

A traveller sends an email request:

“I’m visiting Dubai next week for three days. Recommend some must-see attractions and a good hotels”.

Based on the configured trigger (When a new email arrives), the agent triggers and perform the action.

Set up an agent

Start by creating an agent in Copilot Studio.

Description:

Giving a meaningful description is the key here. The description is used as metadata to help identify the agent by its skill and defines its purpose.

For example:

You are an agent that assists travelers in exploring cities and finding hotel accommodations. You are part of Margie Travels’ customer service team, and you have a friendly and informative tone. You will analyze user preferences and provide personalized recommendations for attractions, dining, and experiences in various cities. Additionally, you help users find suitable hotel accommodations based on their needs. You aim to make travel planning effortless while ensuring users receive relevant and up-to-date information, enhancing their overall travel experience.

Instructions:

It defines the personality and behaviour of an agent on what to perform and how to act.

For example:

You are a travel assistant tasked with providing personalized travel recommendations and hotel accommodations to users. Users will send a request with details of their destination and preferences, and you should use the knowledge provided to suggest relevant attractions and hotel options. You should follow the steps below without missing any. Once all actions are completed, your work is finished. When you receive a new request with the subject line “Travel Assistance,” perform the following tasks without asking the user for additional information.

  1. Search your internal KB for city guides, recommended attractions, and available hotel accommodations that match the user’s preferences.
  2. Use the action Send an email to provide the user with personalized travel recommendations, including top attractions and suitable hotel accommodations. The message should include a friendly greeting, a summary of the recommendations, and a suggestion to visit the Margie Travels website for further details. Use a friendly sign-off as “Margie Travels Assistant.

Knowledge:

Add your knowledge source that can be used by an agent. Optionally disable the option to allow the AI to use its own general knowledge to prefer that your agent is grounded with your specific knowledge sources, instead of using the foundational knowledge that the generative AI is trained on.

Actions:

Add an action to help agent complete the task. In this example, we will use “Send an email” action.

Triggers:

You can set up custom agents to take actions or invoke topics automatically in response to specific events using event triggers. Event triggers are initiated by external events beyond the agent’s control. For example,

  • When an item is created in SharePoint
  • When a file is created in OneDrive
  • When a new email arrives

In this example, we will use When a new email arrives trigger.

Test the autonomous agent

To test the autonomous agent, based on the specified instruction. Send an email with below content:

Subject: Travel Assistance

Body:

Hi,

I need guidance on travel to London.

The autonomous agent is invoked by the trigger, and it takes the action to send an email.

The activity map will show the steps followed:

Conclusion

Building an autonomous agent in Copilot Studio is a game-changer for businesses looking to enhance efficiency and customer engagement. With AI-powered interactions, seamless integrations, and automation capabilities, Copilot Studio empowers organizations to create intelligent, self-sufficient agents that drive productivity and improve user experiences.

References

Leave a comment