Supabase Vector Store node returns empty output (no error) while SQL query returns matches

Supabase Vector Store returned no results — debugging journey & findings

I ran into an issue where the Supabase Vector Store node returned empty results in n8n, even though my embeddings and data were correctly stored.

:magnifying_glass_tilted_right: Debug step (Option A — direct RPC test)

I created an HTTP Request node to call the Supabase RPC (match_documents) directly.

Result:

  • RPC returned matching rows :white_check_mark:

  • Embeddings valid (vector(1536)) :white_check_mark:

  • Supabase access & permissions OK :white_check_mark:

:backhand_index_pointing_right: This proved the problem was not Supabase, embeddings, or RPC.


:white_check_mark: Fix: wrong operation mode

The node was set to Get Many, which does not perform similarity search.

Changing the mode to:
:backhand_index_pointing_right: Retrieve Documents (As Tool for AI Agent)
enabled vector search.

:warning: New issue discovered: AI Agent rewrites tool input

The core issue is that the json.input field generated by the AI Agent does not preserve the meaning of the user’s original question.
As a result, the tool receives a different query than what the user actually asked.

Example

  • User question:
    “My baby feeds for a short time and then unlatches. Is this normal?”

  • Tool received ($json.input):
    “Tips to prevent nipple cracks during breastfeeding.”

Because the rewritten query has a different meaning, the Supabase vector search returns no results, even though relevant content exists for the original question.

:bullseye: What I need

I’m looking for a deterministic way to ensure the AI Agent generates precise and faithful tool input, ideally by:

  • Passing the user’s original question unchanged, or

  • Preserving the original meaning when generating the tool input.

Has anyone found a reliable method to control or constrain tool input generation in the AI Agent?