How to stop AI chat loading previous tool calls into history

Describe the problem/error/question

When using web chat with an AI agent. If it does any tool calls, these save into the chat memory.
When the page is refreshed, it loads in all the previous history which includes the AI’s tool calls and makes a big messy chat window.

What is the error message (if any)?

You can see this example when it loads previous messages, it has this one that was not part of the chat, just a tool call, and then the actual message that was responded with.
Its just a used tools chat memory message.

Return intermediate steps is off.

What gets sent to the chat interface is just the last part of it

Something like “Based on the search results, I found a clear knowledge base article about updating your credit card.” and the rest of the article and link etc

If you refresh the page, or the chat and it loads the previous session, the last message has the whole json of the used tool, and then the last part which was responded.

Driving me crazy trying to work out how to exclude the used tools part from being restored in the chat message. And cause they are part of the same chat memory message its not like i can filter a certain type of chat memory

Information on your n8n setup

  • n8n version:2.1.5
  • Database (default: SQLite):postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system:ubuntu 22

I believe it’s a behaviour bug

Thanks for that