How to Make an Agent Always Access a Vector Database Without Using It as a Tool?

I have questions about using vector-based agents, and I’d like to ask for guidance on a specific issue regarding vector databases with agents.

My goal is to have my agent always access the Supabase vector database, but without it needing to be triggered as a tool or requiring the use of a description to call it. I want it to work similarly to the “Question and Answer Chain” node in N8N, where it automatically consults the vector database whenever needed.

Currently, I have a lot retriever nodes in the agent to allow users to query different types of content. However, I’d like to consolidate all this information into a single vector database that the agent always consults automatically, if relevant. I haven’t been able to figure out how to do this, but I believe it might be possible using Langchain code.

Does anyone have any suggestions on how to achieve this? Is it possible to configure the agent so it automatically consumes the vector database without being treated as a tool that requires explicit access instructions?

Information on your n8n setup

  • n8n version: 1.68.0
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hi @Pedro_Elias_Santana,

Welcome to the community! :blue_heart:

So, even though it’s not possible at the moment to configure the agent to consume the vector DB in this way, you could use the Call n8n workflow tool to call a sub-workflow that would query the Supabase vectorstore directly. This avoids you having to create an edge case for each query.

Something like this:

That calls something like this:

The sub-wf node always returns only the first item processed - Execute Workflow Trigger node documentation | n8n Docs - so you can add the aggregate node to receive all items.

2 Likes