Tools AI Agent node#
The Tools Agent uses external tools and APIs to perform actions and retrieve information. It can understand the capabilities of different tools and determine which tool to use depending on the task. This agent helps integrate LLMs with various external services and databases.
This agent has an enhanced ability to work with tools and can ensure a standard output format.
The Tools Agent implements Langchain's tool calling interface. This interface describes available tools and their schemas. The agent also has improved output parsing capabilities, as it passes the parser to the model as a formatting tool.
Refer to AI Agent for more information on the AI Agent node itself.
You can use this agent with the Chat Trigger node. Attach a memory sub-node so that users can have an ongoing conversation with multiple queries. Memory doesn't persist between sessions.
This agent supports the following chat models:
- OpenAI Chat Model
- Groq Chat Model
- Mistral Cloud Chat Model
- Anthropic Chat Model
- Azure OpenAI Chat Model
Node parameters#
Configure the Tools Agent using the following parameters.
Prompt#
Select how you want the node to construct the prompt (also known as the user's query or input from the chat).
Choose from:
- Take from previous node automatically: If you select this option, the node expects an input from a previous node called
chatInput
. - Define below: If you select this option, enter the Text you want to use as the prompt. You can use expressions here for dynamic content.
Require Specific Output Format#
This parameter controls whether you want the node to require a specific output format. When turned on, n8n prompts you to connect one of these output parsers to the node:
Node options#
Refine the Tools Agent node's behavior using these options:
System Message#
If you'd like to send a message to the agent before the conversation starts, enter the message you'd like to send.
Use this option to guide the agent's decision-making.
Max Iterations#
Enter the number of times the model should run to try and generate a good answer from the user's prompt.
Defaults to 10
.
Return Intermediate Steps#
Select whether to include intermediate steps the agent took in the final output (turned on) or not (turned off).
This could be useful for further refining the agent's behavior based on the steps it took.
Automatically Passthrough Binary Images#
Use this option to control whether binary images should be automatically passed through to the agent as image type messages (turned on) or not (turned off).
Templates and examples#
Refer to the main AI Agent node's Templates and examples section.
Common issues#
For common questions or issues and suggested solutions, refer to Common issues.
AI glossary#
- completion: Completions are the responses generated by a model like GPT.
- hallucinations: Hallucination in AI is when an LLM (large language model) mistakenly perceives patterns or objects that don't exist.
- vector database: A vector database stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.
- vector store: A vector store, or vector database, stores mathematical representations of information. Use with embeddings and retrievers to create a database that your AI can access when answering questions.