Problem with the system message in n8n's RAG AI Agent node

Hello everyone,

I’m having a problem with the “Retrieve Documents” node (Vector Store Tool) in my n8n workflow for a RAG chatbot. Despite my attempts to modify the node description, the default system message persists:

“System: Use the following pieces of context to answer the users question. If you don’t know the answer, just say that you don’t know, don’t try to make up an answer.”

I tried to personalize this message by modifying the “description” field in the node’s parameters, but without success. The node seems to completely ignore my changes.

Current configuration:

  • Node: Retrieve Documents (ID: a31b26c9-cc09-490d-a9ea-9b7a65f1fb6f)
  • Type : @n8n/n8n-nodes-langchain.toolVectorStore

I’ve checked that the node is correctly connected to the rest of the workflow, including the OpenAI Chat Model node and the RAG AI Agent.

Has anyone encountered this problem before, or has any idea how to force the node to use a custom system message? Is there a way around this limitation?

Thanks in advance for your help!

Quotes:
[1] https://ppl-ai-file-upload.s3.amazonaws.com/web/direct-files/44354658/b9474905-6874-44c1-8849-cee6553baf09/Chatbot_GDP-1.json

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 n8n support,

Here’s some additional information about my setup:

n8n version: 1.69.2
Database: SQLite (default configuration)
n8n EXECUTIONS_PROCESS setting: own
Running n8n with: npm (local install)
Operating System:
Product Name: macOS
Product version: 15.2
Build version: 24C5079e

Looking forward to your suggestions!

Welcome to the community @Dorian_Marty !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.

Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!


Note you can share your workflow here in the forum as per tip above. It is safe, no credentials shared. Besides access to your S3 bucket is fobidden (“AccessDenied”).

Could you share your worklfow here, please?

Hi @Dorian_Marty Im having the same problem here with my RAG agent.

Did you find any solutions to it?

I believe this is the error:


This “OpenAi Chat Model12” is using this system message that i cant change, causing the answer to be “I dont know”, even if the vector storage returned me itens found on the vector storage.
This “OpenAi Chat Model12” is the one atached to the vector storage:

Yes, that’s exactly my problem too! Thanks for bringing it up. I notice that the ‘OpenAI Chat Model12’ system message seems to limit responses, even if relevant items are returned from vector storage. This is making things run less smoothly. If any solutions are available, I’d love to hear from you.

Hello @Dorian_Marty !
I found a way to treat that, I’m using the supabase vector storage directcly, and them i’m sending just the returned itens to my main AI to treat it:

Its like this now.

I basically separated the agent node. This supabase one (you can use any other one, pinecone for example), and them im sending this output from this supabase node to the ai.

2 Likes

Same problem here. To solve it, I simply swapped an AI Agent for an Question and Answer Chain Node. This way I was able to improve the prompt. Look:

3 Likes

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