Custom Engine Agents and the M365 Agents SDK
Custom engine agents are the pro-code option in Microsoft 365 Copilot Extensibility. They let developers bring their own LLM, their own orchestration (Copilot Studio, LangChain, or anything else), and their own knowledge sources, then surface the result in M365 Copilot, Teams, Slack, Facebook, or any other channel.
The M365 Agents SDK is the wrapper that makes this work across surfaces. The C# library is generally available; JavaScript and Python are shipping soon. One agent codebase, deployed everywhere.
“Agents SDK is stack agnostic.” — Sai Deepthi Kovvuru
How the Retrieval API Works
The Retrieval API takes a natural-language query plus an optional Kusto filter, queries SharePoint documents (and soon emails, Teams messages, and external connectors), and returns ranked text chunks, resource metadata, and sensitivity labels. If a document is restricted from vendors, the API reports that, so your app can decide how to surface it.
Kovvuru ran the Retrieval API demo in Graph Explorer (04:59) live, pulling Contoso Build sessions from a SharePoint folder with author metadata. Two pricing changes are coming: no M365 Copilot license required, and billing switches to metered pay-per-use.
“And sensitivity labels is how enterprises do this at scale.” — Sai Deepthi Kovvuru
Wiring the Retrieval API into a Semantic Kernel Agent
The Copilot Agent Plugins (CAP) framework reads an OpenAPI spec for any Microsoft Graph API endpoint and registers it as a callable tool inside a Semantic Kernel agent. Kovvuru’s demo loaded three plugins from a directory: contacts (get-contacts endpoint), messages (send email), and retrieval. The agent picked the right plugin at query time without any explicit routing code.
In the Semantic Kernel agent demo with OpenAI LLM (11:45), the agent prompted for enterprise authentication, then returned the same Contoso Build session list, including time slots and speaker emails, that the Graph Explorer query produced earlier.
Deploying the Agent to M365 Copilot
Wrapping the Semantic Kernel agent in the Agents SDK adds message-activity handling: a welcome message fires when the chat opens, and the agent answers queries. Test in the Azure Bot Service web chat first, then upload the app package to admin.microsoft.com under Settings, Integrated Apps. The agent then appears in the M365 Copilot right rail, exactly like a declarative agent.
Kovvuru asked it to email a speaker. The agent hit the live email send via Send Mail plugin (19:38) and Outlook confirmed the message landed in sent mail, signed by BuildGenie.bot.
Notable Quotes
Agents SDK is stack agnostic. Sai Deepthi Kovvuru · ▶ 2:48
And sensitivity labels is how enterprises do this at scale. Sai Deepthi Kovvuru · ▶ 7:47
The M365 Copilot Retrieval API is your one-stop shop Sai Deepthi Kovvuru · ▶ 4:01
Key Takeaways
- The Copilot Retrieval API queries SharePoint and M365 data with natural language and returns sensitivity-labeled chunks.
- Switching to metered pricing removes the M365 Copilot license requirement to call the Retrieval API.
- The Agents SDK wraps any custom LLM or orchestration framework and deploys it to Teams, Copilot, Slack, or Facebook.