Google Drive Data Source
Prerequisites
Before connecting Google Drive documents into Agent Factory, you need to create a Service Account and link it to the Google Drive documents.
If you use a personal Gmail account, follow the steps below:
-
Set Up a Service Account for Personal Drive Access
- Create a Google Cloud Project: Go to the Google Cloud Console and create or select a project.
- Enable the Drive API:
- In your project, navigate to APIs & Services > Library,
- Search for Google Drive API and enable it.
- Create the Service Account:
- Go to IAM & Admin > Service Accounts.
- Click CREATE SERVICE ACCOUNT, give it a name, and click Create and Continue.
- Grant it a basic role like Viewer and click Continue and then Done.
- Generate a JSON Key.
- Find your newly created service account in the list and click on its email address.
- Go to the KEYS tab and click ADD KEY.
- Select Create new key and select JSON to download the key file securely.
-
Share your Drive with the Service Account
- Open your personal Google Drive.
- Find the files or folders you want the service account to access.
- Right-click and select Share, then paste the service account’s email address (e.g.,
your-service-account@your-project-id.iam.gserviceaccount.com) and grant it permissions (“Viewer” is suggested).
If you are trying to connect to a corporate Gmail account, follow the steps below:
In Admin console:
- Create a Service Account in the same workspace and domain wide delegation is enabled in IAM
- Go to Workspace Admin → Security → API Controls → Domain-wide delegation
- Add Client ID (service account’s OAuth client ID) and the corresponding scopes. See Google Drive API Scopes. Suggested scope is
https://www.googleapis.com/auth/drive.readonly. - Confirm that corporate user
user@company.comexists and has Google Drive access.
Configure a Google Drive Data Source
You can integrate Google Drive documents with Agent Factory to enable your team to search and retrieve information from your organizational content.
-
Pick Google Drive as the data source type when creating a new source.
-
Provide a clear source name + short description so it’s recognizable later.
-
Drop your Google Account email, this email must also be linked to the service account associated with the Google Drive documents you are planning to ingest.
- Choose between the two Service account access type depending on your scenario:
- Standard: Access files shared with the service account only
- Domain-Wide Delegation enabled: Can impersonate users in Google Workspace
-
Drop the Service account JSON generated in Prerequisites.
- Set the optional filters to reduce irrelevant content before indexing:
- Folder-level include/exclude
- Exclude file extensions
- URL filters
-
Set the crawl frequency (in days) to control how often the agent revisits this endpoint, and use crawl depth to control how many layers of content you want the agent to crawl.
- Provide a Proxy URL if access requires an enterprise proxy.