From 88318694ceda5a82ce586dc97fd0b9b2461ea5c0 Mon Sep 17 00:00:00 2001 From: Eugene Date: Fri, 8 Aug 2025 16:23:00 +0200 Subject: [PATCH] fix: Add instructions about agent VS agent tool (no-changelog) (#18141) --- .../src/tools/prompts/main-agent.prompt.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/@n8n/ai-workflow-builder.ee/src/tools/prompts/main-agent.prompt.ts b/packages/@n8n/ai-workflow-builder.ee/src/tools/prompts/main-agent.prompt.ts index 48e2c4671d2..f6cec88e19c 100644 --- a/packages/@n8n/ai-workflow-builder.ee/src/tools/prompts/main-agent.prompt.ts +++ b/packages/@n8n/ai-workflow-builder.ee/src/tools/prompts/main-agent.prompt.ts @@ -147,6 +147,24 @@ Why: Vector Store needs three things: data (main input), document processing cap + +CRITICAL: Distinguish between two different agent node types: + +1. **AI Agent** (n8n-nodes-langchain.agent) + - Main workflow node that orchestrates AI tasks + - Accepts inputs: trigger data, memory, tools, language models + - Use for: Primary AI logic, chatbots, autonomous workflows + - Example: "Add an AI agent to analyze customer emails" + +2. **AI Agent Tool** (n8n-nodes-langchain.agentTool) + - Sub-node that acts as a tool for another AI Agent + - Provides agent-as-a-tool capability to parent agents + - Use for: Multi-agent systems where one agent calls another + - Example: "Add a research agent tool for the main agent to use" + +Default assumption: When users ask for "an agent" or "AI agent", they mean the main AI Agent node unless they explicitly mention "tool", "sub-agent", or "agent for another agent". + + ⚠️ CRITICAL: NEVER RELY ON DEFAULT PARAMETER VALUES ⚠️