Skip to content
Documentation

Train your AI agent on Google Drive files

Connect Google Drive to an intoCHAT agent, pick Docs, Sheets, Slides, PDFs, Word, text and Markdown files, keep them in sync, the limits, and how to set up the Google app.

If your FAQs, price lists, policies or product sheets live in Google Drive, you can pick those files and your agent learns from them. intoCHAT can open only the files you pick. It reads them and never changes anything in your Drive.

What you can import

File in DriveHow intoCHAT reads it
Google DocsExported as Markdown, so headings and lists are kept (plain text if Google can't export Markdown)
Google SheetsEvery sheet, as a heading with the sheet's name and its rows as CSV. Up to 1,000 rows per sheet are read
Google SlidesExported as plain text
PDFDownloaded and read like an uploaded PDF
Word (.docx)Downloaded and read like an uploaded Word file
Text (.txt) and Markdown (.md)Downloaded as they are

Other files, such as images, videos, Google Forms or folders, aren't shown in the file picker. A scanned PDF without a text layer can't be read; run OCR on it first.

Only the files you pick

intoCHAT asks Google for the drive.file permission only. With it, intoCHAT can open the files you choose in Google's file picker, and nothing else in your Drive:

  • It can't list, search or read your other files, folders or shared drives.
  • Each file you pick is shared with intoCHAT by Google at the moment you pick it. Picking a file again later is how you give access back if it was removed.
  • On Google's consent screen this appears as "See, edit, create, and delete only the specific Google Drive files you use with this app". intoCHAT only reads them.

The file picker itself is Google's: it shows your Drive so you can choose, but intoCHAT only learns about the files you select.

Connect Google Drive

  1. Open the agent's Knowledge tab and choose Drive under Add knowledge.
  2. Click Connect Google Drive. Google's consent screen opens.
  3. Choose your Google account and allow access. If Google shows a checkbox for Google Drive, leave it ticked.
  4. You return to the Knowledge tab, which shows "Google Drive connected" and Connected as your Google account.

The connection belongs to your intoCHAT account, so all your agents can import from it. One Google account is connected at a time; connecting again replaces it. If you cancel on Google's screen, nothing is connected. If you take longer than 10 minutes there, start again from the Drive option.

Connecting and disconnecting need the Manage level for integrations, so the owner and admins can do it. See Team.

Import files

  1. Click Add from Google Drive. Google's file picker opens.
  2. Select up to 10 files. The picker has a tab for your own Drive and one for shared drives. Folders open so you can choose files inside them.
  3. Click Select. intoCHAT reads the files, which can take a few seconds per file.

When files were added or updated, training starts by itself. A message sums up the import, for example "3 added, 1 updated, 0 unchanged". Each file becomes a source of type Google Drive, named after the file, with a link to it in Drive and the time it was last modified.

  • All or nothing. If one file can't be read, or the files would go over the agent's character limit, nothing is imported and your knowledge stays as it was. The message names the file when it can. Over the limit, intoCHAT shows Character limit reached.
  • Picking a file again updates it. The existing source gets the new text instead of a second copy. A file whose text didn't change is left as it is.
  • Empty files are skipped and listed as "skipped (no text)".
  • Large sheets are cut. Only the first 1,000 rows of each sheet are read, and the message names the spreadsheet. Split a bigger sheet into several sheets or files.

Members with the Edit level for knowledge can pick and import files. They pick from the connected Google account's Drive, so only give that level to people you trust with it.

Keep files up to date

Imported text doesn't change when you edit the file in Drive. To pick up your edits:

  • Click Sync now on the Drive option. intoCHAT checks when each of the agent's Drive files was last modified and reads again only those that changed. Only files whose text changed are retrained.
  • Turn on auto-resync. On a daily or weekly schedule, intoCHAT does the same check for you. Drive files use no website crawls, and a run reads up to 30 Drive files. See Auto-resync.
  • Pick the file again with Add from Google Drive.

A file renamed in Drive takes its new name at the next check.

If a file was deleted, moved to the trash, or intoCHAT may no longer open it, the check fails with a message on the source, and the saved text stays in your knowledge. Pick the file again, or delete the source if you no longer want it.

Limits

LimitValue
Files per import10
File size (PDF, Word, text, Markdown)50MB, as for uploads
Text per file4MB, as for uploads
Google Docs and SlidesWhat Google can export: up to 10MB of text
Google Sheets1,000 rows per sheet
CharactersCount toward the agent's character limit, like every source. See Plans and limits

Drive files stay private

  • Drive files are never shown as source links under a reply. Only website pages get links.
  • The agent sees a file's name, but not its Drive address, so it can't pass the link to visitors.
  • intoCHAT saves its access to your Google account in encrypted form, and the browser only ever gets short-lived access for the file picker.

Disconnect Google Drive

Click Disconnect on the Drive option. In the dialog you choose what happens to the files you imported:

  • Keep them (the default). They stay in all your agents' knowledge as they are now, but are no longer kept in sync. Auto-resync marks them with "Google Drive was disconnected. Connect Google Drive and pick this file again to keep it in sync."
  • Also delete the … files imported from Google Drive, in all your agents. Tick this to remove them too.

intoCHAT revokes its access at Google and deletes the saved access. You can also remove intoCHAT in your Google account under Security → Third-party apps & services. If you only do it there, the next check shows "Google Drive access was revoked or has expired. Reconnect Google Drive to keep this file in sync."

When something goes wrong

MessageWhat to do
"Google Drive isn't configured on this server."Google Drive isn't set up for this installation. Upload the files under Files instead, or set up the Google app below.
"Google didn't grant access to the files you pick."Connect again and leave the Google Drive box ticked on Google's screen.
"This file was deleted in Google Drive, or intoCHAT can no longer open it."Pick the file again from Google Drive, or delete the source.
"This file is in the Google Drive trash."Restore it in Drive, or delete the source.
"intoCHAT is no longer allowed to open this file."Ask the file's owner for access, then pick it again.
"The file's owner turned off downloading, so intoCHAT can't read it."Ask the owner to allow downloading, or make a copy you own.
"Google can't export this file because it is too large"Split the Doc or Slides into smaller files.
"Google Drive is limiting requests right now."Wait a few minutes, then try again.
Reconnect Google Drive appearsintoCHAT's access was revoked or expired. Click it to connect again.

Setting up the Google app

This section is for whoever runs the intoCHAT installation. Customers of intoCHAT don't need it.

Google Drive needs an OAuth client, an API key and the project number from one Google Cloud project:

  1. In the Google Cloud console, create a project or pick one.
  2. Under APIs & Services → Library, enable the Google Drive API and the Google Picker API.
  3. Under Google Auth Platform, set up the consent screen: the app name, a support email, your domain, and links to your privacy policy and terms. Choose External as the audience. Under Data access, add the scope https://www.googleapis.com/auth/drive.file. It is a non-sensitive scope, so the app needs only Google's basic brand verification, not the security assessment for restricted scopes.
  4. Under Clients (or Credentials → Create credentials → OAuth client ID), create a Web application client:
    • Authorized redirect URI: your app's address followed by /api/integrations/google-drive/callback, for example https://www.example.com/api/integrations/google-drive/callback. It must match NEXT_PUBLIC_APP_URL exactly.
    • Authorized JavaScript origin: your app's address, for example https://www.example.com.
    • Save the client ID as GOOGLE_DRIVE_CLIENT_ID and the client secret as GOOGLE_DRIVE_CLIENT_SECRET.
  5. Under Credentials → Create credentials → API key, create a key for the file picker. Restrict it to Websites with your app's address, and to the Google Picker API. Save it as NEXT_PUBLIC_GOOGLE_DRIVE_API_KEY.
  6. Copy the project number (not the project ID) from the project's dashboard or IAM & Admin → Settings, and save it as NEXT_PUBLIC_GOOGLE_DRIVE_APP_ID. It must be the project of the OAuth client: Google grants picked files to that app.
  7. Redeploy. With all four settings present, the Drive option offers Connect Google Drive.

Tokens are encrypted with TOKEN_ENCRYPTION_KEY (or NEXTAUTH_SECRET when it isn't set). Changing that secret makes the saved connections unreadable, and owners have to connect again.

While the consent screen is in Testing, only the test users you add can connect, and Google expires their access after 7 days. Publish the app to In production for everyone.

View as Markdown