How do I configure the Conversation agent node?#
An agent is used to extend the functionality of a Large Language Model or Chat Model with the use of additional nodes such as triggers, retrievers, loaders and output parsers. Agent nodes are distinct from Chain nodes in that they automatically determine the correct attached node to use for a given user input.
The Conversation agent is optimized for end-user conversation, and takes inputs from an attached chat node and chooses the appropriate model, memory or tool node to form its response.
Before you begin#
- Learn about pathways
- Learn about pathway nodes
- Learn about agents
- Learn about Large Language Models
- Add a pathway
Step 1 - add the node#
- Click + to open the nodes panel
- Search for Agent in the node search field.
- Click Ai Agent to open the node editor
- Choose Conversation agent from the Agent field.
Step 2 - choose how to handle prompts#
Prompt | Description | Additional information |
---|---|---|
Take from previous node automatically | Looks for chatInput parameter supplied by the preceding node |
Execute previous nodes to load input data |
Define below | Define JSON parameters that will be sent to a child node such as a Model, Operator, Memory or Tool. These should be defined based on the outputs from a preceding node in the pathway | Execute previous nodes to load input data |
Step 3 - Add optional output parser#
- Toggle Require specific output format so you can add an Output Parser node to the agent once you've completed initial configuration.
Step 4 - Add optional messages#
There are three ways to add parameters to Fixed or Expression fields in a given node:
Method | Description | Additional information |
---|---|---|
Load from previous nodes | Click Execute previous nodes in the Input panel to load parameters from connected and configured nodes | Not available for Triggers |
Add a fixed value | Click Fixed on available fields to enter plain-text or JSON values | Learn how to edit fixed responses |
Add a JSON expression | Click Expression on available fields to enter a JSON expression | Learn how to edit expressions |
Note
The Expression editor loads all possible parameters from connected nodes. These can then be added to fields as required
Add a plain-text message or expression for the user or the agent:
Optional | Description | Required |
---|---|---|
Human message | Add or edit text used by the connected model to interpret input from end users. | Required parameters |
System message | Add or edit text used by the connected model to interpret and assemble output returned to the end user |
Required message parameters#
The following parameters are required for the Human message field:
Parameter | Description |
---|---|
{tools} |
Provides a string containing any tool nodes connected to the agent |
{format_instructions} |
Provides the schema or format from the output parser node you've connected. |
{{ input }} |
The user's prompt. Populated with the value of the Text parameter. |
Step 5 - Add additional options#
Optional | Description |
---|---|
Max iterations | Number of times the attached model should attempt to generate an answer to the user message |
Return intermediate steps | Steps made by the attached model to generate output are sent to the Chat dialog for the user to check |
Next step#
Link the Agent to child nodes: