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
| Scope | Why it's needed |
|---|---|
drive.readonly | Read file content and download/export files from Google Drive. |
drive.metadata.readonly | Read file metadata (name, MIME type, owners, parent folders). |
Setup guide
- 1Open the dashboard — navigate to Dashboard → Integrations → Google Drive.
- 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.
- 3Authorize the requested Drive scopes — review the permissions Google displays and approve. You will be redirected back to the dashboard.
- 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:
- 1First sync — the provider calls
changes.getStartPageTokento get the initial cursor, then fetches all files using the Drive Files API. - 2Subsequent syncs — the provider calls
changes.listwith the storedstartPageToken. Only files that were created, modified, or deleted since the last sync are returned. - 3Cursor update — after processing all changes, the new
startPageTokenis 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 format | Export MIME type |
|---|---|
| Google Docs | text/plain |
| Google Sheets | text/csv |
| Google Slides | text/plain |
| Other files (PDF, etc.) | Direct content download |
Memory structure
Each file produces a memory with the following metadata:
| Field | Description |
|---|---|
file_id | Google Drive file ID. |
name | File name. |
mime_type | MIME type of the file. |
owner | Email of the file owner. |
web_view_link | Direct link to view the file in Google Drive. |
parent_folders | List 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=trueis 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.