MemorySyncMemorySync
Integrations

Google Drive

The Google Drive integration syncs documents, spreadsheets, presentations, and other files from your Google Drive into MemorySync as queryable memories. It uses the Google Drive Changes API for efficient incremental sync and exports Google Workspace files to plain text for indexing.

What gets synced

One memory is created per file. The provider handles both Google Workspace native files (Docs, Sheets, Slides) and uploaded binary files (PDFs, text files):

  • Google Docs — exported to plain text via the Drive API's export endpoint.
  • Google Sheets — exported to CSV format for text extraction.
  • Google Slides — exported to plain text to capture slide content.
  • PDFs and other files — content is downloaded directly and text is extracted where supported.

Required OAuth scopes

ScopeWhy it's needed
drive.readonlyRead file content and download/export files from Google Drive.
drive.metadata.readonlyRead file metadata (name, MIME type, owners, parent folders).

Setup guide

  1. 1Open the dashboard — navigate to Dashboard → Integrations → Google Drive.
  2. 2Click Connect — you will be redirected to Google's OAuth consent screen. MemorySync already has the Google application registered; no provider-side configuration is required on your side.
  3. 3Authorize the requested Drive scopes — review the permissions Google displays and approve. You will be redirected back to the dashboard.
  4. 4Connect from the dashboard — navigate to Dashboard → Integrations → Google Drive, click Connect, and approve the Google consent screen.

Delta sync model

Google Drive provides a Changes API that powers efficient incremental sync:

  1. 1First sync — the provider calls changes.getStartPageToken to get the initial cursor, then fetches all files using the Drive Files API.
  2. 2Subsequent syncs — the provider calls changes.list with the stored startPageToken. Only files that were created, modified, or deleted since the last sync are returned.
  3. 3Cursor update — after processing all changes, the new startPageToken is stored for the next sync cycle.

This approach minimizes API calls — a workspace with 10,000 files but only 3 changes since the last sync will make just a few API requests.

File export formats

Google Workspace files are converted to text using the Drive API's export endpoint with specific MIME type mappings:

Source formatExport MIME type
Google Docstext/plain
Google Sheetstext/csv
Google Slidestext/plain
Other files (PDF, etc.)Direct content download

Memory structure

Each file produces a memory with the following metadata:

FieldDescription
file_idGoogle Drive file ID.
nameFile name.
mime_typeMIME type of the file.
ownerEmail of the file owner.
web_view_linkDirect link to view the file in Google Drive.
parent_foldersList of parent folder names for contextual filtering.

Troubleshooting

  • Quota exceeded errors — Google Drive has per-user and per-project quotas. If you hit these, the provider backs off and retries. For large workspaces, increase your GCP project's Drive API quota.
  • Consent screen not verified — until your GCP OAuth consent screen is verified by Google, only test users can authorize the app. Add users in the GCP console under OAuth consent screen → Test users.
  • Shared Drive access — the provider supports Shared Drives. Ensure the OAuth token has access to the shared drive and that supportsAllDrives=true is set (the provider handles this automatically).
  • File size limits — very large files may timeout during export. The provider enforces a maximum content size to prevent memory issues during extraction.
  • Connection shows expired — Google access tokens expire after 1 hour. The provider automatically refreshes them. If refresh fails, reconnect from the dashboard.