Kinks & hallucinations with the Ultimate n8n RAG AI agent

Thrilled to have recently discovered Cole’s channel and now this community. I’m a non-technical person trying to pick up n8n…the tutorials are accessible enough to give me (false?) hope!

I’ve experimented with the ultimate n8n RAG AI Agent, running n8n locally on a Mac and have managed to ingest documents into Supabase. However, it doesn’t happen automatically when creating/updating files on google drive - i have to click “test step” on the Supabase node. It’s also finnicky, e.g. two PDFs in the folder are properly ingested, but an added third PDF one isn’t unless I delete the first two.

Also I live in Hong Kong, where I can’t get access to OpenAI/Anthropic APIs so I’ve tried alternative chat models and use Ollama embeddings (mxbai-embed-large:latest).

With the Gemini models, I get: “Bad request - please check your parameters (Google Gemini requires at least one dynamic parameter”. With the Mistral chat model (apparently the Supabase node only works with the Large model version), I occasionally get hallucinated answers that don’t draw on RAG. I made the prompt more strict, but it didn’t solve it entirely. Sporadically I get the error: [Message content must be a string or an array.
Received: undefined].

The gold standard I’ve found for RAG is Google’s notebooklm and I wonder if there is any hope for an n8n RAG workflow to perform similarly? Would it entail a better LLM model, embeddings model, vector database, etc.? Any suggestions very much appreciated.

1 Like

Welcome to the community @amirh7!!

For your first issue with the workflow not triggering, make sure you have the workflow toggled as active in the top right! It’s usually not toggled when the trigger doesn’t seem to work.

Mistral is a very small model so it makes sense you are getting hallucinations. Compared to OpenAI/Anthropic/Gemini it is tiny. As far as your issue with Gemini, I believe that is unfortunately a bug with n8n.

You could use OpenRouter to get access to really any LLM you want! Wonderful platform, I’d highly recommend looking into it and there are OpenRouter nodes in n8n as well.

Thank you for the feedback Cole. I will try using OpenRouter to access other models. According to the n8n Docs, the Tools agent supports OpenAI, Groq, Anthropic, Mistral and Azure OpenAI. Not sure if this information is up to date…I’m surprised that Gemini and DeepSeek aren’t on the list, but it could explain the error with Gemini.

I’ve been very interested in your RAG tutorials. My hoped-for use case is content generation (as in briefings and industry research), so a more advanced LLM (or more advanced embeddings model?) would probably be beneficial.

1 Like

Yeah Gemini does support tools in general so I’m not sure why it doesn’t work specifically with n8n.

I appreciate it!