The agent does not check the vector database and just uses its own knowledge to respond

the agent does not check the vector database and just uses its own knowledge to respond.

hi ! I’m trying to build a RAG A.I Agent, but the agent doesn’t check the vector database and just uses its own knowledge to respond. I asked the same question, sometimes it checks from the database, sometimes it doesn’t. What should I do so that the system always checks the database first?

Information on your n8n setup

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

Hi @pongpet.poodprao.pkg

Thanks for posting here and welcome to the community! :partying_face:

This is the fun part about prompt engineering :wink:
In your instructions you are telling it to “use the provided embeddings”, which is somewhat ambiguous to the AI.

n8n uses Langchain’s tool calling feature for vector store retrieval, therefore the AI needs to understand that the “embeddings” it needs to access is the tool it has to call.

So in short: you have to make your Agent instructions and the tool description more descriptive.

So something like this:

You will have to iterate over this quite a bit to get the prompt perfect so it works every time according to what you want the agent to do.

I would recommend to check out Youtube to learn more about building RAG systems with n8n, there is a lot of content to learn :wink:

2 Likes

Thank you very much for your answer. I’m still new. I’ll take it and try it. If there are any problems, I’ll ask again. Thank you. Sorry for the late reply.

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