Chatbot Issues with Postgres Chat Memory and Supabase Vector Store

Chatbot Issues with Postgres Chat Memory and Supabase Vector Store

Problem 1: Empty Chat Memory Causing Errors

Hi guys,
I have a chatbot (Webhook Input from Voiceflow) where the Agent responds and sends answers back. The issue occurs when I add Postgres Chat Memory, which stores the entire dialogue flow and context. It seems the chat model fails when it encounters an empty part in the chat memory, resulting in a [GoogleGenerativeAI Error]: 400 Bad Request - contents.parts must not be empty.

I found a post on the n8n community: GoogleGenerativeAI Error: 400 Bad Request. There’s a screenshot suggesting a solution, but I don’t know how to implement it. @Matheus_Oliveira

Problem 2: Chat Memory Overriding Supabase Vector Store

When the Chat Memory is attached and works, it uses the chat memory as the knowledge input instead of the Supabase Vector Store, which is not the intended behavior. My prompts are designed to use the chat memory only to track past interactions and respond specifically if the user repeats a question. However, I can’t get this to work as intended.


Information on your n8n setup

  • n8n version: 1.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Self Hosted
  • Operating system: Windows 11

I also need the chat memory for things like if the user only replies “Yes” its hard to track intents otherwise.

Hi @Kiremit.
For the problem 2, you must define clearly for your vector tool. Instead of naming it “Supabase Vector Store2”, you can name it as Vector DB Tool or anything you want After that, you can make your instructions more detailed for the Vector DB Tool, example: You're helpful assistant. You have capability to search anything related to [topic] with "Vector DB Tool" that will help you to get more precise answer

If it helps, kindly mark my message as anwer, thanks:)