How to load previous X messages from current session (stored in Postgres DB) into the chat widget on page refresh/load?

Hi @Jason_Sugar welcome to the :n8n: community!

Since you’re storing the messages, you’ll just need to edit the chat node trigger, enable the Load Previous Session option, choose From Memory, and link it:

Then, pass the Key of the session you want. This way, it should load previous chats in the UI.

1 Like