Connect Google Drive
Add files from Google Drive to the knowledge base, allowing the Agent to reference your documents, spreadsheets, and presentations.
Prerequisites
Before starting, please understand the basic concepts and folder structure of the knowledge base. If you haven't created a knowledge base folder yet, please refer to Knowledge Base Overview.
Applicable Scenarios
After adding Google Drive files to the knowledge base, you can:
- Let the Agent reference documents in Google Docs
- Let the Agent read data from Google Sheets
- Integrate content from Google Slides into the knowledge base
Connection Steps
Step 1: Enter Knowledge Base and Select Folder
-
Enter Knowledge Base Page
- In your workspace, click "Knowledge Base" in the left menu
- Select the "Folders" tab
-
Select or Create Folder
- Select an existing folder or create a new folder
- Folders are used to organize and categorize your documents
Step 2: Add File and Link Google Account
-
Click "Add File"
- In the folder, click the "Add File" button
- You'll see menu options
-
Select "Link Another Google Account"
- If this is your first time linking a Google account, the authorization process will start directly
- If you've already linked a Google account, you can:
- Click the "×" next to the linked account to link another account
- Or directly click the linked account to select files
Account Limitation
- Each account can only link one Google Drive account.
- If you want to link a different Google Drive account, you need to go to the "External Connections" tab to delete the existing connection first, or click the "×" next to the linked account to link another account.
Step 3: Authorize Google
After selecting "Link Another Google Account," you'll be directed to Google's authorization page.
- Select your Google account
- Review permission requests
- Click "Allow" to authorize
Security Notice
Codeer.ai will only read data you authorize and will not modify or delete any content.
Step 4: Select Files
After authorization completes, Google Drive's file picker will open:
-
Browse Your Google Drive
- You can browse your entire Google Drive
- Including "My Drive" and "Shared Drives"
-
Select Files You Want to Add to Knowledge Base
- You can select multiple files at once
- Only files can be selected, folders cannot be selected
- Supported file types include: Google Docs, Google Sheets, Google Slides, PDF, .docx, .xlsx, .pptx, .txt, .md, .csv, etc.
-
Click Confirm to Complete Selection
- Selected files will immediately be added to the knowledge base folder you just selected
- Files will appear in the folder list
Selection Recommendation
It's recommended to only select relevant files, avoiding adding too much irrelevant content, which can improve the accuracy of Agent responses.
Supported File Types
| Type | Supported Formats |
|---|---|
| Documents | Google Docs, .docx, .txt, .md |
| Spreadsheets | Google Sheets, .xlsx, .csv |
| Presentations | Google Slides, .pptx |
Usage
After files are added to the knowledge base, you need to configure the knowledge base tool in the Agent first before the Agent can use these files.
Configure Knowledge Base Tool
- Enter Agent Editor
- Click "Add Tool" in the "Tools" section
- Select "Knowledge Base"
- Select the knowledge base folder containing Google Drive files
- Set "When to Use" instructions
Use in Conversations
After configuration, when asking questions:
You: According to the "Product Specification," what are the requirements for this feature?
AI: According to "Product Specification.docx" in your knowledge base, the feature requirements include...
[Shows citation source: Knowledge Base > Product Specification.docx]
Common Questions
Can I select an entire folder?
No. Google Picker can only select files, not entire folders.
If you need to add multiple files from a folder:
- Browse to that folder in Google Picker
- Select multiple files at once (hold Ctrl/Cmd key to multi-select)
- Click confirm to complete selection
Can shared drives be connected?
Yes. Any files you have access to can be selected and added to the knowledge base.
In Google Picker, you can browse files in "Shared Drives" and select files you have permission to access to add to the knowledge base.
Will the knowledge base automatically update after files in Google Drive are updated?
No. Data in the knowledge base is a static snapshot and will not automatically sync with Google Drive updates.
If you update a file in Google Drive, you need to:
- Go to the knowledge base page
- Find the old version of the file and click delete
- Again click "Add File" → "Link Another Google Account" (or click the linked account)
- In Google Picker, reselect the updated file
This way, the Agent can reference the latest content.
How do I link another Google account if I've already linked one?
If you want to link a different Google Drive account:
- Go to the knowledge base page and select the "External Connections" tab
- Find your currently connected Google Drive account
- Click the menu (⋮) icon on the right and select "Delete"
- Return to the "Folders" tab and reconnect the new Google account
Alternatively, if you've already linked a Google account, you can directly click that account to select files without needing to reconnect.
Will large files affect performance?
The system will automatically handle large files, but it's recommended:
- Only select necessary files, avoiding adding too many large files
- If files are too large, consider organizing or splitting them first
- Regularly check files in the knowledge base and remove files that are no longer needed
Can I link multiple Google accounts simultaneously?
No. Each account can only link one Google Drive account.
If you need to access files from multiple Google accounts, you can:
- First link the first Google account and select needed files
- Delete the connection
- Link the second Google account and select needed files
- Repeat this process
Alternatively, share files from multiple Google accounts to the same Google account, then link that account.
Next Steps
- Configure Knowledge Base Tool - Learn how to use knowledge base in Agents
- Connect Notion - Add Notion pages to knowledge base
- Knowledge Base Overview - Understand basic concepts of knowledge base