Files
ragflow/docs/guides/dataset/add_data_source/add_google_drive.md
YanZhang 611e0596f6 docs: modify docs display & add images (#17575)
### Summary

modify docs display
add some images
delete enterprise docs
standardize capitalization
2026-07-30 21:24:15 +08:00

8.2 KiB

sidebar_position, title, sidebar_label, slug, sidebar_custom_props
sidebar_position title sidebar_label slug sidebar_custom_props
3 Add Google Drive Add Google Drive /add_google_drive
categoryIcon
SiGoogledrive

Add Google Drive

Add Google Drive as one of the data sources in RAGFlow.


This document provides step-by-step instructions for integrating Google Drive as a data source in RAGFlow.

1. Create a Google Cloud Project

You can either create a dedicated project for RAGFlow or use an existing Google Cloud external project. In this case, we create a Google Cloud project from scratch:

  1. Open the project creation page https://console.cloud.google.com/projectcreate:
    Google Drive image 1
  2. Under App Information, provide an App name and your Gmail account as user support email: Google Drive image 2
  3. Select External: Your app will start in testing mode and will only be available to a selected list of users. Google Drive image 3 4: Click Create to confirm creation.

You need to configure the OAuth Consent Screen because it is the step where you define how your app asks for permission and what specific data it wants to access on behalf of a user. It's a mandatory part of setting up OAuth 2.0 authentication with Google. Think of it as creating a standardized permission slip for your app. Without it, Google will not allow your app to request access to user data.

  1. Go to APIs & ServicesOAuth consent screen.
  2. Ensure User Type is set to External:
    Google Drive image 4
  3. Under Test Users, click + Add users to add test users: Google Drive image 5 Google Drive image 6

3. Create OAuth Client Credentials

  1. Navigate to https://console.cloud.google.com/auth/clients.

  2. Select Web Application as Application type for the created project:
    Google Drive image 7

  3. Enter a client name.

  4. Add http://localhost:9380/api/v1/connectors/google-drive/oauth/web/callback as Authorized redirect URIs:

  5. Add Authorized JavaScript origins:

    • If deploying RAGFlow from Docker, use http://localhost:80:
      Google Drive image 8
    • If building RAGFlow from source, use http://localhost:9222 Google Drive image 9
  6. After saving, click Download JSON in the popup window; this credential file will later be uploaded into RAGFlow.

Google Drive image 10

4. Add Scopes

You need to add scopes to explicitly define the specific level of access your application requires from a user's Google Drive, such as read-only access to files. These scopes are presented to the user on the consent screen, ensuring transparency by showing exactly what permissions they are granted. To do so:

  1. Click Data AccessAdd or remove scopes, and add the following entries and click Update:
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/admin.directory.group.readonly
https://www.googleapis.com/auth/admin.directory.user.readonly

Google Drive image 11 Google Drive image 12

  1. Click Save to save your data access changes:

Google Drive image 13

5. Enable Required APIs

You need to enable the required APIs (such as the Google Drive API) to formally grant your Google Cloud project permission to communicate with Google's services on behalf of your application. These APIs act as a gateway; even if you have valid OAuth credentials, Google will block requests to a disabled API. Enabling them ensures that when RAGFlow attempts to list or retrieve files, Google's servers recognize and authorize the request.

  1. Navigate to the Google API Library https://console.cloud.google.com/apis/library:
    Google Drive image 14

  2. Enable the following APIs:

    • Google Drive API
    • Admin SDK API
    • Google Sheets API
    • Google Docs API

Google Drive image 15 Google Drive image 16 Google Drive image 17 Google Drive image 18 Google Drive image 19 Google Drive image 21

6. Add Google Drive as a Data Source in RAGFlow

  1. Go to Data Sources inside RAGFlow and select Google Drive.
  2. Under OAuth Token JSON, upload the previously downloaded JSON credentials you saved in Section 3: Google Drive image 22
  3. Enter the url of the shared Google Drive folder link: Google Drive image 23
  4. Click Authorize with Google
    A browser window appears showing that Google hasn't verified this app.
    Google Drive image 25
  5. Click ContinueSelect AllContinue.
  6. When the authorization succeeds, select OK to add the data source. Google Drive image 26 Google Drive image 27 Google Drive image 28 Google Drive image 29