SharePoint Embedded

Grounding AI in SharePoint Embedded Content: The Retrieval API, Foundry Knowledge Sources and Moving On from the Agent SDK

Grounding AI in SharePoint Embedded Content: The Retrieval API, Foundry Knowledge Sources and Moving On from the Agent SDK

If your team built a document assistant on the SharePoint Embedded agent SDK, or had one on the roadmap, the ground has moved. Microsoft’s What’s New page for SharePoint Embedded records the change in one line: “Microsoft has deprecated the SharePoint Embedded agent SDK in favor of the new SharePoint Embedded knowledge source in Microsoft Foundry.”

Microsoft has not published a retirement date for the SDK. But a deprecated component is not something to build new features on, and the replacements are now documented. This article is a current-state guide to the specific APIs for grounding AI in SharePoint Embedded content: the Copilot Retrieval API with its SharePoint Embedded data source, the Foundry knowledge source that builds on it, and the governance switch that decides whether any of it can see your documents.

It complements our earlier article, Intelligent Documents: Adding Microsoft 365 Copilot and RAG to SharePoint Embedded, which compared grounding Microsoft 365 Copilot with building your own retrieval pipeline. That article did not cover a third option, which Microsoft documented for SharePoint Embedded in July 2026: managed retrieval that you call from your own application. All facts about Microsoft’s platform come from Microsoft Learn and the Microsoft 365 Developer Blog, checked on 9 October 2026 and listed at the end. The architecture recommendations are ours.

What Changed, and When

When Change Status
March 2026 SharePoint Embedded agent SDK deprecated in favour of the Foundry knowledge source Deprecated; no retirement date published
July 2026 sharePointEmbedded data source added to the Copilot Retrieval API (itself generally available since November 2025) API GA; data source in preview
July 2026 Users who query no longer each need a Microsoft 365 Copilot licence One licensed user still needed per tenant

The SharePoint Embedded documentation describes the replacement for the SDK: “The earlier SharePoint Embedded agent SDK (the React ChatEmbedded control) was deprecated in March 2026 and replaced by Microsoft Foundry Agent Service with a SharePoint knowledge source (preview) configured for SharePoint Embedded.”

The July entry is the one that changes the economics: “The Copilot Retrieval API is generally available and now offers a sharePointEmbedded data source in preview, with pay-as-you-go billing on the Copilot Studio message meter. Users who query the API no longer each need a Microsoft 365 Copilot license, but one licensed user still initializes the semantic index.”

The Copilot Retrieval API with SharePoint Embedded

The Retrieval API returns relevant passages from content that Microsoft has already indexed. It does not generate answers. You pass the passages to the model and orchestration of your choice. For a SharePoint Embedded application, this means you can build an in-app assistant without running your own extraction, chunking, embedding and vector index.

The request

Microsoft’s SharePoint Embedded documentation describes the call: “Call POST /copilot/retrieval with a delegated token. Set dataSource to sharePointEmbedded and pass your container type ID in dataSourceConfiguration.” Its example:

POST https://graph.microsoft.com/v1.0/copilot/retrieval
Content-Type: application/json

{
  "queryString": "What are the terms of the Contoso agreement?",
  "dataSource": "sharePointEmbedded",
  "dataSourceConfiguration": {
    "sharePointEmbedded": {
      "containerTypeId": "{containerTypeId}"
    }
  }
}

A second example in the same documentation narrows the results with a filterExpression on a custom column’s managed property, requests extra fields with resourceMetadata, and sets maximumNumberOfResults.

A note on the documentation. The general Retrieval API reference lists only sharePoint, oneDriveBusiness and externalItem as dataSource values, in both its v1.0 and beta views. The SharePoint Embedded configuration appears only in the beta views of the dataSourceConfiguration and sharePointEmbeddedConfiguration resources, while the SharePoint Embedded page shows the v1.0 endpoint. That is consistent with a preview data source on a generally available API, but you should check each of these pages when you build. It is also one reason for the abstraction we recommend below.

