> ## Documentation Index
> Fetch the complete documentation index at: https://docs.typewise.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Drive files

> Import the files in a shared Google Drive folder as a knowledge source.

Use this to bring the documents in a Google Drive folder into Typewise so the AI
Agent can rely on them when replying to tickets. Typewise re-imports the folder
on the schedule you choose, so you don't upload anything by hand.

<Note>
  To import from Google Drive, you first need to connect the Google Drive
  integration and share the folder with your service account. See [Google Drive
  integration setup](/documentation/integrations/supported/google-drive).
</Note>

## Add a folder as a knowledge source

<Steps>
  <Step title="Copy the folder link">
    Open the folder in Google Drive and copy the address from your browser's
    address bar. It looks like `https://drive.google.com/drive/folders/1AbC...`.

    You can also use the link of a single file. Typewise then imports only that
    file.
  </Step>

  <Step title="Add a source">
    Go to [Knowledge Hub](https://platform.typewise.app/knowledge-hub) and click
    **Add source**. Under **Integrations**, select **Google Drive**.

    <img src="https://mintcdn.com/typewise/9drqSV1Mr8nD0SmV/images/documentation/knowledge/google-drive-files/source-picker.webp?fit=max&auto=format&n=9drqSV1Mr8nD0SmV&q=85&s=4dd69d46be013a70a0947004a6e3bf55" alt="New knowledge source panel with Google Drive under Integrations" width="952" height="1190" data-path="images/documentation/knowledge/google-drive-files/source-picker.webp" />
  </Step>

  <Step title="Select the lookup">
    In **Lookup**, select **Files and folders**.
  </Step>

  <Step title="Configure and save">
    Paste the link into **Folder or file link**, fill in the other fields
    described in [Configuration](#configuration), and click **Save**.

    <img src="https://mintcdn.com/typewise/9drqSV1Mr8nD0SmV/images/documentation/knowledge/google-drive-files/new-source-form.webp?fit=max&auto=format&n=9drqSV1Mr8nD0SmV&q=85&s=8a9f6a7155af0ae442bb3bcc0ade5a5d" alt="New source form filled in for a Google Drive folder" width="896" height="1332" data-path="images/documentation/knowledge/google-drive-files/new-source-form.webp" />
  </Step>

  <Step title="Check the first import">
    The import starts right away. In the Sources table, the status shows
    **Analyzing** and changes to **Ready** when the import is done. Large
    folders can take an hour or more.

    <img src="https://mintcdn.com/typewise/9drqSV1Mr8nD0SmV/images/documentation/knowledge/google-drive-files/source-ready.webp?fit=max&auto=format&n=9drqSV1Mr8nD0SmV&q=85&s=b912ac635ecda239d3991a0457125790" alt="Sources table with the Google Drive source in status Ready" width="2560" height="612" data-path="images/documentation/knowledge/google-drive-files/source-ready.webp" />

    If the status shows **Failed**, hover over it to read the reason, then see
    [Troubleshooting](#troubleshooting). A warning icon next to **Ready** means
    the folder holds more files than one source imports. See [Limits](#limits).
  </Step>

  <Step title="Publish">
    A new source is a draft until you publish it. Click **Review** in the
    unpublished changes bar and publish the source. See
    [Publishing changes](/documentation/behavior/publishing).
  </Step>
</Steps>

## Configuration

| Field | Description |
| :- | :- |
| **Type** | The kind of source. It's already set to **Google Drive**. |
| **Lookup** | Select **Files and folders** from the Google Drive integration. |
| **Title** | A label for the imported content (for example, "Product manuals"). Use the same text as in **Name**. |
| **Folder or file link** | The link of the Drive folder or file to import. It must be shared with your service account. |
| **Import frequency** | `Daily`, `Weekly`, `Monthly`, or `Once`. Determines how often Typewise re-imports the folder. The default is `Daily`. |
| **Name** | The name of this source in the Knowledge Hub and in the `@` picker. |
| **Action description** | What the folder contains and when to search it. Helps the AI Agent decide when to use this source. |
| **Access level** | Controls how imported content can be used and shared. See [Access levels](/documentation/knowledge/access-levels). |

<Tip>
  Replace the default **Action description** with specifics, for example
  "Product manuals and warranty terms for all appliance models. Use for
  questions about installation, maintenance, and warranty."
</Tip>

The access level applies to every file in the folder. To give files different
access levels, put them in separate folders and add one source per folder.

## Use the source in a Specialist

<Steps>
  <Step title="Open a Specialist">
    Go to [Specialists](https://platform.typewise.app/specialists) and open the
    Specialist that should use your Drive files, or create one.
  </Step>

  <Step title="Mention the source with @">
    In **Instructions**, type `@` and select your Google Drive source. It
    appears as a pill. Say when to use it, for example:

    ```
    When the customer asks how to install or maintain a product, find the
    answer in @Product manuals. If the manuals don't cover it, hand off to a
    Human Agent.
    ```
  </Step>

  <Step title="Test and publish">
    Try it in the [Simulator](/documentation/testing-and-feedback/simulator)
    with **Include unpublished changes** enabled, then publish.
  </Step>
</Steps>

You can mention the source the same way in global guidelines and channel
guidelines. For more on writing instructions, see
[Writing good Specialists](/guides/best-practices/writing-specialists).

<Note>
  The AI Agent answers from the text of your files. It doesn't send the files or
  their Drive links to customers. To send a file as an attachment, upload it as
  a [File](/documentation/knowledge/file#send-a-file-to-customers) source.
</Note>

## Supported files

| Type | Formats |
| :- | :- |
| Google formats | Google Docs, Google Sheets, Google Slides |
| Documents | pdf, doc, docx, odt, rtf, epub, txt, md, rst, org, html |
| Spreadsheets | xls, xlsx, csv, tsv |
| Presentations | ppt, pptx |
| Images | png, jpg, jpeg (the text in the image is read) |

The format limitations of [uploaded files](/documentation/knowledge/file) apply
here too. For example, scanned PDFs have no readable text, so nothing is
imported from them.

Typewise skips everything else in the folder:

* Videos, audio, archives, Google Forms, and Google Drawings
* Code and configuration files, such as `.py`, `.js`, `.json`, `.xml`, and
  `.yaml`
* Hidden files and folders, such as `.git`
* Tooling folders, such as `node_modules`

## How syncing works

* **First import**: starts when you save the source.
* **Later imports**: run automatically on the **Import frequency** you chose.
  With `Once`, the folder is imported a single time.
* **New and edited files**: picked up at the next import.
* **Deleted files**: files you delete or move out of the folder are removed from
  the AI Agent's knowledge at the next import.
* **Unchanged files**: Typewise reads every file again but only updates what
  changed, so later imports are faster than the first one.
* **Subfolders**: included. A subfolder with limited access is imported only if
  you share it with the service account too.
* **Shortcuts**: followed, if the file or folder they point to is also shared
  with the service account.
* **Failed imports**: Typewise keeps the content of the last successful import,
  and the source shows **Failed** with the reason.

<Note>
  Changes in Drive reach the AI Agent at the next import, not immediately.
</Note>

## Limits

These limits apply to each Google Drive source.

| Limit | Value | What happens above it |
| :- | :- | :- |
| Supported files per source | 500 | Only the first 500 files are imported. |
| Size per file | 50 MB | The file is skipped, not downloaded. |
| Google Docs, Sheets, and Slides | 10 MB (Google's export limit) | The file is skipped. |
| Folder depth | 20 levels | Deeper folders are skipped. |

If a folder holds more than 500 supported files, the import still finishes. The
source shows **Ready** with a warning icon next to it. Hover over the icon to
read the message.

Typewise takes the files directly in the folder first, then the files in its
subfolders, level by level. Within a folder, files are taken in order of name.
To import the rest, link a subfolder instead, or split the folder into several
sources.

Text in images is read again at every import. A folder with many images takes
longer to import.

## Troubleshooting

A failed import shows **Failed** in the Sources table. Hover over the status to
read the reason. After you fix the cause, click **Retry processing** next to the
status to import again.

The titles below are the reasons Typewise shows.

<AccordionGroup>
  <Accordion title="The Google Drive service account key is missing or invalid">
    The pasted key is incomplete, or it was deleted in Google Cloud.

    In Typewise, go to **Integrations**, open the menu on **Google Drive**, and
    select **Reconnect**. Paste the whole content of the `.json` file. If the
    key was deleted, [create a new one](/documentation/integrations/supported/google-drive#connect)
    first.
  </Accordion>

  <Accordion title="Google Drive could not open this folder or file">
    The folder isn't shared with the service account, or the link points
    somewhere else.

    * In Google Drive, check that the service account's email address is listed
      under **Share** as **Viewer**.
    * Check that **Folder or file link** holds the link of that folder.
  </Accordion>

  <Accordion title="The Google Drive API is not enabled in the service account's Google Cloud project">
    Enable the Google Drive API in the Google Cloud project that holds the service
    account. See
    [Connect](/documentation/integrations/supported/google-drive#connect). Wait a
    few minutes, then retry.
  </Accordion>

  <Accordion title="No supported files were found in this Google Drive folder">
    The folder is empty, or it only holds file types that Typewise skips. Check
    [Supported files](#supported-files), and check that the link points to the
    right folder.
  </Accordion>

  <Accordion title="No indexable content was found">
    Typewise found supported files but couldn't read any text from them. This
    happens with scanned PDFs and empty files. Add files with readable text, then
    retry.
  </Accordion>

  <Accordion title="The Google Drive API quota of the service account's Google Cloud project is used up">
    Your Google Cloud project reached its request limit for the Google Drive API.
    Typewise tries again at the next scheduled import.
  </Accordion>

  <Accordion title="Failed to read files from Google Drive">
    Google Drive didn't respond in time. Retry. If it keeps failing, reconnect the
    integration under **Integrations**.
  </Accordion>
</AccordionGroup>

### The source is Ready, but the AI Agent doesn't use a file

* **File limit**: a source imports only the first 500 supported files. A warning
  icon next to **Ready** tells you when files were left out. See
  [Limits](#limits).
* **File type**: check [Supported files](#supported-files) and
  [Limits](#limits). Scanned PDFs have no readable text.
* **Access**: a subfolder with limited access, or the target of a shortcut, must
  be shared with the service account too.
* **Timing**: a file added after the last import is picked up at the next one.
* **Publishing**: check that the source and the Specialist are published.
* **Instructions**: check that the Specialist mentions the source with `@`.

## See also

* [Google Drive integration setup](/documentation/integrations/supported/google-drive):
  create the service account and connect Google Drive
* [Access levels](/documentation/knowledge/access-levels): control data sharing
  and visibility
* [File](/documentation/knowledge/file): upload single files and send them as
  attachments
* [Specialists](/documentation/behavior/specialists): tell the AI Agent when to
  use a source
* [Publishing changes](/documentation/behavior/publishing): make new sources
  live


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.