SharePoint and OneDrive
Keep SharePoint and OneDrive files searchable for agents
- Publisher
- By connic
- Syncs
- Documents, Images, File details
- Set up in
- Retrieval โ Sources
- Documentation
- Retrieval Docs
How the SharePoint and OneDrive source works
Teams keep policies, contracts, and handbooks in SharePoint document libraries and OneDrive. The SharePoint and OneDrive source syncs those files into connic retrieval, so agents answer from the document your team maintains instead of a copy that went stale.
Connect with an app registration in your Microsoft Entra ID tenant. After the first sync, each run asks Microsoft Graph only for files that changed, so libraries with tens of thousands of files stay current without being read again. A large first sync continues over several runs until every file is indexed, and files deleted in SharePoint or OneDrive leave the retrieval on the next sync.
What gets synced
- Documents
- Word, Excel, PowerPoint, OpenDocument, PDF, RTF, HTML, email, and text files, extracted and chunked like uploaded files. Other file types are skipped and counted in the sync run.
- Images
- PNG, JPEG, GIF, and WebP files when Include images is on.
- File details
- Site, library, folder path, author, and last modified time are kept in entry metadata, and each entry links back to the file.
Set up the SharePoint and OneDrive source
Add the source under Retrieval โ Sources in the environment your agents run in. Each environment keeps its own sources.
In the Microsoft Entra admin center, register an app under App registrations and create a client secret for it.
Under API permissions, add the Microsoft Graph application permission Sites.Selected and grant admin consent, then give the app read access to each site to sync through the site permissions endpoint in Microsoft Graph. To sync OneDrive or every site without per-site grants, use Files.Read.All instead.
Enter the directory (tenant) ID, the application (client) ID, and the client secret value.
List the SharePoint site URLs to sync, one per line, and optionally limit them to document library names. Add OneDrive users by their sign-in email.
Optionally set a modified-since date to leave out older files.
Configuration, in depth
Every available control for connecting SharePoint and OneDrive to a project.
Connection
- Directory (tenant) ID*
- The Microsoft Entra ID tenant ID or a verified domain of the tenant.
- Application (client) ID*
- The ID of the app registration, shown on its overview page.
- Client secret*
- The secret value of the app registration. The sync only reads files the app can access.
Content scope
- SharePoint sites
- Site URLs, one per line. Every document library of a site is synced unless libraries are listed below.
- Document libraries
- Only sync these libraries of the listed sites, comma-separated. Leave empty to sync all of them.
- OneDrive users
- Sign-in emails of users whose OneDrive to sync, one per line.
- Modified since
- Only sync files changed on or after this date (YYYY-MM-DD). Leave empty to sync all files.
- Include images
- Also index image files from the libraries.
Sync behavior
Where synced content lands and how often it refreshes.
- Target namespace
- Retrieval namespace the synced entries are filed under. Use dots to nest, e.g. sources.notion.
- Sync interval
- How often the source is checked for changes. Each run only reprocesses content that changed.
- When content is deleted at the source
- Files deleted in SharePoint or OneDrive, or no longer matching these settings, can be removed from the retrieval on the next sync, or kept as they were last synced.
Search it from an agent
Agents search synced content with the retrieval_query tool. A small tool that pins the namespace keeps an agent to this source.
from connic.tools import retrieval_query
async def search_sharepoint(question: str) -> dict:
return await retrieval_query(
question, namespace="sources.sharepoint"
)version: "1.0"
name: support-agent
type: llm
model: connic/gemini-3.7-flash
system_prompt: |
Answer only from what search_sharepoint returns.
tools:
- knowledge.search_sharepointSharePoint and OneDrive retrieval source FAQ
More retrieval sources
Confluence
By connicSync Confluence spaces on a configured schedule. Pages are chunked and embedded so agents can answer from the wiki instead of guessing.
Auto-syncNotion
By connicConnect a Notion workspace and keep pages and databases synced in retrieval. Agents retrieve the current version, not a stale export.
Auto-syncWebsite Crawler
By connicPoint the crawler at documentation, a help center, or a blog. Pages are converted to clean markdown and re-crawled on the configured schedule.
Auto-sync