Permissions and scope

  • Delegated only. “The request needs the FileStorageContainer.Selected delegated permission, and the service trims results to content the signed-in user can access.” The general reference lists application permissions as “Not supported”.
  • Container type scope. “Retrieval covers every container of the container type that the signed-in user can access.” The scoping unit is the container type, not an individual container. Within it, permissions do the trimming.

Limits worth designing around

From the Retrieval API overview and reference:

  • queryString has a “limit of 1,500 characters”.
  • maximumNumberOfResults “Must be between 1 and 25”.
  • “Up to 200 requests per user per hour are supported.”
  • “You must retrieve from one data source at a time”.
  • Batching “supports up to 20 requests per batch.”
  • File size limits apply: 512 MB for .docx, .pptx and .pdf files, and 150 MB for other types.
  • The API is listed as available in the global service, but not in US Government L4/L5 or the cloud operated by 21Vianet.

One limit deserves special attention. Microsoft states: “If the filterExpression request parameter has incorrect KQL syntax, the query successfully executes with no scoping.” A malformed filter does not fail. It silently returns results from across everything the user can access in that container type. Our recommendation: never treat filterExpression as a security control (permissions are the security control), validate filter syntax before sending it, and test for unexpectedly broad results.

Prerequisites and Billing

Microsoft lists the prerequisites for retrieval over SharePoint Embedded content:

  • “Pay-as-you-go billing configured for the container type.”
  • “At least one user in the tenant with a Microsoft 365 Copilot license, so the semantic index initializes.”

Individual users no longer need Copilot licences: “each user who queries the Retrieval API doesn’t need an individual Microsoft 365 Copilot license.”

On billing: “Retrieval API requests that use the sharePointEmbedded data source bill on the Copilot Studio message meter. … Standard billing charges the owning tenant’s Azure subscription, and pass-through billing charges the consuming tenant’s subscription.” Microsoft’s billing meters page is explicit that “The sharePointEmbedded data source is in preview in its entirety, including its pay-as-you-go billing, although the Retrieval API itself is generally available.”

Microsoft states the licence prerequisite as one licensed user “in the tenant”. Our reading is that, for an ISV, this means each consuming tenant where you want retrieval to work, so it belongs on your customer onboarding checklist, alongside the billing model you choose. If a customer’s tenant has no Copilot-licensed user, we would expect the semantic index not to initialise there, and retrieval not to work.

Discoverability: Nothing Is Exposed Until Someone Decides

This is the governance control that matters most. Microsoft states: “Nothing is auto-exposed. SharePoint Embedded content isn’t available to Copilot until discoverability is enabled on the container type.” It adds: “Tenant governance controls this setting, so an app can’t expose content by changing its own configuration.”

The setting is isDiscoverabilityEnabled in the container type settings. The Microsoft Graph documentation describes it as indicating “whether items from containers are surfaced in experiences such as My Activity or Microsoft 365”, and lists it among the settings a consuming tenant can override. SharePoint Embedded Administrators can also set it with Set-SPOContainerTypeConfiguration -DiscoverabilityDisabled $false. Microsoft’s description of the cmdlet shows that discoverability reaches beyond Copilot: content “will be discoverable in the Microsoft 365 experience, including on office.com, onedrive.com, recommended files, and other intelligent discovery experiences.” Changes to container type settings “can take up to 24 hours to replicate to all consuming tenants.”

This is our analysis of what it means in practice.

  • Discoverability is a product decision as well as an AI decision. Enabling it so that your assistant can retrieve content also makes that content appear in Microsoft 365 discovery experiences for users who have access. For some products, users finding their documents in Microsoft 365 is welcome. For others, where your application is meant to be the only interface, it is not. Decide deliberately.
  • Design container types with this in mind. Because the switch is per container type, separating content that should be discoverable from content that should not becomes an architectural choice made at the start, not a toggle added later. Our multi-tenant architecture patterns article covers container type design more broadly.
  • Your customers’ administrators have the final say. Plan onboarding documentation that explains what enabling discoverability does, so a customer’s IT team can make an informed decision.

Foundry Agent Service with a SharePoint Knowledge Source

