Using google drive or gpt as knowledge source

I’m wondering if it’s possible to hook up a couple of different types of nodes for a knowledge source for the AI. The first is google drive. In the setup I see that I can set the resource to a folder but the operation is where I don’t see an option to read or index. So, is it possible to set a folder up to be used to reason from?

Also, I see AI nodes, but not an AI tool. A coworker created a GPT in our OpenAI teams account and shared it with me. That GPT knows how to answer customer requests. Is it possible to set up an AI tool that uses that GPT?

Here’s my workflow.

n8n version: 1.91.2 running in the cloud

1 Like

You might need to get all the files first and pass to OpenAI model.

Can not only list the folder.

Yes, You Can Use a Google Drive Folder as an AI Knowledge Source in n8n — Here’s How:

While n8n doesn’t have a one-click “index folder for AI” feature, you **can absolutely configure it to read documents from a Google Drive folder and feed the content into an AI model like OpenAI for reasoning.

1 Like

I’m sorry but your how to doesn’t give me enough info to know how to accomplish this. Can you please provide some more details on how to set up the google drive tool to read from a folder and provide that to the AI? Thank you!

1 Like

Step-by-Step Setup in n8n:

  1. Connect Google Drive

Use the Google Drive node.
Set the resource to File and use the operation: List.
Specify the folder ID to retrieve all files in that folder.

  1. Read Each File

Use a Loop or SplitInBatches node to iterate through each file.
For each file:

  • Use Google DriveDownload to get the file contents.
  • Use the Binary to Text node to convert file content (PDF, TXT, etc.) to plain text.
  1. Send to OpenAI (or other LLM)
  • Add an OpenAI node (or HTTP node calling OpenAI API).
  • Pass the plain text content from each file as part of the prompt (or optionally summarize, chunk, or embed it).

Thank you for the detailed explanation! Unfortunately I’m not seeing a List operation in the Google Drive node.

Hi,

To get all the files, use the search operation. You can leave the query blank. It will then return every file. If you want to specify a specifc folder where to get the files you can also specify what folder.

It will return 1 file, as 1 item. So the split in batches node is not needed. The next node in question would loop for each item.

Here’s an example.

should I share the link of my google doc , where you can find the detailed solution of this?

Thank you, that would be appreciated.

Thanks. So then, where would the output of the 2nd node go to eventually be used as a knowledge tool by the AI?

It connects directly to the AI agent. The AI node has an option called “Automatically Passthrough Binary” that sends the data to the agent. It’s enabled it in the example below.

If you would like to give the AI agent all the data in one run. You can add the aggregate node after the 2nd node.

If this helped, it’s appreciated if you mark it as solved. Cheers!

Thank you. I’m sorry but I feel so stupid. I’m just not completely following how this will work as the tool for my ai agent in my current workflow. Here’s what it currently looks like after I added what you have. How do I hook it up so that my existing OpenAI node that’s generating the answer based on the google doc and sheet, also uses the drive files as a tool? And yes, I would think passing all of the files in at once would probably be best, so do I have the aggregate node in the right spot? Thanks again.

@Hafiz_usama, could you please post the link to your google doc? Thank you.