URGENT: 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

problem 1, you need to find a root cause on what’s making the chat memory be empty in the first place, because it shouldnt, and you can go to ur postgresql, find the empty chat data, and deletes it, and trigger it again, should be fixed

and i read some suggestion on the post you mentioned that if you change it to openai, there will be no issue, so if you wanna try that you can do tht as well

problem 2, chat memory will always be triggered everytime, it’s not overriding your vector store, but instead the vector store just does not get called, and in order for the AI Agent to call it you need to specify the tools in the system message/prompt, explain the vector store tool, what it is and how to call it, when to call it etc.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.