Duplicate and different outputs in AI Agent workflow with tools

Describe the problem/error/question

Hi all.

We are having a problem of duplicity of outputs, when from a workflow with an AI Agent (tool agent), we make a request to other tools, which also incorporate another AI Agent.

From the main workflow, we see that we get 2 outputs in the Postgres Memory node, what seems to be the output of the tool (which is correct), and another output that seems to reinterpret the main AI Agent, which is usually a wrong answer.

We have tried passing the output of the tool to the main workflow in a thousand ways, but we can’t find a way to retrieve that information or to omit the AI Agent from reinterpreting the response.

Any help, please?

What is the error message (if any)?

No apparent errors, just the duplication of answers and the difference between them.

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Main workflow:

Tool sub-workflow:

Share the output returned by the last node

Information on your n8n setup

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

Are you using the same session_id for those chat memories?

In your sub-workflow, try removing the memory node. Tools calls don’t need to be stored in the memory of the chat. Leave it only connected to the main agent.

In most cases the tools should give information to the main AI agent, but shouldn’t be stored as part of the conversation. That can be confusing.

:point_right: If my reply answers your question, please remember to mark it as a solution.

2 Likes

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