Hi! I’m building an AI agent that takes user questions and sends them to OpenAI through the AI Agent node. I’ve configured the prompt manually using “Prompt Type: Define Below” with a clean instruction + chat input.
However, when the AI Agent passes the message to the OpenAI node, I see:
- 355 words are from my actual prompt + user input
- BUT an additional ~2000 words of unrelated data (starting with
"Tool": [{ "searchParameters": ... }]) are appended at the end.
This looks like some kind of auto-generated SERP or memory data. I’m not using external memory or vector store. I don’t want this data in the prompt and don’t understand where it’s coming from or why it’s included.
Questions:
- What is generating this extra “Tool” block?
- How do I prevent it from being included in the message sent to OpenAI?
- Why does it consume tokens if I didn’t explicitly ask for it?
Thanks in advance!
Hee is all garbage text that it generating:
AI:
Tool: [{"searchParameters":{"q":"{{ $json.chatInput }}","type":"search","engine":"google"},"organic":[{"title":"Building Conversational Agent to retrieve certain data - Questions","link":"https://community.n8n.io/t/building-conversational-agent-to-retrieve-certain-data/61807","snippet":"I'm trying to build a custom service chatbot flow, and I want to retrieve the customer's name and birthday through out the conversation.","date":"Nov 14, 2024","position":1},{"title":"Getting AI agent to send data to a workflow tool - n8n Community","link":"https://community.n8n.io/t/getting-ai-agent-to-send-data-to-a-workflow-tool/42078","snippet":"... chat input: {{ $('Chat Trigger').item.json.chatInput }}. Is there a similar way to reference the AI output rather than the chat input? Jon ...","date":"Mar 6, 2024","sitelinks":[{"title":"How to get plain text from chat insted of json?","link":"https://community.n8n.io/t/how-to-get-plain-text-from-chat-insted-of-json/43972"},{"title":"Chat node response with JSON - Questions","link":"https://community.n8n.io/t/chat-node-response-with-json/60646"}],"position":2},{"title":"AI Agent not getting data from json : r/n8n - Reddit","link":"https://www.reddit.com/r/n8n/comments/1jpf7x7/ai_agent_not_getting_data_from_json/","snippet":"I'm new to n8n, I'm building a flow to let AI Agent generate SQL commands from 3 inputs: chat, table schema, and metrics define. All are running locally.","date":"Apr 2, 2025","sitelinks":[{"title":"How to get plain text response from chat instead of Json in n8n?","link":"https://www.reddit.com/r/n8n/comments/1ju4lud/how_to_get_plain_text_response_from_chat_instead/"},{"title":"Teach Your AI to Use n8n Code Node / JS Expressions - Reddit","link":"https://www.reddit.com/r/n8n/comments/1huce7n/teach_your_ai_to_use_n8n_code_node_js_expressions/"}],"position":3},{"title":"RAG & LLM — n8n AI Playground (vol. 3 Chatting with the Data)","link":"https://medium.com/actived/rag-llm-n8n-ai-playground-vol-3-chatting-with-the-data-22402b67b280","snippet":"{{ $json.chatInput }} This is the user's actual question, pulled from a previous chat interface node. Current Workflow ...","date":"Apr 22, 2025","position":4},{"title":"How to take in JSON string as user input using ChatPromptTemplate ...","link":"https://github.com/langchain-ai/langchain/discussions/26845","snippet":"To take in a JSON string as user input using ChatPromptTemplate and MessagesPlaceholder in LangChain, and resolve the errors encountered with ...","date":"Sep 25, 2024","position":5},{"title":"Automate Emails with AI: Building an Email Agent in n8n","link":"https://dev.to/trading_now/automate-emails-with-ai-building-an-email-agent-in-n8n-2ajk","snippet":"Add an AI Agent node from the Advanced AI collection. Prompt Type: Define Below; Text: {{ $json.chatInput }}; Connect this to: Language Model ...","date":"Mar 23, 2025","position":6},{"title":"How do I use the new JSON mode? - API","link":"https://community.openai.com/t/how-do-i-use-the-new-json-mode/475890","snippet":"To use the new JSON mode in the OpenAI API with Python, you would modify your API call to specify the response_format parameter with the value { type: \"json_ ...","date":"Nov 6, 2023","position":7},{"title":"The text in the chatbox changes after switching panels · Issue #12238","link":"https://github.com/n8n-io/n8n/issues/12238","snippet":"... {{ $json.chatInput }}\\nsessionId: {{ $json.sessionId }} and have memory connected. After navigating to Executions tab, we unmount the chat ...","date":"Dec 15, 2024","position":8},{"title":"How to Build an AI-Assisted Workflow in n8n with Human Escalation ...","link":"https://medium.com/@wassenger/how-to-build-an-ai-assisted-workflow-in-n8n-with-human-escalation-using-wassenger-and-slack-ready-13135daae74e","snippet":"- When scalating the message take the info from {{ $('Wassenger ... json.chatInput }}\", \"rightValue\": \"=/([a-zA-Z0-9._-]+@[a-zA-Z0-9._ ...","date":"Jun 27, 2025","position":9},{"title":"N8N Foundational Concepts (AI Agents, JSON, Logic) - YouTube","link":"https://www.youtube.com/watch?v=6b442bN0CyI","snippet":"Join Maker School, start your AI automation agency, & get customer #1 https://www.skool.com/makerschool/about Watch me build my $300K/mo ...","date":"Jan 27, 2025","position":10}],"relatedSearches":[{"query":"Microsoft"},{"query":"N8n chat response"},{"query":"N8n conversational agent"},{"query":"N8n AI Agent"},{"query":"N8n chat UI"},{"query":"N8n chat history"},{"query":"N8n Question and Answer Chain"},{"query":"N8n ai agent output to json"},{"query":"N8n chat node"}],"credits":1}]
Tool: [{"searchParameters":{"q":"{{ $json.chatInput }}","type":"search","engine":"google"},"organic":[{"title":"Building Conversational Agent to retrieve certain data - Questions","link":"https://community.n8n.io/t/building-conversational-agent-to-retrieve-certain-data/61807","snippet":"I'm trying to build a custom service chatbot flow, and I want to retrieve the customer's name and birthday through out the conversation.","date":"Nov 14, 2024","position":1},{"title":"Getting AI agent to send data to a workflow tool - n8n Community","link":"https://community.n8n.io/t/getting-ai-agent-to-send-data-to-a-workflow-tool/42078","snippet":"... chat input: {{ $('Chat Trigger').item.json.chatInput }}. Is there a similar way to reference the AI output rather than the chat input? Jon ...","date":"Mar 6, 2024","sitelinks":[{"title":"How to get plain text from chat insted of json?","link":"https://community.n8n.io/t/how-to-get-plain-text-from-chat-insted-of-json/43972"},{"title":"Chat node response with JSON - Questions","link":"https://community.n8n.io/t/chat-node-response-with-json/60646"}],"position":2},{"title":"AI Agent not getting data from json : r/n8n - Reddit","link":"https://www.reddit.com/r/n8n/comments/1jpf7x7/ai_agent_not_getting_data_from_json/","snippet":"I'm new to n8n, I'm building a flow to let AI Agent generate SQL commands from 3 inputs: chat, table schema, and metrics define. All are running locally.","date":"Apr 2, 2025","sitelinks":[{"title":"How to get plain text response from chat instead of Json in n8n?","link":"https://www.reddit.com/r/n8n/comments/1ju4lud/how_to_get_plain_text_response_from_chat_instead/"},{"title":"Teach Your AI to Use n8n Code Node / JS Expressions - Reddit","link":"https://www.reddit.com/r/n8n/comments/1huce7n/teach_your_ai_to_use_n8n_code_node_js_expressions/"}],"position":3},{"title":"RAG & LLM — n8n AI Playground (vol. 3 Chatting with the Data)","link":"https://medium.com/actived/rag-llm-n8n-ai-playground-vol-3-chatting-with-the-data-22402b67b280","snippet":"{{ $json.chatInput }} This is the user's actual question, pulled from a previous chat interface node. Current Workflow ...","date":"Apr 22, 2025","position":4},{"title":"How to take in JSON string as user input using ChatPromptTemplate ...","link":"https://github.com/langchain-ai/langchain/discussions/26845","snippet":"To take in a JSON string as user input using ChatPromptTemplate and MessagesPlaceholder in LangChain, and resolve the errors encountered with ...","date":"Sep 25, 2024","position":5},{"title":"Automate Emails with AI: Building an Email Agent in n8n","link":"https://dev.to/trading_now/automate-emails-with-ai-building-an-email-agent-in-n8n-2ajk","snippet":"Add an AI Agent node from the Advanced AI collection. Prompt Type: Define Below; Text: {{ $json.chatInput }}; Connect this to: Language Model ...","date":"Mar 23, 2025","position":6},{"title":"How to Build an AI-Assisted Workflow in n8n with Human Escalation ...","link":"https://medium.com/@wassenger/how-to-build-an-ai-assisted-workflow-in-n8n-with-human-escalation-using-wassenger-and-slack-ready-13135daae74e","snippet":"- When scalating the message take the info from {{ $('Wassenger ... json.chatInput }}\", \"rightValue\": \"=/([a-zA-Z0-9._-]+@[a-zA-Z0-9._ ...","date":"Jun 27, 2025","position":7},{"title":"The text in the chatbox changes after switching panels · Issue #12238","link":"https://github.com/n8n-io/n8n/issues/12238","snippet":"... {{ $json.chatInput }}\\nsessionId: {{ $json.sessionId }} and have memory connected. After navigating to Executions tab, we unmount the chat ...","date":"Dec 15, 2024","position":8},{"title":"N8N Foundational Concepts (AI Agents, JSON, Logic) - YouTube","link":"https://www.youtube.com/watch?v=6b442bN0CyI","snippet":"Join Maker School, start your AI automation agency, & get customer #1 https://www.skool.com/makerschool/about Watch me build my $300K/mo ...","date":"Jan 27, 2025","position":9},{"title":"How do I use the new JSON mode? - API","link":"https://community.openai.com/t/how-do-i-use-the-new-json-mode/475890","snippet":"To use the new JSON mode in the OpenAI API with Python, you would modify your API call to specify the response_format parameter with the value { type: \"json_ ...","date":"Nov 6, 2023","position":10}],"relatedSearches":[{"query":"Microsoft"},{"query":"N8n chat response"},{"query":"N8n conversational agent"},{"query":"N8n chat UI"},{"query":"N8n AI Agent"},{"query":"N8n Question and Answer Chain"},{"query":"N8n chat node"},{"query":"N8n chat history"},{"query":"N8n ai agent output to json"}],"credits":1}]
Tool: [{"searchParameters":{"q":"{{ $json.chatInput }}","type":"search","engine":"google"},"organic":[{"title":"Building Conversational Agent to retrieve certain data - Questions","link":"https://community.n8n.io/t/building-conversational-agent-to-retrieve-certain-data/61807","snippet":"I'm trying to build a custom service chatbot flow, and I want to retrieve the customer's name and birthday through out the conversation.","date":"Nov 14, 2024","position":1},{"title":"Getting AI agent to send data to a workflow tool - n8n Community","link":"https://community.n8n.io/t/getting-ai-agent-to-send-data-to-a-workflow-tool/42078","snippet":"... chat input: {{ $('Chat Trigger').item.json.chatInput }}. Is there a similar way to reference the AI output rather than the chat input? Jon ...","date":"Mar 6, 2024","sitelinks":[{"title":"How to get plain text from chat insted of json?","link":"https://community.n8n.io/t/how-to-get-plain-text-from-chat-insted-of-json/43972"},{"title":"Chat node response with JSON - Questions","link":"https://community.n8n.io/t/chat-node-response-with-json/60646"}],"position":2},{"title":"AI Agent not getting data from json : r/n8n - Reddit","link":"https://www.reddit.com/r/n8n/comments/1jpf7x7/ai_agent_not_getting_data_from_json/","snippet":"I'm new to n8n, I'm building a flow to let AI Agent generate SQL commands from 3 inputs: chat, table schema, and metrics define. All are running locally.","date":"Apr 2, 2025","sitelinks":[{"title":"How to get plain text response from chat instead of Json in n8n?","link":"https://www.reddit.com/r/n8n/comments/1ju4lud/how_to_get_plain_text_response_from_chat_instead/"},{"title":"Teach Your AI to Use n8n Code Node / JS Expressions - Reddit","link":"https://www.reddit.com/r/n8n/comments/1huce7n/teach_your_ai_to_use_n8n_code_node_js_expressions/"}],"position":3},{"title":"RAG & LLM — n8n AI Playground (vol. 3 Chatting with the Data)","link":"https://medium.com/actived/rag-llm-n8n-ai-playground-vol-3-chatting-with-the-data-22402b67b280","snippet":"{{ $json.chatInput }} This is the user's actual question, pulled from a previous chat interface node. Current Workflow ...","date":"Apr 22, 2025","position":4},{"title":"How to take in JSON string as user input using ChatPromptTemplate ...","link":"https://github.com/langchain-ai/langchain/discussions/26845","snippet":"To take in a JSON string as user input using ChatPromptTemplate and MessagesPlaceholder in LangChain, and resolve the errors encountered with ...","date":"Sep 25, 2024","position":5},{"title":"How to Build an AI-Assisted Workflow in n8n with Human Escalation ...","link":"https://medium.com/@wassenger/how-to-build-an-ai-assisted-workflow-in-n8n-with-human-escalation-using-wassenger-and-slack-ready-13135daae74e","snippet":"- When scalating the message take the info from {{ $('Wassenger ... json.chatInput }}\", \"rightValue\": \"=/([a-zA-Z0-9._-]+@[a-zA-Z0-9._ ...","date":"Jun 27, 2025","position":6},{"title":"N8N Foundational Concepts (AI Agents, JSON, Logic) - YouTube","link":"https://www.youtube.com/watch?v=6b442bN0CyI","snippet":"Join Maker School, start your AI automation agency, & get customer #1 https://www.skool.com/makerschool/about Watch me build my $300K/mo ...","date":"Jan 27, 2025","position":7},{"title":"How do I use the new JSON mode? - API","link":"https://community.openai.com/t/how-do-i-use-the-new-json-mode/475890","snippet":"To use the new JSON mode in the OpenAI API with Python, you would modify your API call to specify the response_format parameter with the value { type: \"json_ ...","date":"Nov 6, 2023","position":8},{"title":"Prettify json data in textarea input - javascript - Stack Overflow","link":"https://stackoverflow.com/questions/26320525/prettify-json-data-in-textarea-input","snippet":"I'm creating a json data api simulator. I want users to be able to copy and paste a json object request into a textarea where they can also ...","date":"Oct 12, 2014","position":9},{"title":"How to build an AI agent with n8n on Hostinger VPS","link":"https://www.hostinger.com/tutorials/how-to-build-ai-agent-with-n8n","snippet":"The user asks: {{ $json.chatInput }}. Edit Fields node for SerpAPI. Use Memory – You are in an ongoing conversation. Use memory to recall ...","date":"Jun 20, 2025","position":10}],"relatedSearches":[{"query":"n8n chat response"},{"query":"n8n conversational agent"},{"query":"n8n chat ui"},{"query":"n8n ai agent"},{"query":"n8n chat node"},{"query":"n8n chat history"},{"query":"n8n ai agent output to json"},{"query":"n8n question and answer chain"}],"credits":1}]
Tool: [{"searchParameters":{"q":"{{ $json.chatInput }}","type":"search","engine":"google"},"organic":[{"title":"Building Conversational Agent to retrieve certain data - Questions","link":"https://community.n8n.io/t/building-conversational-agent-to-retrieve-certain-data/61807","snippet":"I'm trying to build a custom service chatbot flow, and I want to retrieve the customer's name and birthday through out the conversation.","date":"Nov 14, 2024","position":1},{"title":"Getting AI agent to send data to a workflow tool - n8n Community","link":"https://community.n8n.io/t/getting-ai-agent-to-send-data-to-a-workflow-tool/42078","snippet":"... chat input: {{ $('Chat Trigger').item.json.chatInput }}. Is there a similar way to reference the AI output rather than the chat input? Jon ...","date":"Mar 6, 2024","sitelinks":[{"title":"How to get plain text from chat insted of json?","link":"https://community.n8n.io/t/how-to-get-plain-text-from-chat-insted-of-json/43972"},{"title":"Chat node response with JSON - Questions","link":"https://community.n8n.io/t/chat-node-response-with-json/60646"}],"position":2},{"title":"AI Agent not getting data from json : r/n8n - Reddit","link":"https://www.reddit.com/r/n8n/comments/1jpf7x7/ai_agent_not_getting_data_from_json/","snippet":"I'm new to n8n, I'm building a flow to let AI Agent generate SQL commands from 3 inputs: chat, table schema, and metrics define. All are running locally.","date":"Apr 2, 2025","sitelinks":[{"title":"How to get plain text response from chat instead of Json in n8n?","link":"https://www.reddit.com/r/n8n/comments/1ju4lud/how_to_get_plain_text_response_from_chat_instead/"},{"title":"Teach Your AI to Use n8n Code Node / JS Expressions - Reddit","link":"https://www.reddit.com/r/n8n/comments/1huce7n/teach_your_ai_to_use_n8n_code_node_js_expressions/"}],"position":3},{"title":"RAG & LLM — n8n AI Playground (vol. 3 Chatting with the Data)","link":"https://medium.com/actived/rag-llm-n8n-ai-playground-vol-3-chatting-with-the-data-22402b67b280","snippet":"{{ $json.chatInput }} This is the user's actual question, pulled from a previous chat interface node. Current Workflow ...","date":"Apr 22, 2025","position":4},{"title":"How to take in JSON string as user input using ChatPromptTemplate ...","link":"https://github.com/langchain-ai/langchain/discussions/26845","snippet":"To take in a JSON string as user input using ChatPromptTemplate and MessagesPlaceholder in LangChain, and resolve the errors encountered with ...","date":"Sep 25, 2024","position":5},{"title":"Automate Emails with AI: Building an Email Agent in n8n","link":"https://dev.to/trading_now/automate-emails-with-ai-building-an-email-agent-in-n8n-2ajk","snippet":"Add an AI Agent node from the Advanced AI collection. Prompt Type: Define Below; Text: {{ $json.chatInput }}; Connect this to: Language Model ...","date":"Mar 23, 2025","position":6},{"title":"How to Build an AI-Assisted Workflow in n8n with Human Escalation ...","link":"https://medium.com/@wassenger/how-to-build-an-ai-assisted-workflow-in-n8n-with-human-escalation-using-wassenger-and-slack-ready-13135daae74e","snippet":"- When scalating the message take the info from {{ $('Wassenger ... json.chatInput }}\", \"rightValue\": \"=/([a-zA-Z0-9._-]+@[a-zA-Z0-9._ ...","date":"Jun 27, 2025","position":7},{"title":"The text in the chatbox changes after switching panels · Issue #12238","link":"https://github.com/n8n-io/n8n/issues/12238","snippet":"... {{ $json.chatInput }}\\nsessionId: {{ $json.sessionId }} and have memory connected. After navigating to Executions tab, we unmount the chat ...","date":"Dec 15, 2024","position":8},{"title":"N8N Foundational Concepts (AI Agents, JSON, Logic) - YouTube","link":"https://www.youtube.com/watch?v=6b442bN0CyI","snippet":"Join Maker School, start your AI automation agency, & get customer #1 https://www.skool.com/makerschool/about Watch me build my $300K/mo ...","date":"Jan 27, 2025","position":9},{"title":"How do I use the new JSON mode? - API","link":"https://community.openai.com/t/how-do-i-use-the-new-json-mode/475890","snippet":"To use the new JSON mode in the OpenAI API with Python, you would modify your API call to specify the response_format parameter with the value { type: \"json_ ...","date":"Nov 6, 2023","position":10}],"relatedSearches":[{"query":"Microsoft"},{"query":"N8n chat response"},{"query":"N8n conversational agent"},{"query":"N8n chat UI"},{"query":"N8n AI Agent"},{"query":"N8n chat node"},{"query":"N8n Question and Answer Chain"},{"query":"N8n chat history"},{"query":"N8n ai agent output to json"}],"credits":1}]
Tool: [{"searchParameters":{"q":"{{ $json.chatInput }}","type":"search","engine":"google"},"organic":[{"title":"Building Conversational Agent to retrieve certain data - Questions","link":"https://community.n8n.io/t/building-conversational-agent-to-retrieve-certain-data/61807","snippet":"I'm trying to build a custom service chatbot flow, and I want to retrieve the customer's name and birthday through out the conversation.","date":"Nov 14, 2024","position":1},{"title":"Getting AI agent to send data to a workflow tool - n8n Community","link":"https://community.n8n.io/t/getting-ai-agent-to-send-data-to-a-workflow-tool/42078","snippet":"... chat input: {{ $('Chat Trigger').item.json.chatInput }}. Is there a similar way to reference the AI output rather than the chat input? Jon ...","date":"Mar 6, 2024","sitelinks":[{"title":"How to get plain text from chat insted of json?","link":"https://community.n8n.io/t/how-to-get-plain-text-from-chat-insted-of-json/43972"},{"title":"Chat node response with JSON - Questions","link":"https://community.n8n.io/t/chat-node-response-with-json/60646"}],"position":2},{"title":"AI Agent not getting data from json : r/n8n - Reddit","link":"https://www.reddit.com/r/n8n/comments/1jpf7x7/ai_agent_not_getting_data_from_json/","snippet":"I'm new to n8n, I'm building a flow to let AI Agent generate SQL commands from 3 inputs: chat, table schema, and metrics define. All are running locally.","date":"Apr 2, 2025","sitelinks":[{"title":"How to get plain text response from chat instead of Json in n8n?","link":"https://www.reddit.com/r/n8n/comments/1ju4lud/how_to_get_plain_text_response_from_chat_instead/"},{"title":"Teach Your AI to Use n8n Code Node / JS Expressions - Reddit","link":"https://www.reddit.com/r/n8n/comments/1huce7n/teach_your_ai_to_use_n8n_code_node_js_expressions/"}],"position":3},{"title":"RAG & LLM — n8n AI Playground (vol. 3 Chatting with the Data)","link":"https://medium.com/actived/rag-llm-n8n-ai-playground-vol-3-chatting-with-the-data-22402b67b280","snippet":"{{ $json.chatInput }} This is the user's actual question, pulled from a previous chat interface node. Current Workflow ...","date":"Apr 22, 2025","position":4},{"title":"How to take in JSON string as user input using ChatPromptTemplate ...","link":"https://github.com/langchain-ai/langchain/discussions/26845","snippet":"To take in a JSON string as user input using ChatPromptTemplate and MessagesPlaceholder in LangChain, and resolve the errors encountered with ...","date":"Sep 25, 2024","position":5},{"title":"How to Build an AI-Assisted Workflow in n8n with Human Escalation ...","link":"https://medium.com/@wassenger/how-to-build-an-ai-assisted-workflow-in-n8n-with-human-escalation-using-wassenger-and-slack-ready-13135daae74e","snippet":"- When scalating the message take the info from {{ $('Wassenger ... json.chatInput }}\", \"rightValue\": \"=/([a-zA-Z0-9._-]+@[a-zA-Z0-9._ ...","date":"Jun 27, 2025","position":6},{"title":"Automate Emails with AI: Building an Email Agent in n8n","link":"https://dev.to/trading_now/automate-emails-with-ai-building-an-email-agent-in-n8n-2ajk","snippet":"Add an AI Agent node from the Advanced AI collection. Prompt Type: Define Below; Text: {{ $json.chatInput }}; Connect this to: Language Model ...","date":"Mar 23, 2025","position":7},{"title":"The text in the chatbox changes after switching panels · Issue #12238","link":"https://github.com/n8n-io/n8n/issues/12238","snippet":"... {{ $json.chatInput }}\\nsessionId: {{ $json.sessionId }} and have memory connected. After navigating to Executions tab, we unmount the chat ...","date":"Dec 15, 2024","position":8},{"title":"N8N Foundational Concepts (AI Agents, JSON, Logic) - YouTube","link":"https://www.youtube.com/watch?v=6b442bN0CyI","snippet":"Join Maker School, start your AI automation agency, & get customer #1 https://www.skool.com/makerschool/about Watch me build my $300K/mo ...","date":"Jan 27, 2025","position":9},{"title":"How do I use the new JSON mode? - API","link":"https://community.openai.com/t/how-do-i-use-the-new-json-mode/475890","snippet":"To use the new JSON mode in the OpenAI API with Python, you would modify your API call to specify the response_format parameter with the value { type: \"json_ ...","date":"Nov 6, 2023","position":10}],"relatedSearches":[{"query":"Microsoft"},{"query":"N8n chat response"},{"query":"N8n conversational agent"},{"query":"N8n chat UI"},{"query":"N8n AI Agent"},{"query":"N8n chat node"},{"query":"N8n Question and Answer Chain"},{"query":"N8n chat history"},{"query":"N8n ai agent output to json"}],"credits":1}]