The stated replacement for the agent SDK is Microsoft Foundry Agent Service with a SharePoint knowledge source configured for SharePoint Embedded. Microsoft is clear that it uses the same retrieval underneath: “For SharePoint Embedded container types, the knowledge source grounds answers through the generally available Microsoft 365 Copilot Retrieval API. Foundry runs the retrieval calls as part of the agent, so the same prerequisites, indexing behavior, and billing apply.”

The essentials:

  • Status: “SharePoint knowledge sources for SharePoint Embedded are in preview.”
  • Configuration: “Configure the Foundry SharePoint knowledge source with remoteSharePointParameters.containerTypeId set to your SharePoint Embedded container type ID.”
  • Access grant in each consuming tenant: “The container type’s owning application must call the registration API in the consuming tenant.” It grants the Foundry application delegated readContent permission on the container type registration.
  • Identity: Retrieval runs on behalf of the end user. The Azure AI Search documentation for SharePoint knowledge sources states that “the retrieval engine queries SharePoint on behalf of the user”, with the user’s token passed in the x-ms-query-source-authorization header, and that “SharePoint permissions and Microsoft Purview sensitivity labels are honored.”
  • Licensing: “Users who query the agent don’t each need a Microsoft 365 Copilot license.”

Choosing a Route

This comparison is ours.

Retrieval API from your own code Foundry agent with knowledge source Your own RAG pipeline
Who runs retrieval Microsoft (semantic index) Microsoft, called by Foundry You
Who runs orchestration and generation You Foundry Agent Service You
Status of the SharePoint Embedded path GA API; preview data source Preview Depends on your components
Control over chunking and ranking Limited Limited Full
Operational burden Low Low to medium High
Best fit An in-app assistant with your own prompts and user interface Agent scenarios where Foundry’s orchestration and tooling are wanted Specialised retrieval, unusual content, or no dependency on preview services

Building Now Without Betting on Preview

Our recommended architecture for teams moving off the agent SDK, or starting fresh, has four parts.

1. Put a retrieval interface in front of everything. Define one internal contract, for example retrieve(query, scope, user) → passages with source, metadata and permissions context. Implement it first with the Retrieval API. Because the SharePoint Embedded data source is in preview, and the documentation still differs between pages, you want switching to be a configuration change, not a rewrite. Switching might mean moving to the Foundry knowledge source, to an updated API version or to your own index.

2. Keep the user interface in your application. The deprecated SDK supplied a React chat control. Our view is that the replacement should be your own component, talking to your own back end, so that the user experience is not tied to the next change in Microsoft’s SDK strategy.

3. Feature-flag the preview path per tenant. Enable AI features for customers who have accepted that the capability is in preview, have met the prerequisites and have enabled discoverability. Report clearly in the product when a tenant is not ready.

4. Measure retrieval quality. Build an evaluation set of real questions with known answers and source documents, and run it whenever you change configuration or Microsoft changes the service. Our earlier article covers retrieval evaluation in more depth.

For Developers: The SharePoint Embedded MCP Server

Microsoft has also released a tool for the build side rather than the runtime side. “The SharePoint Embedded MCP server is an open-source Model Context Protocol server that lets MCP-compatible AI clients set up and manage SharePoint Embedded applications through natural language.” It is published as @microsoft/spe-mcp and is “an open-source developer tool released in preview”.

Its prerequisites include tenant administrator rights (Global Administrator or Application Administrator). Our advice is to use it in development tenants, where a coding agent with administrative reach can do no harm to production. It is a productivity tool for setting up container types and test data, not something to put in a customer’s tenant.

How McKenna Consultants Can Help

McKenna Consultants designs and builds SharePoint Embedded applications and AI features over business documents through our AI First practice. We can assess an application built on the deprecated agent SDK and plan its replacement. We can also design a retrieval layer that will survive preview changes, set up container types and discoverability with governance in mind, and build the evaluation that tells you whether the assistant is any good.

Contact us to discuss grounding AI in your SharePoint Embedded content.

Sources

All sources checked on 9 October 2026.

Have a question about this topic?

Our team would be happy to discuss this further with you.