ReAct Agent
The ReAct agent is an AI agent that can reason over the next action, construct an action command, execute the action, and repeat these steps in an iterative loop until the task is complete.
In this notebook tutorial, we showcase how to write your ReAct agent using the llamaindex
package.
Setup
First, you need to install the llamaindex
package. You can do this by running the following command in your terminal:
pnpm i llamaindex
And then you can import the OpenAIAgent
and FunctionTool
from the llamaindex
package.
import { FunctionTool, OpenAIAgent } from "llamaindex";