Skip to main content
Context7 can sync Google Docs and Google Slides from Google Drive and serve them like any other library. Google Drive stays the source of truth: a daily sync picks up edits, and files that are removed or no longer shared leave the results. An admin connects a Google service account once under Settings → Integrations. Then an admin chooses which folders, Shared Drives, Docs and presentations to sync from Add → Google Drive. Only the selected items, and the Docs and presentations under selected folders, are indexed.
Google Docs and Google Slides are supported. Spreadsheets, PDFs and other file types in a selected folder are skipped. The picker marks them as not supported.

Set up Google Cloud

Context7 reads Drive with a service account and one read-only scope: The Set up Google Cloud panel in the Google Drive card (Settings → Integrations) shows these steps. Enter your project ID there, and the panel fills it into the commands.
1

Create the service account

Run these commands in Cloud Shell or with the gcloud CLI. Replace PROJECT_ID with your project ID. The first command enables the Google Drive API and the Google Slides API. The service account needs no IAM roles in the project.
2

Create a key, or use workload identity

To use a key, download one:
Organizations created on or after May 3, 2024 block service account keys by default. If Google refuses to create the key, ask an organization admin to allow keys for this project, or use Server credentials without a key (see Connect Google Drive).
3

Share the content

In Google Drive, share each folder you want to sync with the service account’s email address, with Viewer access. For a Shared Drive, add the service account as a member with the Viewer role. If Drive does not allow sharing outside your organization, ask a Workspace admin to allow it for the service account, or use domain-wide delegation.

Domain-wide delegation (optional)

If sharing with the service account is not practical, the service account can act as one Workspace user and see what that user sees.
  1. Copy the service account’s client ID. It is client_id in the JSON key, and the Set up Google Cloud panel shows it after you paste the key.
  2. In the Google Workspace Admin console, open Security → Access and data control → API controls → Manage Domain Wide Delegation.
  3. Add a new client with that ID and the scope https://www.googleapis.com/auth/drive.readonly.
  4. In Context7, enter the user’s email address in Act as user.
Without delegation, the service account can read only what is explicitly shared with it. This keeps the approved content small and visible in Drive’s sharing settings, so prefer it when you can.

Connect Google Drive

Open Settings → Integrations and choose how Context7 authenticates in the Google Drive card.
Paste the JSON key, and optionally the user for domain-wide delegation. Click Test connection, then click Connect.Context7 checks the key with Google before it saves it, stores it encrypted, and never returns it from any API. The settings page shows only the service account’s email and the last characters of the key ID. To rotate the key, paste the new key and save.
Test connection checks the credentials with Google and lists the first folders, files and Shared Drives that the identity can see. If the list is empty, share a folder with the service account, then test again. After you connect, the card shows the service account’s email with a copy button.

Add a Google Drive library

Go to Add and choose Google Drive.
  • Shared with the connector lists the folders, Docs and presentations shared with the service account. Click a folder to open it.
  • Shared Drives lists the Shared Drives the service account is a member of.
Select folders, Shared Drives or single files, enter a title, and click Start Sync. The selection defines the library: to sync a different set of folders, add another library. Each Doc is indexed under its Google URL, for example https://docs.google.com/document/d/<id>/edit. That link is the Source: of every result, so an agent can point people to the original document.

Google Slides

Each slide of a presentation is indexed as its own page, with a link that opens that slide: https://docs.google.com/presentation/d/<id>/edit#slide=id.<slide id>. The slide’s title becomes its heading, and its text, lists, links, tables and speaker notes follow. Hidden (skipped) slides are not indexed. Images, charts and diagrams are not indexed, and neither is text inside images. When a presentation changes, Context7 reads the whole presentation again:
  • A slide that did not change reuses its last extraction.
  • A deleted slide leaves the results.
  • If one slide fails to index, its last indexed version stays.
  • If the presentation cannot be read, all its slides keep their last indexed version.
  • A presentation with no visible slides counts as empty and leaves the results.

How syncing works

Every sync lists the selected folders again and compares each file with the last sync: A sync builds the new index next to the live one and swaps it in only when it finishes, so queries always see a complete library.

Failures keep valid content

  • One file fails (for example it is larger than Drive’s 10 MB export limit, or the LLM times out while extracting it): the last indexed version of that file stays in the results. The library page shows a warning, its logs list the file and the reason, the Libraries list in Settings shows the failed files, and the next sync tries it again.
  • The whole sync fails (for example Google refuses access because the Drive API is disabled, or Google cannot be reached): all live content stays as it was, and the error is shown in the library’s logs.
Sharing is the approval. When a selected folder or Shared Drive is no longer shared with the service account, the next sync removes its files from the results. Check sharing changes before the daily sync if you want to keep the content.
Context7 retries Google API quota errors with exponential backoff and limits how many requests it sends at once.

Scheduled sync

Google Drive libraries sync every day at 03:00 server time by default. Under Sync schedule in the Google Drive card (Settings → Integrations), you can:
  • turn the scheduled sync off,
  • change the schedule: pick a preset such as Every 6 hours, or enter a cron expression such as 0 */6 * * *,
  • click Sync all now to queue every Google Drive library at once.
When a sync fails, scheduled or manual, Context7 retries that library after 15 minutes, 1 hour and 6 hours. Each delay counts from the previous attempt. To sync one library by hand, click Refresh on its page, or Sync now next to it in the Libraries list. To read and re-index every file instead of skipping unchanged ones, select Re-index all files in the Refresh dialog, or in the library’s menu in the Libraries list.

Monitor libraries

The Libraries list in the Google Drive card (Settings → Integrations) shows every Google Drive library with its selection, its last sync, and a status: Expanding a row shows the most common failure reasons and up to 50 failed files, each linked to Drive. Download CSV exports every failed file. Problem libraries sort to the top, and Needs attention filters the list to them.

Authority labels

Authority labels can match Google Drive content by path or by URL:
  • A path pattern matches the Drive folder path inside the selection, for example /QA/Standards/ for every file in the Standards folder of a selected QA folder. For a Shared Drive, the path starts with the Shared Drive’s name.
  • A URL pattern matches the Doc’s Google URL, for example https://docs.google.com/document/d/<id>.
For a presentation:
  • A URL prefix https://docs.google.com/presentation/d/<id> matches every slide of that presentation.
  • A path rule matches the presentation’s folder path, for example /QA/Standards/Release review, and applies to all its slides.

Network access

The server talks only to Google: Set GOOGLE_DRIVE_API_URL and GOOGLE_SLIDES_API_URL to send Drive and Slides API calls through another endpoint, such as a Private Google Access address or a proxy. Each value must include the API path, for example https://www.googleapis.com/drive/v3 and https://slides.googleapis.com/v1.

Troubleshooting