Make Full Use of Postgres Chat Memory

Describe the problem

When using the Postgres Chat Memory with AI Agent Nodes I’m not able to add any additional_kwargs, tool_calls, or response_metadata although these fields are added with every record to the database (empty though).
It would really help to have these information (especially timestamps) for further evaluation of chats. My current workaround leaves the Chat Memory out of the AI Agent Node and reads/writes from/to Chat Memory manually before and after the call, but that’s a lot of overhead to maintain if I want to do that with all sub-workflows using other agents. Just adding Postgres Chat Memory to the Agent Node would facilitate this process a lot.

Please share your workflow

Information on your n8n setup

  • n8n version: 1.62.5
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): regular
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker (GCP)
  • Operating system:

Excellent suggestion!

That is also my need. I want to add custom data from a tool to a customer and additional_kwargs is awesome for this.

About timestamps, a good workaround is to create a chat_history table manually (created_at column is automatically filled):

image