This RAG AI Agent with n8n + Supabase is the Real Deal

Cole Medin writes:

Art> ificial Intelligence is no doubt the future of not just software development but the whole world. And I’m on a mission to master it - focusing first on mastering AI Agents.

In this video I show how to implement an AI Agent with RAG using n8n and Supabase for the chat memory and vector DB. This AI Agent is the REAL deal - something you could actually use in production and not some dinky n8n workflow using buffer memory and an in-memory vector store that duplicates your vectors every time you insert a document again to update it. I see way too much of that on YouTube so I had to create this to show what an n8n RAG agent should look like.

Great video but Im having an issue that a lot of the time when asking a question , the agent does not check the vector database and just uses its own knowledge to respond. Which defeats the purpose.

Anyone else having similar issues?

Hey Emmett,

I recommend opening a topic in Questions to get help with this.

Hi Emmett. You can use system prompt (system message in AI Agent node) to limit the response based on database. You can prompt something like this:-

"You are a personal assistant who helps answer questions only from a corpus of documents from database.

Do not generate answer or response other than those information from database.

Just reply “This question is out of my scope within the database” if no available information found in the database pertaining to user query.