n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
47.14k stars 6.99k forks source link

Issue with AI Agent using vector store tool (Supabase) #11173

Open lucasvnd opened 1 week ago

lucasvnd commented 1 week ago

Bug Description

I'm currently using the AI Agent (Tools Agent) node in a workflow where the agent is utilizing the Supabase Vector Store Tool to retrieve information from a venue. The Vector Store Tool is attached to the OpenAI model (I have tried both GPT-4 and GPT-4 mini), and this is connected to the Supabase Vector Store. The embedding model in use is OpenAI small, and while it works intermittently, I frequently encounter an error with the message:

"Cannot read properties of undefined (reading 'replace')"

When I switch the model to an alternative one (Anthropic, Google Gemini, or even another OpenAI model), it starts working again, but after some further tests, the same error reappears. This inconsistency is affecting my workflow reliability.

It's unclear what is causing this behavior, but it appears to be related to the OpenAI model interaction, as switching models temporarily resolves the issue.

To Reproduce

1 - Add a Supabase Vector Store Tool node to the workflow, connected to the OpenAI model (e.g., GPT-4 or GPT-4 mini). 2 - Set up the Vector Store Tool to retrieve embeddings from Supabase, using the OpenAI small embedding model. 3 - Query the AI Agent node to retrieve information. 4 - Observe that the workflow sometimes returns the error: Cannot read properties of undefined (reading 'replace'). 5 - Switch to an alternative model (Anthropic, Google Gemini, or another OpenAI model). 6 - Run the query again. The issue temporarily resolves but reoccurs after some time.

Expected behavior

The AI Agent should consistently query the vector store tool without any issues, while this happens intermittently, I can't see the reason why.

Operating System

Docker

n8n Version

1.56.1

Node.js Version

Don't know

Database

PostgreSQL

Execution mode

main (default)

Joffcom commented 1 week ago

Hey @lucasvnd,

We have created an internal ticket to look into this which we will be tracking as "GHC-297"