How do I configure the ReAct 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.
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 ReAct 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
Option | Description | Required |
---|---|---|
Human message | Add or edit text used by the connected model to interpret input from end users. | Required parameters |
Prefix message | String to insert before the list of tools | |
Suffix message for chat model | Instruction for connected chat model | Includes the user input and agent scratchpad |
Suffix message for Large Language Model | Instruction for connected Large Language Model | Required parameters |
Required message parameters#
Parameter | Description |
---|---|
{input} |
User input |
{agent_scratchpad} |
Data to retain for next iteration of chat trigger dialog to ReAct Agent |
Step 5 - Add optional steps#
Option | Description | Required |
---|---|---|
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: