MemorySync
Integrations

Google Drive integration

Bring selected or accessible supported Drive files into MemorySync for document retrieval. Retrieve supported document and PDF content, together with supported file metadata, from the content available to the connection.

Pick the right file set

Connected account
Selected or accessible files
Supported content
Outside this path: files the connected account cannot access
File boundary
Only selected or accessible supported files available through the connected account can be imported.

Supported document and PDF content

Supported files

Selected or accessible supported files available to the connection.

Documents

Supported document content extracted for retrieval.

PDFs and metadata

Supported PDF content and supported file metadata.

Connection planning checklist

  • A Google account with access to the intended files.
  • Permission to connect that account under your organization’s policy.
  • A MemorySync project for the imported document knowledge.
Local planning guide
Plan your Google Drive import

Check items for your own planning. Nothing here changes a live connection.

0 of 4 planning steps complete

File synchronization lifecycle

  1. 1
    Connect an account

    Use an account that can access the intended files.

  2. 2
    Select or confirm access

    Keep the available file set aligned with the use case.

  3. 3
    Extract and synchronize

    Process supported documents, PDFs, and metadata through synchronization.

  4. 4
    Retrieve

    Query the imported document knowledge.

Extractable and non-extractable content

Extractable

Supported documents and PDFs with extractable text can become retrievable content.

Not extractable

A file without supported extractable text cannot provide searchable document text.

Verify document retrieval

Query a distinctive phrase from a known supported document or PDF that the connected account can open. Confirm the result is from the intended file set.

Troubleshooting and related sources

Why is a file missing?

Confirm the connected account can open it and that the file is selected or otherwise accessible to the connection.

Why did selecting a folder import little or nothing?

Google’s file-level permission model grants access per selected item, so picking a folder does not automatically grant its contents. Select the individual files you want imported.

Why does a document or PDF have no searchable text?

Verify that the file is supported and contains text that can be extracted.

What should I do after access changes?

Review the content available to the connected account, then verify synchronization with a known supported file.

Operations on this page

OperationMethod and pathPythonNode.js
Picker configurationGET …/{connection_id}/gdrive/picker-configconnections.gdrive.picker_configconnections.gdrive.pickerConfig
List selected resourcesGET …/{connection_id}/gdrive/resourcesconnections.gdrive.resourcesconnections.gdrive.resources
Select resourcesPOST …/{connection_id}/gdrive/resourcesconnections.gdrive.add_resourcesconnections.gdrive.addResources
Deselect a resourceDELETE …/{connection_id}/gdrive/resources/{resource_id}connections.gdrive.remove_resourceconnections.gdrive.removeResource

Authentication and scope

RequirementContract
CredentialAn API key sent as X-API-Key. Connector operations are not end-user scoped.
Read scopeintegrations:read for every GET.
Write scopeintegrations:write for every POST, PUT, PATCH and DELETE.
TenantDerived from the authenticated key. There is no tenant parameter to pass or to get wrong.
X-End-User-IDNot used. A connection belongs to the organization, not to one end user.

Before you start

You need an active Google Drive connection from the OAuth flow on Providers & OAuth. Drive cannot be connected with an API key.

1. Get the picker configuration

Returns what the browser-side Google Picker needs: the app id, the developer key, and the OAuth token scoped to this connection. Fetching it from your server and handing it to the picker means your page never holds a long-lived Google credential.

import os
from memorysync import MemorySyncClient
client = MemorySyncClient(
api_key=os.environ["MEMORYSYNC_API_KEY"],
base_url="https://api.memorysync.io",
)
config = client.connections.gdrive.picker_config("conn_8f21a4")
# Serialise this to the browser that renders the picker.
print(config["app_id"], config["client_id"], config["scope"])
GET/api/v2/integrations/connections/{connection_id}/gdrive/picker-config
200 OK
FieldPassed to the Picker as
app_idThe Google Cloud project number.
client_idThe OAuth client id.
api_keyThe browser API key. This is the Picker's developerKey.
oauth_tokenThe access token scoped to this connection.
scopeThe scope the token carries, so the picker can request a matching view.

2. Select files and folders

Selecting a folder selects its contents, and MemorySync keeps following that folder — files added to it later are picked up by later syncs. Selecting a file selects only that file.

import os
from memorysync import MemorySyncClient
client = MemorySyncClient(
api_key=os.environ["MEMORYSYNC_API_KEY"],
base_url="https://api.memorysync.io",
)
client.connections.gdrive.add_resources(
"conn_8f21a4",
resources=[
{"id": "1AbCdEfGhIjKlMnOpQrStUvWxYz", "type": "folder", "name": "Handbook"},
{"id": "1ZyXwVuTsRqPoNmLkJiHgFeDcBa", "type": "file", "name": "Pricing.pdf"},
],
)
Select files and folders
POST/api/v2/integrations/connections/{connection_id}/gdrive/resources
200 OK

3. Read back the selection

Like the Slack channel list, this returns a bare JSON array rather than an object with a resources key.

import os
from memorysync import MemorySyncClient
client = MemorySyncClient(
api_key=os.environ["MEMORYSYNC_API_KEY"],
base_url="https://api.memorysync.io",
)
for resource in client.connections.gdrive.resources("conn_8f21a4"):
print(resource["resource_id"], resource["resource_type"], resource["name"], resource["permission_state"])
Read the current selection
GET/api/v2/integrations/connections/{connection_id}/gdrive/resources
200 OK
FieldMeaning
resource_idDrive's own file or folder id.
resource_typeWhether it is a file or a folder.
name, mime_typeDrive metadata. Both nullable.
web_view_link, icon_urlLinks for showing the item back to a user.
permission_stateWhether the connection can still read it. This is where a revoked share shows up.
is_active, last_synced_atWhether future syncs read it, and when it was last read.

4. Sync and check the formats

Trigger a sync on Sync & Jobs. Google-native documents are exported before parsing; binary formats are parsed as they are. A format with no parser produces an object with no memories rather than an error, which is why an empty result is worth checking rather than assuming a failure.

Drive contentHow it is read
Google DocsExported to text, then extracted.
Google SheetsExported to tabular data; see structured_stats on the object.
Google SlidesExported to text per slide.
PDF, DOCX, PPTX, XLSXParsed directly by the same parsers as file upload.
Images, audio, videoRead only where a transcriber is configured; otherwise no memories.
Shortcuts and shared linksFollowed only if the connection's token can read the target.

5. Deselect a resource

Stops future syncs reading it. Existing objects and memories are kept.

import os
from memorysync import MemorySyncClient
client = MemorySyncClient(
api_key=os.environ["MEMORYSYNC_API_KEY"],
base_url="https://api.memorysync.io",
)
client.connections.gdrive.remove_resource("conn_8f21a4", "1ZyXwVuTsRqPoNmLkJiHgFeDcBa")
DELETE/api/v2/integrations/connections/{connection_id}/gdrive/resources/{resource_id}
204 No Content

Errors and next action

StatusMeaningNext action
401Missing, malformed or inactive API key.Check server configuration without printing the key.
403The key lacks integrations:read or integrations:write.Grant the scope on the key, or use a key that has it.
404The connection, object or job is not visible to this tenant.Confirm the identifier belongs to this organization.
409The connection is in a state that forbids the operation.Read the connection status first and act on it.
429Rate limited, either by MemorySync or by the upstream provider.Back off; do not tighten a polling loop in response.
5xxService failure.Treat a write outcome as uncertain and reconcile by reading the connection back.
Was this page helpful?