Agent#
The Agent node allows you to set which agent type you want to use.
On this page, you'll find the node parameters for the Agent node, and links to more resources.
Examples and templates
For usage examples and templates to help you get started, refer to n8n's LangChain integrations page.
Conversational Agent parameters#
This agent is optimised for conversation allowing it to chat with the user.
You can use this agent with the On new manual Chat Message node. Attach a memory sub-node so that users can have an ongoing conversation with multiple queries. Memory doesn't persist between sessions.
Text#
The input from the chat. This is the user's query, also known as the prompt.
System message#
Send a message to the agent before the conversation starts. Use this to guide the agent's decision-making.
OpenAI Functions Agent parameters#
The OpenAI Functions Agent node allows you to use an OpenAI functions model. These are models that detect when a function should be called and respond with the inputs that should be passed to the function.
You can use this agent with the On new manual Chat Message node. Attach a memory sub-node so that users can have an ongoing conversation with multiple queries. Memory doesn't persist between sessions.
You must use the OpenAI Chat Model with this agent.
Text#
The input from the chat. This is the user's query, also known as the prompt.
React Agent parameters#
The ReAct Agent node implements ReAct logic. ReAct (reasoning and action) brings together the reasoning powers of chain-of-thought prompting and action plan generation.
No memory
The ReAct agent doesn't support memory sub-nodes. This means it can't recall previous prompts, or simulate an ongoing conversation.
Text#
The input from the chat. This is the user's query, also known as the prompt.
SQL Agent parameters#
The SQL Agent uses a SQL database as a data source. The agent builds a SQL query based on the natural language query in the prompt.
Postgres and MySQL Agents
If you are using Postgres or MySQL this doesn't support the tunnel options you can set in the credential.
Data Source#
Options:
- MySQL
- SQLite
- Postgres
SQLite
To use SQLite you will need to use a Read Binary Files node before the Agent to read your SQLite file.
Prompt#
The query to run on the data.
Options#
Use the options to refine the agent's behavior.
- Ignored Tables
- Include Sample Rows
- Included Tables
- Prefix Prompt
- Suffix Prompt
- Top K
Related resources#
View example workflows and related content on n8n's website.
Refer to LangChain's documentation on agents for more information about the service.
View n8n's LangChain documentation.