February 20th, 2025

Guest Blog: Revolutionizing AI Workflows: Multi-Agent Group Chat with Copilot Agent Plugins in Microsoft Semantic Kernel

Revolutionizing AI Workflows: Multi-Agent Group Chat with Copilot Agent Plugins in Microsoft Semantic KernelĀ 

Copilot Agent Plugins (CAPs) are revolutionizing how developers interact with Microsoft 365 data. By transforming natural language into seamless CRUD actions using Microsoft Graph and Semantic Kernel, CAPs enable the creation of intelligent, AI-driven solutions. This sample demonstrates a multi-agent group chat system where AI-powered agents collaborate across Contacts, Calendar, and Emailā€” with a standout Legal Secretary Agent ensuring compliance and multilingual support.Ā 

šŸ“ŗ Watch the full video: https://go.fabswill.com/capsagentsĀ Ā 

Why Multi-Agent Systems MatterĀ 

In the rapidly evolving AI landscape, a single assistant isn’t enough. Multi-agent systems provide a specialized, structured approach, leading to more accurate and efficient workflows. Here’s how each agent contributes:.Ā 

  • āœ… Chief of Staff Agent ā€“ Orchestrates interactions, intelligently routing queries to specialized agents.
  • āœ… Contacts Agent ā€“ Retrieves and manages contact information.
  • āœ… Calendar Agent ā€“ Handles scheduling and event retrieval.
  • āœ… Email Agent ā€“ Fetches and composes emails with AI-powered context.
  • āœ… Legal Secretary Agent ā€“ Ensures responses adhere to compliance guidelines and provides translations.Ā 

Each agent has a specific role, ensuring that requests are processed with precision and accountability. The Chief of Staff Agent intelligently routes queries and ensures appropriate execution.Ā 

Technical BreakdownĀ 

This .NET console application leverages Microsoft Semantic Kernel Plugins to execute OpenAPI-based workflows. Using a structured conversation flow, agents dynamically refine and evaluate prompts. Hereā€™s how it works:Ā 

  • Kernel Setup and ConfigurationĀ 
  • Plugin IntegrationĀ 
  • Agent-Orchestrated FlowĀ 
  • Compliance and Multilingual SupportĀ 

Architecture OverviewĀ 

Ā Image ArchitectureOverview MermaidDiagram

Technical Break down with ScreenshotsĀ 

We want to ensure that these assemblies are in your project and because we are using the Agents framework which is experimental, we will need to set some ā€œNoWarnā€s which you an do in the Program.cs and any class files but you can add them to your .csproj to cover all the files.

Image CSProjFile

In our sample on the Semantic Kernel repository, we avoided creating a separate copy of the plugins and we used relative paths in the code to point to the original plugin locations, but for folks building a sample themselves, you can clone the repo, or copy the plugins we have hand rolled for you to your project explorer as we have below.Ā Ā 

Image ProjectExplorer

The key to CAPs is an extension method that is available to you from the kernel object as seen on line 304 in the screenshot below. The method takes as a parameters the name(s) of your plugins you have created or have in the directory, the location of the manifest file (.json) within those directories, and copilotAgentPluginParameters which is basically tuning we have to ensure consistent and proper results, you will see that at the end of the sample in the #regions section. This tuning helps the LLM to understand the complexity of the OpenAPI file for Microsoft Graph. If you are creating your own plugins to use with CAPs, and the OpenAPI spec is complex i.e., nested properties, filters, etc. then you ā€˜mayā€™ need to also provide clarity to the LLM to reason over them.Ā Ā 

Image LoadPluginAsync

Once that is completed, the rest is your standard configuration and kernel creation as well as setting up your Agents.Ā 

Image InitializeKernelAsync

In our sample we have 1 agent that can call the plugins, and the other agents are there in a support capacity. Below you see the ChiefOfStaff agent is designated as the one in charge thus have Kernel Arguments for access to the Plugins.Ā 

Image ChiefOfStaff

For our supporting agents you will see that they take on the same set of properties except the Kernel Arguments, notice as well the Legal Secretary agent is more involved as it is not interacting with the Microsoft Graph but more for *compliance*, *safety*, and regional language.Ā 

Image RestOfAgents

Finally, we can issue a prompt such as you see here and get these amazing responses from our sample that not only provides important timely feedback to the user but can also act autonomously on behalf of the user as well.Ā 

Pay Dirt!Ā Ā 

Letā€™s do 2 prompts here in the interest of time. One will be a benign prompt, just to demonstrate how the Agents will make decisions whether to invoke a plugin or not? You will see it does not, even though it did interact with the agents in the loop. You will also notice that the Agents get invoked and finally the Legal Secretary gave a response in both English and FrenchĀ 

Image PayDirt 1of3

In the next step, lets ask a really nebulous statement, pay attention that we have*not* provided many details about the individual [Keyser], nor have we framed specificity around the ask, we just said we wanted *Emails*. Note this time the 1st agent engaged is the Email Agent, if you recall its job is to make sure the prompt is tuned for the OpenAPI spec, then we get an authentication request as this one need permissions to the Microsoft GraphĀ 

Image PayDirt 2of3

And now we can see results coming back using the same Agentic Flow in both English and FrenchĀ 

Image PayDirt 3of3

Next Steps & Resources ā€“ Build with CAPs Today!Ā 

Copilot Agent Plugins (CAPs) empower developers to seamlessly integrate AI-driven workflows into Microsoft 365, transforming natural language into powerful CRUD actions using Microsoft Graph and Semantic Kernel. Now, it’s your turn to explore and build!Ā 

This blog post VideoĀ 

šŸ¤– Go Autonomous ā€“ Discover how multi-agent systems collaborate in Semantic Kernel & CAPs: https://go.fabswill.com/capsagentsĀ 

Others you may be interested in too to get you along your journeyĀ 

šŸ”¹ Get Started Quickly ā€“ Follow our QuickStart Guide with GitHub ReadMe & Videos: https://aka.ms/m365caps-quickstartdemoĀ 

šŸ“š Learn the Basics ā€“ New to Semantic Kernel and CAPs? Start here: https://go.fabswill.com/sk101Ā 

šŸ›  Build End-to-End ā€“ Develop a full Semantic Kernel solution with CAPs: https://go.fabswill.com/capse2eĀ 

šŸ’¾ Grab the Code! ā€“ Find the plugins and source code on GitHub: https://aka.ms/m365capsĀ 

šŸš€ Join the Conversation! Have questions or want to share your builds? Connect with us on GitHub, Twitter, or LinkedIn and show us what you’re creating with CAPs!Ā 

 

0 comments