As the title mentioned, my agent is not fed the meesages in order, thus resulting in bad conversations.
I will attach photos as examples below from what the Agent got and how the DB looks in Supabase.
They are real cases with potential customers of ours. Im sorry but they are in my native language. In the examples below, it is easy to spot how the Postgres node does not retrieve the messages chronolgically even if you do not understand the messages.
The AI must be quering them in the wrong order, try seeing if you can have it get by a date created or a date added to the format.
Do you need to use supabase/postgres? N8N has a datatable node and it works well when trying to sort or get information, but if your using it as a vector store, than n8n data tables cant do that.
I have no option to sort them by date in the postgres node. Maybe i dont see it? Do you know of something like this?
Im trying to keep my conversations and context in supabase since all of my chat is stored there, i have a table that makes sure i dont double respond to messages etc.
Do you think there is an option or just getting the datatable from n8n? =/
That is a good idea. Will try this. Not sure how to implement at this time. Any suggestions on where to start, what in aiming for, how do i implement/test it before i actually have a crack at it? Thanks a lot!
Then you’ll get the messages in their normal order,
If everything looks OK, then the issue isn’t in the memory, so try looking more deeply into the prompts or the workflow especially if you are injecting anything or the prompts at any point..