AI-assisted analysis & upload routing you can extend Confirm upload; apply metadata with PnPjs Planner chat to propose & update fields Works in SharePoint & Teams (supported hosts) Deploy as a standard SPFx package Extensible: retarget AI to Copilot for Microsoft 365 in code so traffic stays in M365
Get the package Open source · GitHubThis is a generic web agent pattern for SharePoint: an SPFx web part with an AI assistant for analysis, upload, and follow-up. The included starter template wires in common office formats (for example .docx and .pdf) as a baseline—you can extend or replace extraction, prompts, and steps to match your file types, policies, and line-of-business needs. Content is sent to Azure OpenAI with your document guide (where to route files, types, and tagging hints). You get structured suggestions: narrative text, type, suggested upload URL (SharePoint library path), tags, and a short reason—then confirm with Upload. After a successful upload, a planner agent (strict JSON) powers chat: it can suggest new field values, show Field / Current / Proposed, and Update on the last item. Works on modern SharePoint and in Microsoft Teams when the host supports the web part. Developers can change the implementation to call Copilot for Microsoft 365 (or other Microsoft 365–native AI surfaces your tenant provides) so AI requests are handled inside your organization’s Microsoft 365 boundary instead of sending prompts to a separate Azure OpenAI endpoint you operate outside the SharePoint experience.
Download now»» The starter flow drops a file, extracts text, and calls
Azure OpenAI with your document guide and a structured prompt. Out of
the box, that path includes example extractors for common office
types (such as .docx and .pdf)—swap or add parsers,
different AI steps, or inputs for a fully custom agent aligned to your
org.
»» The model returns a reply plus fields such as type,
suggested upload URL (server-relative library path), tags, and
reason.
»» The UI stages a pending upload and shows
an Upload action so you confirm before any file is written to
SharePoint.
»» On confirm, the Document service uses
PnPjs to upload the file to the suggested library and applies
metadata where it maps to editable list columns (with optional
follow-up for field mapping).
»» The upload confirmation path is a fast path:
it runs the tool directly without an extra LLM call when you use the
Upload button or type upload.
»» After upload, a planner-style agent uses a strict
JSON contract: responseText, optional userOption (e.g.
"update"), and proposedMetadata when proposing field
changes.
»» You can ask for more tags, clarifications, or field changes;
when the planner proposes an update, the chat shows an Update control
(or you can type update) to apply values to the last uploaded
item—also a fast path with no extra LLM round trip on
commit.
»» Think of the package as a starting point for a
SharePoint-native agent: the same UI and agent plumbing can be extended beyond the
default document-drop experience for organizational or industry-specific
workflows. UI: React + TypeScript, SPFx (see your solution
version in package.json), SharePoint I/O via @pnp/sp.
»» Admins set AI API endpoint, API
key, and the long-form document guide in web part
properties (optional welcome text and out-of-scope fallback are supported).
»» Keys in browser properties and network calls can be visible to
page editors; for production, prefer a server-side proxy (e.g. Azure
Function or API Management) with Entra ID and keys in Key Vault /
managed identity.
»» The sample routes AI through configurable endpoints; in your
fork you can retarget the same flows to Copilot for Microsoft 365
and related Microsoft Graph–backed entry points (subject to license and
product availability) so users’ AI interactions need not leave the
SharePoint and broader Microsoft 365 trust
surface you already govern.
»» Support for deployment and usage is available on request.
While support should be accessible when needed, the tools themselves must remain intuitive and self-explanatory.
Contact us