# Google Drive Integration

Point your AVCodex agent at the folder where your manufacturer spec sheets, AS-built drawings, commissioning checklists, and signal flow diagrams live. The agent reads them on demand. No more "which folder was that Crestron datasheet in again?"

---

Connect Google Drive to your AVCodex agent so it can search, browse, and read files on behalf of users. The agent gets direct access to documents, spreadsheets, slides, and any other files stored in Drive, including Shared Drives. Crestron NVX spec sheets, QSC Q-SYS Designer guides, Biamp Tesira config notes, all on tap.

## What the AI Can Do

Once connected, your agent gains four tools:

| Tool | Description |
|------|-------------|
| **google_drive_search** | Search for files across Drive by name or content |
| **google_drive_list** | List files in a folder (defaults to root) |
| **google_drive_read** | Read the full content of a file by its Drive ID |
| **google_drive_get_metadata** | Get detailed file info: owner, sharing status, permissions |

### Supported File Types

The integration handles Google Workspace files and standard formats:

- **Google Docs**: exported as plain text
- **Google Sheets**: exported as CSV (room readiness lists, BOM trackers)
- **Google Slides**: exported as plain text
- **PDFs, Word (.docx), Excel (.xlsx), PowerPoint (.pptx)**: extracted via document parsing (manufacturer spec sheets, AS-builts, commissioning docs)
- **Text files** (JSON, CSV, XML, Markdown, code): read directly
- Files up to **10 MB** can be read

## Connecting Google Drive

  **1.**
    **Open the Integrations tab**

    In your agent's builder, navigate to the **Build** section and select the **Integrations** tab. Find **Google Drive** in the list of available integrations.

  **2.**
    **Click Connect**

    Click the **Connect** button next to Google Drive. A Google OAuth popup will appear asking you to sign in and grant permissions.

  **3.**
    **Authorize access**

    Sign in with the Google account whose Drive files you want the agent to access. Grant the requested permission for read-only Drive access.

    > **Note:** The integration requests read-only access (`drive.readonly`). Your agent can search and read files but cannot modify, delete, or create files in Drive. AS-builts stay safe.

  **4.**
    **Test it out**

    Once connected, open the chat preview and try:
    - "Search my Drive for the Crestron NVX commissioning checklist"
    - "List the files in the Acme Corp HQ project folder"
    - "Read the contents of the Q-SYS programming SOP"

## Folder Restrictions

You can optionally restrict the integration to specific folders. When folder restrictions are configured:

- **Search** only returns files within the allowed folders
- **List** shows only the allowed folders when browsing root
- The agent cannot access files outside the configured folders

Useful when you want the agent to work with a specific project folder (a single corporate refresh) or department directory (engineering only, not commercial) without exposing the entire Drive.

## How It Works

When a user asks the agent a question that requires file access, the agent automatically decides which tool to use:

1. **Search** when the user asks for a specific file by name or topic
2. **List** when the user wants to browse a folder's contents
3. **Read** when the user needs the actual content of a file
4. **Metadata** when the user asks about file details (who owns it, when it was modified)

The agent chains these tools naturally. For example, "find the BOM for Boardroom 4 and tell me which DSP we specced" triggers a search followed by a read.

## Example Use Cases

- **Engineering knowledge** Let design engineers ask spec questions answered by manufacturer PDFs in a Shared Drive
- **Doc lookup**: "Find the latest version of the Crestron NVX commissioning SOP"
- **BOM checks**: "Read the Q3 BOM tracker and tell me which rooms are still missing Shure MXA920s"
- **Recent activity**: "What AS-builts were updated in the Acme HQ folder this week?"

## Shared Drive Support

The integration works with both personal Drive and Shared Drives (formerly Team Drives). All API calls include Shared Drive support, so files in any Shared Drive the connected account has access to are searchable and readable. Most AV firms keep project files in Shared Drives, so this matters.

## Billing

Google Drive tool calls use your standard LLM token billing. There is no separate per-call fee. Reading large files consumes more tokens due to the content being included in the conversation context. A 200-page Biamp manual costs more to read than a 10-page commissioning checklist.

*AVCodex · Your AV expertise. Amplified by AI.*
