> For the complete documentation index, see [llms.txt](https://docs.harmony.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.harmony.io/integrations/knowledge-base/google-drive.md).

# Google Drive

Bring Google Docs, Sheets, Slides and files from shared drives into the Harmony Knowledge Base, with Drive sharing respected at query time

Google Drive is where many organizations keep their runbooks, policies, how-to documents and team spreadsheets. Connecting Google Drive to Harmony lets your AI agents answer from the content of your shared drives, and keeps that content in sync on a recurring schedule.

Harmony reads Drive through a Google account you choose. It sees exactly the shared drives that account is a member of, and it respects who each file is shared with when answering employees.

### What the Google Drive integration enables

| Capability                 | Description                                                                          |
| -------------------------- | ------------------------------------------------------------------------------------ |
| Knowledge Base             | Power AI responses with Google Docs, Sheets, Slides and uploaded files               |
| Selective drive control    | Choose exactly which shared drives to include. Only selected drives are synced       |
| Permission-aware retrieval | Drive sharing is captured per file and enforced when an employee asks a question     |
| Automatic syncing          | Selected drives are collected and kept in sync automatically on a recurring schedule |

### Prerequisites

* **A Google Workspace account for the connection**: the account must be a member of every shared drive you want to sync. A dedicated service user added to those drives as a **Viewer** is the simplest setup. Membership is required because Google only lists the shared drives an account belongs to
* **Shared drives**: content in shared drives is supported. Files that live only in a personal My Drive are not synced
* **Harmony account**: an active Harmony workspace with admin access

### Connect Google Drive to Harmony

#### Step 1: Start the connection

1. Log in to your Harmony dashboard
2. Go to **Settings** > **Integrations**
3. Find **Google Drive** under **Knowledge Base** and click **Connect**

#### Step 2: Authorize in Google

1. Sign in with the Google account you prepared for the connection
2. Review the requested access:
   * See and download all your Google Drive files (read-only)
   * See your primary Google Account email address
3. Click **Allow**

Harmony never modifies, shares or deletes anything in Drive. The connection is read-only.

#### Step 3: Select shared drives

After authorizing, a drive picker lists the shared drives the connected account is a member of.

* Select one or more shared drives to sync. At least one is required
* If the list is empty, the connected account is not a member of any shared drive yet. Add it to the drives you want to sync in Google Drive, then click the refresh button next to the picker

You can return to the integration at any time to add or remove drives.

#### Step 4: Choose what to index

Selected drives appear in your **Knowledge Base** with every folder and file listed. Nothing is indexed until you select the documents you want your agents to use. See [Managing your Knowledge Base](https://github.com/harmonyso/public-docs/tree/main/guides/managing-knowledge-base/managing-knowledge-base.md) for the selection workflow.

### What Harmony syncs

**From each selected shared drive:**

* Google Docs, Google Sheets and Google Slides
* Uploaded files: PDF, Word (.doc, .docx), Excel (.xls, .xlsx), PowerPoint (.pptx), CSV, plain text, Markdown and HTML
* The folder structure of the drive, so documents keep their place in the catalog
* Each file's link, last modification time and last editor
* Who each file is shared with, for permission-aware retrieval

Not synced:

* Google Forms, Google Sites, shortcuts and other Google-native types that cannot be exported as a document
* Videos, images, archives and other binary formats that are not documents
* Files larger than 50 MB. They appear in the catalog but their content is not indexed
* Trashed files

### Permission-aware Knowledge Base retrieval

When Harmony syncs a shared drive, it records who each file is shared with, including sharing inherited from the drive and its folders, and uses that information to filter answers at query time. An employee only gets answers from documents they could open in Drive.

Drive sharing maps to Harmony as follows:

| Sharing in Google Drive                                               | Who can get answers from the document in Harmony                |
| --------------------------------------------------------------------- | --------------------------------------------------------------- |
| Shared with specific people                                           | Those people, matched by email address                          |
| Shared with a Google Group                                            | Members of a group with the same name in your identity provider |
| Shared with everyone in your organization ("Anyone at *company.com*") | Everyone in the tenant                                          |
| Anyone with the link                                                  | Everyone in the tenant                                          |

**Google Groups are matched by name.** Drive reports a group by its Google Groups name, for example `eng` for `eng@company.com`. Harmony matches it against the groups your identity provider sends for each employee. When Harmony is connected to Google Workspace as the identity provider, the names match as long as the group is included in the groups sent to Harmony. If a group Drive reports is not known to Harmony, the document's permission view shows it under **Unsynced groups**. Add that group to the groups your identity provider sends, or share the document with the people directly.

**To make a document available to everyone**, share it with your whole organization in Google Drive ("Anyone at *company.com* with the link"). No configuration is needed in Harmony.

Permission filtering happens automatically as part of every sync. Changes to sharing in Drive are picked up on the next sync.

### Managing your Google Drive source

After the initial setup you can return to **Settings** > **Integrations** > **Google Drive** at any time to:

* Add or remove shared drives from your selection
* Refresh the list of shared drives after the connected account joins a new one
* Disconnect the integration entirely

Removing a drive from the selection removes its documents from the Knowledge Base on the next sync.

### Troubleshooting

<details>

<summary>The drive picker is empty</summary>

The connected Google account is not a member of any shared drive. In Google Drive, open the shared drive, choose **Manage members**, add the account as a **Viewer**, then click the refresh button next to the picker in Harmony.

</details>

<details>

<summary>A document is in the Knowledge Base but employees do not get answers from it</summary>

Open the document's permission view in the Knowledge Base. If a group appears under **Unsynced groups**, Harmony does not know that group from your identity provider. Either add the group to the groups sent to Harmony, or share the document more widely in Drive, for example with everyone in your organization.

</details>

<details>

<summary>A file shows in the catalog without content</summary>

Files over 50 MB, and Google-native types that cannot be exported (Forms, Sites, shortcuts), are catalogued but not indexed. Split large documents or export them to a supported format.

</details>

### Frequently asked questions

<details>

<summary>Does Harmony index everything in a selected drive?</summary>

No. A selected drive is listed in your Knowledge Base, and you choose which documents to index, exactly as with other Knowledge Base sources.

</details>

<details>

<summary>Can Harmony write to Google Drive?</summary>

No. The connection requests read-only access and Harmony never creates, edits, shares or deletes files.

</details>

<details>

<summary>Which account should I connect?</summary>

Any Google Workspace account that is a member of the shared drives you want to sync. A dedicated account added as a Viewer to those drives keeps the connection independent of any one person's membership.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.harmony.io/integrations/knowledge-base/google-drive.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
