Hi everyone,
I’m facing a strange issue with the n8n Agent node when using it with Google Gemini, Simple Memory, and a custom tool.
Inside the Agent execution, the LLM (Gemini) actually generates the correct response on the first call.
However, the Agent runs a second internal step (Simple Memory’s saveContext tool), and this second step returns no text.
The problem:
n8n treats the last tool output as the final result of the Agent — which means the workflow receives an empty message, instead of the actual LLM response.
So the flow only sees the output of saveContext (action + chatHistory) and not the original text response generated by the model.
My setup:
-
Chat Model: Google Gemini
-
Memory: Simple Memory (session key per WhatsApp user)
-
Tool:
send_message -
Agent: Normal Agent configuration
-
The memory tool runs automatically after the LLM generation
What I need:
How can I ensure that the Agent returns only the actual model response, not the memory tool output?

