Skip to main content
A Google Drive data source reads the PDF files of a Google Drive folder into a knowledge base and keeps them up to date. Neural Factory’s AI agents can then answer from those files and cite them.
Who: the knowledge base’s creator and Admins · Where: Knowledge bases › your knowledge base › Add Source › Google Drive · Works on: Enterprise and SaaS
Only PDF files are synced. Google Docs, Sheets and Slides, and every other file type in the folder, are not indexed. To include them, export them as PDF into the folder.

What to ask your IT department for first

Neural Factory reads Drive through a Google Cloud service account: an account that belongs to an application instead of a person. Whoever manages your Google Cloud projects can set it up. Ask them for: Then share the Drive folder with that email address, the same way you would share it with a colleague. The service account can only read what is shared with it.

Connect Google Drive

1

Open the knowledge base

Go to Knowledge bases and open the knowledge base. Only its creator and Admins can add sources.
2

Add a Google Drive source

Click Add Source and choose Google Drive.
3

Enter the service account

Enter a Connection Name and a Description. Then copy these values from the JSON key: Client ID, Client Email, Project ID, Private Key ID and Private Key.
4

Enter a folder

In Folder ID (Optional), enter the ID of the folder to read. It is the last part of the folder’s address when you open it in Google Drive. The PDFs in the folder and its subfolders are synced. Leave the field empty to sync the PDFs of every folder the service account can read.
5

Choose when it syncs

Under Sync Configuration, choose Manual sync (it syncs only when you click Sync) or Scheduled sync (the default). For a schedule, pick a Schedule Frequency:
  • Every X hours, from 1 to 23 hours;
  • Daily, Weekly or Monthly, at an hour and minute you pick;
  • Custom, with a cron expression.
Times are in UTC.
6

Click Create

With Scheduled sync, the first sync starts right away. With Manual sync, open the source and click Sync to start it.
The source’s status changes from Syncing to Processing, then to Processed, and its Documents count shows the PDFs found.

What is synced

  • PDF files only, in the folder and its subfolders.
  • Files in the Drive trash are not indexed.
  • Each sync adds new PDFs, replaces changed ones, and removes the documents of PDFs that left the folder.
  • SaaS: files that would take you past your plan’s page allowance are skipped, and the source shows a warning saying how many. A changed file keeps its indexed version until the new version fits.
Scanned PDFs are read the same way as uploaded ones (see Scanned documents).

Sync now or change the connection

  • To sync now, open the row’s actions menu on the knowledge base page and click Sync Now, or open the source and click Sync. Only one sync of a source runs at a time.
  • To change the connection, open the source and click Edit. The private key is not shown. Leave Private Key and Private Key ID empty to keep the current ones. Saving a change to the service account or the folder starts a sync, which checks the new values.

If something goes wrong

When a sync fails, the source’s status shows Error (hover it to see the reason) and the source’s page shows a Sync Error banner.
Check the client email and the private key, and that the Google Drive API is enabled for the project. Open the source, click Edit and enter the values from the key again.
Share the folder with the service account’s email address.
Check the Folder ID.
This appears as a Sync Warning. The folder holds no PDFs that the service account can read.
This appears as a Sync Warning. Delete documents you no longer need or upgrade your plan, then sync again. See Limits.
Google Drive answered with another error, quoted after the colon. Try Sync again. If it keeps failing, show the message to whoever manages your Google Cloud projects.
More help: Document processing problems.