# Google Drive

> Sync Google Drive files into an agent's knowledge, by OAuth or a service account.

Source: https://docs.runbear.io/agents/knowledge/google-drive

Last updated: 2026-08-26

Sync documents, spreadsheets, and files from Google Drive so your agent can answer questions grounded in your team's files.

## How it works

Runbear connects to Google Drive and indexes the files you select. The agent searches this content at query time to provide accurate answers. Runbear periodically checks for changes and updates the index automatically.

## Connection methods

Google Drive supports two connection methods. You can use either or both at the same time.

### OAuth (recommended)

Connect your Google account directly:

1. Open your agent in the Runbear dashboard and go to the **Knowledge** tab.
2. Select **Google Drive**.
3. Click **Connect with Google** — a Google authorization page opens.
4. Select the account and grant Runbear access to your Drive files.
5. Use the file picker to select which files and folders to sync.
6. Click **Save**.

### Service Account

Use a Google Cloud service account for organization-managed access:

1. In the [Google Cloud Console](https://console.cloud.google.com/), create a service account and download the JSON key file.
2. Enable the **Google Drive API** in the [API Library](https://console.cloud.google.com/apis/library).
3. Share the Drive files (or Shared Drives) you want to sync with the service account's email address.
4. In Runbear, select **Google Drive** as a knowledge source and upload the JSON key file.

![Add from Google Drive](/img/team-agent/knowledge-base/google-drive-sync-button.png)

5. Select the files to sync and click **Add Files**.

![Select files](/img/team-agent/knowledge-base/google-drive-sync-files.png)

> **Note**
>
> Shared Drives are supported — share the Shared Drive with the service account's email address, and it will have access to sync the files.

## What gets synced

- Documents, spreadsheets, and other files you select (including Shared Drive files)
- Content updates are detected and re-synced automatically
