Create a declarative agent

Completed

A declarative agent is implemented in a Microsoft 365 app.

You create an app package which contains:

  • app.manifest.json: The app manifest file describes how your app is configured, including its capabilities.
  • declarative-agent.json: The declarative agent manifest describes how your declarative agent is configured.
  • color.png and outline.png: A color and outline icon used to represent your declarative agent in the Microsoft 365 Copilot user interface.

App manifest

The app manifest describes how your app integrates with Microsoft 365.

The following code snippet shows how to configure your app with a declarative agent and tell Microsoft 365 where to find its configuration:

"copilotAgents": {
  "declarativeAgents": [            
    {
      "id": "declarativeAgent",
      "file": "declarativeAgent.json"
    }
  ]
},

Declarative agent manifest

The declarative agent manifest describes how your agent is configured. In the manifest, you define the custom instructions, data sources used as grounding data, conversation starters, and custom actions.

The following code snippet shows an example of a declarative agent with custom instructions:

{
  "$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.3/schema.json",
  "version": "v1.3",
  "name": "da-product-support",
  "description": "Declarative agent created with Microsoft 365 Agents Toolkit",
  "instructions": "You are a declarative agent and were created with Team Toolkit. You should start every response and answer to the user with \"Thanks for using Microsoft 365 Agents Toolkit to create your declarative agent!\\n\\n\" and then answer the questions and help the user."
}

Microsoft 365 Agents Toolkit

Microsoft 365 Agents Toolkit is an extension for Visual Studio Code that helps developers build declarative agents for Microsoft 365 Copilot.

Use out of the box templates to scaffold declarative agent projects with support for environment variables and workflows to upload your declarative agent to Microsoft 365, which saves you time.

Screenshot of Visual Studio Code showing a declarative agent project created using Microsoft 365 Agents Toolkit.

A declarative agent project contains the following important files and folders:

  • teamsapp.yml: This file contains a workflow used by Microsoft 365 Agents Toolkit to build the app package and upload it to your Microsoft 365 tenant.
  • appPackage: This folder contains source files that are included in the app package, including the app manifest and declarative agent manifest.
  • env: This folder contains environment files that Microsoft 365 Agents Toolkit uses to hold values used in workflows.