This repository contains the implementation of the ReActXen framework, focused on agent-based design and interaction.
It has been referred to as ReAct++, Enhanced ReAct, etc.
π Tutorial PDF
Our work has been accepted at EMNLP 2025 Industry Track π
ReAct Meets Industrial IoT: Language Agents for Data Access
James T. Rayfield, Shuxin Lin, Nianjun Zhou, Dhaval C. Patel
π Read the Paper (OpenReview PDF)
If you use this work, please cite:
@inproceedings{patel2025react,
title = {ReAct Meets Industrial IoT: Language Agents for Data Access},
author = {James T. Rayfield and Shuxin Lin and Nianjun Zhou and Dhaval C. Patel},
booktitle = {Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing: Industry Track},
year = {2025},
url = {https://openreview.net/forum?id=luETrQw0j6}
}The ReActXen framework is built on the Agent-Family that has multiple helper agents as outlined in the following diagram. The ReAct agent supports both text generation and code generation based on the specified action.
- Project Setup Instructions
- Setting Up the LLM
- Getting Ready to use ReActXen
- Hello Word ReActXen
- API Functions
- Publications
To get started with this project, follow these steps:
-
Clone the repository:
git clone git@github.ibm.com:GenAIApps/ReActXen.git cd reactxen -
Set up a Python virtual environment (Python 3.11 or greater is required):
python3.11 -m venv reactxen source reactxen/bin/activate # On macOS/Linux # .\\reactxen\\Scripts\\activate # On Windows
-
Install the required dependencies: Simply run the following command to install the package and its dependencies:
pip install . -
If you need to clean or remove the Python virtual environment (
reactxen), follow these steps:deactivate rm -rf reactxen
-
Setting Up Environment Variables. Copy the
.env_templatefile to.env:cp env/.env_template .env
-
Edit the .env file and replace the placeholders with your actual values:
WATSONX_APIKEY=your_watsonx_apikey WATSONX_URL=https://your-watsonx-url.com WATSONX_PROJECT_ID=your_project_id
In the hello_world_math.py demo, the ReActXen framework is used to solve the following mathematical equation:
Question: Find the (r) that satisfies the equation:
[ \log_{16} (r+16) = \frac{5}{4} ]
The question asks the agent to find the value of (r) that satisfies the logarithmic equation.
-
Execute the demo script (id 15 = granite 3.2, ibm/granite-3-2-8b-instruct)
cd src/reactxen/demo python hello_world_math.py --mode code --model_id 15 # for code model python hello_world_math.py --mode text --model_id 15 # for text model
-
create_reactxen_agent
Description: Initializes and configures a ReActXen agent.
Example Usage:agent = create_reactxen_agent(question="Find the r...", key="", ...)
-
run_reactxen_agentDescription: Runs the agent and returns the result. Example Usage:agent.run()
You can view the review agent output here: Review
-
export_benchmark_metricDescription: Exports benchmark metrics from the agent's run. Example Usage:agent.export_benchmark_metric()
You can view the benchmark metric here: Benchmark
-
export_trajectoryDescription: Exports the trajectory of the agent's decisions. Example Usage:agent.export_trajectory()
You can view the sample exported trajectory here: Trajectory
