How to Fix n8n AI Agent Tool Calls Not Saved in the Memory Node
n8n's AI Agent never writes the tool_calls array to Memory, so the model imitates a fake history and stops calling tools. Here are the two fixes that work today.
TL;DR: n8n's AI Agent never writes the tool_calls array to Memory (GitHub #14361, still open), so the model imitates a fake "I never called anything" history and stops calling tools; fix it with "Return Intermediate Steps" or the n8n-nodes-better-ai-agent community node.
This shows up a few turns into a conversation that uses the Simple Memory, Postgres, or Redis memory node behind an AI Agent: the agent calls a tool successfully once, then on a later turn claims it already has the answer and just makes something up instead of calling the tool again. Most write-ups treat this as a prompting problem. It is not - it is a confirmed, still-open bug in n8n's own memory-persistence code, and it is missing from both n8n's official docs and the top-ranking "complete guide" posts. For a running catalog of n8n failure patterns like this one, see the Automation Error Index.
Why does n8n's AI Agent forget it called a tool?
The AI Agent node's Memory sub-nodes only serialize the plain input and output text of each run - never the tool_calls array the underlying agent actually produced. On the next execution, the loaded history shows a clean question-then-answer exchange with no tool call in between, even when one happened. The model reads that history and imitates the pattern: after a few turns it stops calling the tool at all and just answers from its own (often false) memory.
The bug is tracked as GitHub issue #14361. n8n's own AI team opened an internal ticket for it (GHC-1434) back in April 2025 and confirmed it as a real defect, not an enhancement request - but as of July 2026 it is still open, with two competing community fix pull requests (#33068 and #26739) both unmerged. The bug is not locked to the 1.83.2 build named in the original report either: users have since confirmed the same empty-array behavior on n8n 2.0 with Postgres memory, and separately on Redis Chat Memory, so upgrading n8n by itself will not fix it.

How do you fix n8n AI Agent tool calls not saved in the Memory node?
Two options work today. Neither is an official patch, since n8n has not shipped one.
Option 1: rehydrate memory yourself with Return Intermediate Steps
- Turn on Return Intermediate Steps. Open the AI Agent node's Options panel and enable "Return Intermediate Steps." This adds an
intermediateStepsfield to the node's output containing every tool call and its result. - Turn off streaming while you do this. Enable Streaming and Return Intermediate Steps do not cooperate - the intermediate-steps field only populates when streaming is off (tracked separately as n8n issue #21998).
- Extract the tool data. Wire the agent's output into a Code node that pulls the tool name, input, and result out of
intermediateSteps. - Write it back to memory. Pass that extracted data into a Chat Memory Manager node set to the "Insert Messages" operation, so the tool call and its result get appended to the conversation before the next turn runs.
The catch: the Chat Memory Manager's insert operation only offers AI, System, or User as the message type, not the dedicated tool role that OpenAI, Anthropic, and other providers expect in a proper tool-call history. This stops the model from hallucinating "I never called anything," but it is not a byte-for-byte replacement for native tool_calls persistence - some providers still treat the reinserted message differently than a real tool response.
Option 2: swap in a community Agent node that saves tool calls correctly
The same person who filed #14361 also published n8n-nodes-better-ai-agent on npm (current version 1.6.16) as a drop-in replacement for the stock AI Agent node. It wraps OpenAI, Gemini, and Anthropic through the Vercel AI SDK and stores the tool call and tool result messages in memory the way a native fix would. Install it from n8n's Community Nodes settings panel, or with:
npm i n8n-nodes-better-ai-agentCommunity reports note gaps with Azure OpenAI and Ollama as model providers, so test with your actual provider before replacing every AI Agent node in a production workflow. This is not unique to n8n's packaging either - the same failure family shows up as LangChain's AgentExecutor not calling tools when a raw LangChain agent's own message history falls out of sync with what it actually did.

How do you verify the fix worked?
Run the same multi-turn conversation that triggered the hallucination, then inspect what got saved. For Postgres or Redis memory, query the stored messages directly and confirm a tool-call entry with a non-empty payload sits between the human message and the AI's final answer. For Simple Memory, add a temporary Code node after the Memory node to dump its contents. If the agent still calls the tool correctly on turn five and beyond, instead of confidently answering without checking, the fix is holding.
FAQ
Does this bug affect n8n 2.0, or only the 1.83.2 version in the original report?
It affects the current 2.x line too. Users have confirmed the same empty tool_calls array on n8n 2.0 with Postgres memory, and separately with Redis Chat Memory, so upgrading n8n by itself does not fix it.
Is there an official fix for n8n issue #14361?
Not yet. n8n's AI team acknowledged it as a bug and opened internal ticket GHC-1434 in April 2025, and two community pull requests against it remain open and unmerged as of July 2026.
What is n8n-nodes-better-ai-agent?
A community-maintained npm package that replaces the stock AI Agent node with one that correctly persists tool call and tool result messages to memory, built on the Vercel AI SDK for OpenAI, Gemini, and Anthropic.
Does enabling Return Intermediate Steps work if streaming is also on?
No. The intermediateSteps output field does not populate while "Enable Streaming" is active on the AI Agent node; this is tracked as a separate n8n issue. Turn streaming off to capture the tool-call data.
Which memory node types are affected?
Simple Memory, Postgres memory, and Redis Chat Memory have all been confirmed to drop the tool_calls array on save and load. There is no memory backend in n8n that currently persists it natively.