Edit

Share via


Tutorial: Create declarative agents using Microsoft 365 Agents Toolkit

A declarative agent is a customized version of Microsoft 365 Copilot that allows users to create personalized experiences by declaring specific instructions, actions, and knowledge. This guide provides information about how to build a declarative agent by using Microsoft 365 Agents Toolkit (an evolution of Teams Toolkit).

The agent that you build in this tutorial targets licensed Microsoft 365 Copilot users. You can also build agents for Microsoft 365 Copilot Chat users, with limited capabilities. For details, see Agent capabilities for Microsoft 365 users.

Screenshot shows the answer from the declarative agent in Microsoft 365 Copilot.

For overview information, see Declarative agents for Microsoft 365 Copilot.

Note

Declarative agents based on Microsoft 365 Copilot are now supported in Word and PowerPoint.

Prerequisites

Before you start, make sure that Microsoft 365 Copilot is available for your organization.

The following options are available for your development environment:

The following resources are required to complete the steps described in this article:

Note

The screenshots and references to user interface of the Microsoft 365 Agents Toolkit (an evolution of Teams Toolkit) in this document were generated using the latest Release version, 6.0. Pre-Release versions of Agents Toolkit may differ from the user interface in this document.

You should be familiar with the following standards and guidelines for declarative agents for Microsoft 365 Copilot:

Create a declarative agent

Begin by creating a basic declarative agent.

  1. Open Visual Studio Code.

  2. Select Microsoft 365 Agents Toolkit > Create a New Agent/App.

    A screenshot of the Create a New Agent/App button in the Agents Toolkit sidebar

  3. Select Declarative Agent.

    A screenshot of the New Project options with Agent selected

  4. Select No Action to create a basic declarative agent.

  5. Select Default folder to store your project root folder in the default location.

  6. Enter My Agent as the Application Name and press Enter.

  7. In the new Visual Studio Code window that opens, select Microsoft 365 Agents Toolkit, then select Provision in the Lifecycle pane.

    A screenshot of the Provision option in the Lifecycle pane of Agents Toolkit

Test the agent

  1. Navigate to the Copilot application with the URL https://m365.cloud.microsoft/chat.

  2. Next to the New Chat button, select the conversation drawer icon.

  3. Select the declarative agent My Agent.

    A screenshot of the declarative agent in Copilot

  4. Enter a question for your declarative agent and ensure that it replies with "Thanks for using Microsoft 365 Agents Toolkit to create your declarative agent!"

    A screenshot of an answer from the declarative agent in Microsoft 365 Copilot

Next step