Agent sharepoint knowledge connector#18478
Merged
Conversation
…owledge-connector
…owledge-connector
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…onnection Persist agent knowledge source connection
Cleaner oauth flow
Sharepoint sync logging
deanhannigan
approved these changes
Apr 9, 2026
Contributor
deanhannigan
left a comment
There was a problem hiding this comment.
LGTM! Really solid work @adrinr. A few minor comments, but nothing to prevent merging. 🚀
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Filter what files to upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a SharePoint knowledge connector for agents.
TODO in a different PR:
!env.MICROSOFT_CLIENT_IDor!env.MICROSOFT_CLIENT_SECRETSummary by cubic
Adds a SharePoint knowledge connector for agents using Microsoft OAuth and Microsoft Graph, plus a settings page to view SharePoint connections and where they’re used; the connector is gated behind the
AI_RAG_SHAREPOINTfeature flag.New Features
offline_access https://graph.microsoft.com/Sites.Read.All(override viaRAG_SHAREPOINT_DEFAULT_SCOPE); pre-auth supportsreturnPath, validates provider, binds OAuth state toappId, requirescontinueSetupId, uses a 10‑minute setup cache TTL, and allow-lists GraphnextLinkURLs to prevent SSRF.AgentKnowledgeSourceConnection; shown under Settings > Connections > Knowledge with de‑duplicated entries, used-by agents, and site lists.knowledgeSourcesmodel and APIs: list SharePoint site options with last-run stats, select sites (returns site info), trigger per-site sync, and disconnect (removes files from disconnected sites). Endpoints moved underaiAgents.knowledgeSourceSyncQueue(configurable interval); jobs rehydrated on startup and reconciled on deploy with summary logging; visible in BullBoard.AgentKnowledgeSourceSyncState(last run, counts, run status, including unsupported). UI hides 0/0 before first run and formats missing timestamps as —. Knowledge base files includeexternalSourceId.__clickable.ActionButtonsupports custom icons and loading.Migration
AI_RAG_SHAREPOINT(defaults off).MICROSOFT_CLIENT_ID,MICROSOFT_CLIENT_SECRET, and optionalMICROSOFT_TENANT_ID.Sites.Read.Allandoffline_access.RAG_SHAREPOINT_DEFAULT_SCOPEandSHAREPOINT_SYNC_INTERVAL_MS(defaults to 1 day).knowledgeSourceSyncQueue.Written for commit e2eb46a. Summary will update on new commits.