Hey guys!
Just wondering how can I replace the Google Drive node with the Local File node in a RAG workflow from Cole?
I just set up everything from the “self-hosted-ai-starter-kit” pack and it’s running fine, but I need to avoid using of any external services like Google Drive because of the confidential data.
So, I would like just grab the files from the local directory in docker.
Yeah the “Local file” trigger you have in the second screenshot is the way to go! Do you have a specific question on using it?
Hey @ColeMedin !
Thank you for the reply.
Yeah, I have a few questions:
- I just tried to use the “Local file” node but now the next one “Set File ID” returning wrong json fields. How can we correct this node? (Please see the screenshot)
- I have an issue with docker volume mounting. So, I mounted my local folder to n8n docker folder, but the “Local file trigger” node keeps waiting when I create a new txt file on my PC, like nothing happened. But if I then go to the docker mounted folder I can see the file here.
The only way I managed to trigger the “Local file trigger” node is using “touch” command directly in the n8n container.
Not sure how to fix that…
For your first question - looks like the local file trigger doesn’t give you the file ID or parent anymore so you’ll have to create that yourself from the path. For example, the ID could be the full path to the file and the parent folder ID could just be the file path excluding the file name itself. Does that make sense?
Also for your second issue - I’ve encountered this myself too. Think it’s a glitch within n8n but I’m not totally sure. Probably worth posting on their forum since I wasn’t able to find a solution either!
Hey @ColeMedin ,
Thank you for the details!
I’ve managed to fix the first issue. As for the second one, I noticed that when I turn off the “Webhook” node and leave just one trigger, “when a chat message is received”, it starts working properly.
One more question: how do you think is it better to use the “Question and Answer Chain” node instead of the “AI agent” node in the case of RAG? I made some tests, and it seems that the “Question & Answer Chain” gives more accurate answers. For example, let’s say I want to use RAG as a “Wiki” for my company’s support team. So the answers from RAG should be identical to the documents that have been uploaded.
Oh nice I’m glad that works for you! Super good to know.
You know I haven’t played with the “Question and Answer Chain” in a while, but I do know it is using LangChain under the hood. I’m guessing it leverages some of the predefined RAG modules LangChain offers for more robust RAG out of the box which is why you’re getting better results! Nothing you couldn’t set up yourself with the AI agent node with some more work.
I’m not sure what exactly makes up the Question and Answer Chain but I bet you could look into their documentation and see! Maybe they’re including some RAG strategies like query expansion or reranking.
Got it, thanks!
Also, one more thing I’ve learned - do not put anything to the “.n8n” directory because it will erroring with permission alert.
Changed my mounted directory from /home/node/.n8n/wiki 7 to /home/node/wiki 7 and everything is working as expected.
Just in case
You bet! That’s super good to know, thanks for mentioning that!