· 5 min read
Extending your Graph Connector to a Microsoft 365 Copilot Agent
Are you looking to extend your Graph Connector as a data source in Microsoft 365 Copilot, here is an example for you to understand the process of consuming the data in your agent.
Introduction
With Ignite 2024 around the corner and plenty of cool new sessions to watch, get inspiration, learn new topics and marvel at great new features. I thought I’d use the data from the session catalogue as a data source for a declarative agent using the Graph Connector Ignite 2024 Sessions sample as a demonstration of how to link these two components together.
Graph Connector Sample
In my earlier blog post Tips from Building a Ignite 2023 Microsoft Graph Connector for Copilot for Microsoft 365 which talks about using content from Ignite for the session catalogue. Since Ignite 2024 is live in a few days, I have updated the sample for this year, which was recently merged in to the PnP Samples repository on GitHub here: Ingest local json content using PowerShell using Ignite sessions as a example | PnP Graph Connector Samples (GitHub).
From this sample, you will have a working list of Ignite 2024 sessions in which this article is based as a data source.
Run the Setup-GraphConnector.ps1
to get going on your tenant.
Once this is installed, keep a reference to the connector ID: pkbignite2024sessions
this will come in handy later when you want to use this in your new agent.
Teams Toolkit - Building a declarative agent
Once you have installed the Graph Connector, lets proceed and create a Declarative agent. From this point, I assume you have setup the following prerequisites:
- Installed
- Visual Studio Code
- Installed the Teams Toolkit Extension
- Setup
- Microsoft 365 Tenant with a Copilot License
- Enable side loading of Teams apps
- Have an Azure Subscription
- You have setup the Ignite 2024 Session Sample and it returns details in Microsoft Search
In Visual Studio Code, navigate to the Teams Toolkit icon, and create a new App with the following path: Create a New App > Copilot Agent > Declarative Agent > No Plugin > Select a Folder, then the name for the app, for me this was “Ignite 2024 Agent”. Then this will scaffold out a new application with a set of directories and JSON files.
Referencing the Graph Connector
When you have scaffoled out the application, you will need to setup the following areas of you application but this is resonable straight forward says the experienced coder lol.
Let’s look into the declarativeAgent.json
file, this will contain the configuration where we intend to update this file to target a specific data source, also we may do a couple of things to add some bells and whistles.
Firstly, let’s get this working with the Graph Connector data. Within declarativeAgent.json file, add the following capabilities block, below the instructions property:
"capabilities": [
{
"name": "GraphConnectors",
"connections": [
{
"connection_id": "pkbignite2024sessions"
}
]
}
]
You can, if you want Provision
the app and this will appear in BizChat (Microsoft Teams Copilot app) but I would recommend a few optional tweaks before doing so:
Add below the instructions property, to help users get started with conversations, also, if your testing this will help you quickly type the prompt:
"conversation_starters": [
{
"title": "List example sessions for Copilot",
"text": "List 5 examples of Copilot sessions"
},
{
"title": "List an example session",
"text": "Show details for BRK279"
},
{
"title": "List sessions about Copilot Extensibility",
"text": "Show list of sessions about Copilot Extensibility"
}
],
Save the file ✅
Go to instruction.txt
file - this will contain the instructions for that is sent to the LLM model when processing the prompt. Be descriptive here about the app, for this sample I used
You are a Ignite 2024 agent to help users find sessions for Ignite Mirosoft Conference.
Save the file ✅
Ok, there are more for example, Icons, Good and well written app descriptions, Deployment process to get the app into a production state but lets hit Provision and see the result:
There, as you can see, the agent is now consuming that specific data source enabling you to use a connection to an external system and consume its data for your users to query via Microsoft 365 Copilot.
Conclusion
This is a example of using a Graph Connector with a Microsoft 365 Copilot to get you started in your journey of linking useful content into the Copilot experience for your users. Exciting new advancements I’m sure will be announced in Ignite and recommend you watching to see what you can utilise in your environment to squeeze every last bit of value out of the license.
Resources
The following resource could be useful for you to learn further:
- Adding that Chef’s Kiss to your Teams App descriptions for Copilot | pkbullock blog
- Tips from Building a Ignite 2023 Microsoft Graph Connector for Copilot for Microsoft 365 | pkbullock blog
- Declarative agent schema for Microsoft 365 Copilot | Microsoft Learn
- Ingest local json content using PowerShell using Ignite sessions as a example | PnP Graph Connector Samples (GitHub)
- Microsoft Graph connectors samples | GitHub
- Microsoft 365 Copilot samples on Sample Solution Gallery | Microsoft
- Walkthrough Create declarative agents using Teams Toolkit | Microsoft Learn
Enjoy!