- 1.56.2 (Hosted by n8n Cloud)
- Database (supabase as vector store and Postgre Chat Memory):
- n8n EXECUTIONS_PROCESS setting: not sure?
- Running n8n via n8n cloud:
- Operating system: Locally? Windows 11/Edge Browser
I am trying to learn this. I have a dev background of 20+ years but am struggling in trying to work out why the Open AI chat model is not returning the correct information even though it is returned correctly from the vector store. I am following this tutorial on youtube (4) This RAG AI Agent with n8n + Supabase is the Real Deal - YouTube and I can insert and update the files and see them in supabase and they ar ebeing correctly retrieved by the “Retrieve Documents” node but when the “Open AI Chat Model1” node just keeps returning “I cant access your documents”.
Here is a picture of what I think the “offending node” is doing. It is admitedly not receving the input in great layout but I dont know how to change that but the content of the files is there (“this contains the meeting notes from 9 September 2024” and “This is the content of the document”)
This is the output of the Supabase Vector Store and as you can see it is finding both documents in the Google folder and returning the contents
[
{
"response":
[
{
"pageContent":
"This contains the meeting notes from 9 September 2024",
"metadata":
{
"loc":
{
"lines":
{
"to":
1,
"from":
1
}
},
"source":
"blob",
"file_id":
"16vGEwtOvPg7QTVOOCv41dl8Jr1xY7s-ksV3_Vf-cDzI",
"blobType":
"text/plain"
}
},
{
"pageContent":
"This is the content of the document",
"metadata":
{
"loc":
{
"lines":
{
"to":
1,
"from":
1
}
},
"source":
"blob",
"file_id":
"1hr_NMh3bUZ0Iw5vG5DjvLyMSMkXkt4YS3cZiQqC-Jqs",
"blobType":
"text/plain"
}
}
]
}
]
this is the input of the Open AI Chat Model1 and the content is embedded in the messages. It is not ideal and I dont know why it produces the input like this but the content is definately there
[
{
"messages":
[
"System: Use the following pieces of context to answer the users question. \nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n----------------\nThis contains the meeting notes from 9 September 2024\n\nThis is the content of the document\nHuman: give me the contents of the Meeting Notes file"
],
"estimatedTokens":
74,
"options":
{
"openai_api_key":
{
"lc":
1,
"type":
"secret",
"id":
[
"OPENAI_API_KEY"
]
},
"model":
"gpt-4o",
"timeout":
60000,
"max_retries":
2,
"configuration":
{
},
"model_kwargs":
{
}
}
}
]
this is the output of the Open AI Chat Model1 wher eit says it cannot find specific content
[
{
"response":
{
"generations":
[
[
{
"text":
"The information provided does not include the specific contents of the meeting notes from 9 September 2024. I'm unable to give you the details from that document. If you have any other questions or need further assistance, please let me know.",
"generationInfo":
{
"finish_reason":
"stop"
}
}
]
]
},
"tokenUsage":
{
"completionTokens":
48,
"promptTokens":
77,
"totalTokens":
125
}
}
]
this is the main workflow. Everything seems to work except the Chat Model not outputting the reuslt even though it is found