Extend bot-based message extension as agent for Microsoft 365 Copilot
Note
- Ensure that Microsoft 365 Copilot is available for your organization. You have two ways to get a developer environment for Microsoft 365 Copilot:
- A sandbox Microsoft 365 tenant with Microsoft 365 Copilot (available in limited preview through TAP membership).
- An eligible Microsoft 365 or Office 365 production environment with a Microsoft 365 Copilot license.
- Bot-based search message extension agent is available in public developer preview.
- Only bot-based message extensions with search commands can be extended as agents for Microsoft 365 Copilot.
Microsoft 365 Copilot, powered by an advanced processing and orchestration engine, integrates Microsoft 365 apps, Microsoft Graph, and Large Language Models (LLMs) to transform your words into a potent productivity tool. Although Microsoft 365 Copilot can utilize apps and data within the Microsoft 365 ecosystem, many users rely on various external tools and services for work management and collaboration. By extending your message extension as an agent in Microsoft 365 Copilot, you can enable users to interact with third-party tools and services, therefore empowering them to achieve more with Microsoft 365 Copilot. You can achieve this extension by developing an agent or connecting to an external data source.
See the video to learn more about extending Microsoft 365 Copilot using Microsoft Teams message extensions:
What is an agent?
An agent allows Microsoft 365 Copilot to interact directly with third-party data, apps, and services, enhance its capabilities, and broaden its range of capabilities. Agents allow Microsoft 365 Copilot to:
- Fetch real-time information, such as the latest news coverage on a product launch.
- Retrieve knowledge-based information, such as a team’s design files in Figma.
Descriptions enhance the usability and effectiveness of a message extension agent. The following description offer a clear and concise summary of the app’s features:
- App description: App description helps improve your app discoverability in the Teams Store.
- Command description: Command description maps user intent and utterance to search command inside an agent and must be built based on the analysis of the user intent and keywords.
- Parameter description: Parameter description explains the requirements of the system in a natural language with output format.
- Semantic description: Semantic description helps Microsoft 365 Copilot generate content by providing a conceptual understanding of the agent's capabilities and scenarios where it can help achieve user goals and match user’s intent with the agent's capabilities.
For more information, see guidelines to create and upgrade agents.
All bot-based search message extensions that are eligible for agent support must meet policy requirement and are subject to validation to ensure the agent meets quality, security, privacy, and usefulness expectations. You can create a bot-based search message extension using Teams Toolkit for Visual Studio Code, Visual Studio, Teams Toolkit command line interface (CLI), or Developer Portal for Teams and extend the message extension to function as an agent in Microsoft 365 Copilot.
Prerequisites
Before you get started, ensure that you're familiar with the following standards and guidelines for building message extension agents for Microsoft 365 Copilot:
Standards for compliance, performance, security, and user experience outlined in Teams Store validation guidelines.
Guidelines to create or upgrade a message extension agent for Microsoft 365 Copilot.
Create bot-based message extension
Important
Agents for Microsoft 365 Copilot are in preview and only work in Microsoft 365 Copilot in Teams.
Let's create a bot-based search message extension that can search npm registries in Teams and Microsoft 365 Copilot and share results through the compose message area of the Microsoft Teams client.
Before you get started, ensure that you install the following tools to build and deploy your message extension:
- Install the latest Teams Toolkit prerelease version.
- Ensure that the Develop Copilot Plugin feature flag is enabled. To enable the feature flag, follow these steps:
- Open Visual Studio Code.
- Go to Manage > Settings.
- Enter Teams Toolkit in the Search settings search box.
- Under Extensions, select the Fx-extension: Develop Copilot Plugin checkbox.
To create a bot-based search message extension agent using Visual Studio Code, follow these steps:
Open Visual Studio Code.
From the left pane, select Teams Toolkit.
Select Create a New App.
Select Message Extension.
Select Custom Search Results.
Select Start with a Bot.
Select a programming language.
Select Default folder.
Enter the name of your app and select Enter. Teams Toolkit scaffolds your app and creates a message extension.
To run your message extension in Teams, follow these steps:
From the left pane, select Teams Toolkit.
Under ACCOUNTS, perform the following steps:
Select Sign in to Microsoft 365 and enter your Microsoft 365 credentials.
Select Sign in to Azure and enter your Azure credentials.
From the left pane, select Run and Debug (Ctrl+Shift+D).
Select Debug in Teams (Edge) or Debug in Teams (Chrome). Teams Toolkit launches your app in Teams using a web browser.
Select Add. The app is installed on Teams.
Go to a chat and select Actions and apps.
From the message extension fly-out menu, enter the name of your message extension in the search box.
Select your message extension and enter your search query.
Select a product from the list. Teams unfurls the product as an Adaptive Card in the message compose area.
Select Send.
Trigger message extension in Microsoft 365 Copilot
To trigger the message extension as agent in Microsoft 365 Copilot in Teams, follow these steps:
Select Apps.
Search for Copilot and open Microsoft 365 Copilot.
Select Plugins.
From the list of plugins, turn on the toggle for your message extension.
From the message compose area, send a message to Microsoft 365 Copilot to search for npm package information in Teams and Microsoft 365 Copilot. For example, find the npm package info on teamsfx-react in npm-searchlocal.
Note
This prompt might not always make Microsoft 365 Copilot include a response from your message extension. If it happens, try some other prompts or leave feedback to us by downvoting the Microsoft 365 Copilot response and leave a message.
For more on testing your plugin in Microsoft 365 Copilot, see debugging plugin selection.
Enable message extension as a plugin for Copilot for meetings
Ensure that you've created a bot-based message extension and extended it as a plugin for Microsoft 365 Copilot. Before you get started, follow the guidelines listed in ensure your Copilot plugins work in Teams meetings to extend your plugin for Copilot for meetings.
To enable message extension as a plugin for Copilot for meetings, follow these steps:
Go to a Teams meeting.
Select Join.
In the meeting window, select Copilot.
Select Start transcription.
Select the Spoken language and select Confirm. The Copilot for Teams pane appears.
In the Copilot for Teams pane, at the bottom-right corner, select the Copilot Plugin Button.
Search for your plugin and turn on the toggle for your plugin.
From the compose area, select More prompts to send a static prompt or you can type your own prompt and select Send.
Copilot for meetings helps your meetings to be better and more productive. You can make meetings more interactive, which helps users by giving them a smoother and more interesting experience.
Step-by-step guide
Follow the step-by-step guide to build a bot-based search message extension agent for Microsoft 365 Copilot.