Unexplained Pattern in n8n RAG Agent

Desperate for help here! My n8n RAG agent, running locally on Docker with GPT-4o-mini, is exhibiting a bizarre behavior. Every 7th user query, it inexplicably skips tool calls and responds based on memory instead. This pattern persists even after resetting the memory session. Has anyone encountered a similar issue or have insights on what might be causing this? The agent is configured with three tools and should ideally call all of them for each query. Any assistance would be greatly appreciated!

I am currently on a self hosted account, if you can tell me what configuration or how to do that it would be helpful.

This is the workflow

So here you can see when I reached 7 queries it directly responded before it was working fine

There have been other reports in deterministic Nth+ interactions skipping tools, especially for GPT 4o mini. I would test to verify if this is a model issue or a sub-node issue:

  • Reproduce with a minimal agent: one trivial tool, no memory, GPT‑4o‑mini; send 7 consecutive turns and confirm whether the pattern disappears without memory/sub-nodes.
  • Add only Postgres Chat Memory and retest; if the issue reappears, note the turn on which tools stop and whether tool_calls is empty in execution data.
  • Go back to full setup, remove the Think tool and retest;
  • Switch the model to GPT‑4o or GPT‑4 Turbo and retest

Basically test step by step so you can find which setups are working (if any) and which fail on the 7th try, by gradually adding more sub-nodes.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.