Reflexion is a Python project for language agents using verbal reinforcement learning, with multiple notebooks and run directions for HotPotQA reasoning and AlfWorld decision-making. It includes setup steps and environment variable guidance, plus notes on experiments and related resources.
Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).
What it is
Reflexion: Language Agents with Verbal Reinforcement Learning is a codebase with notebooks and logs for experiments described by the authors (NeurIPS 2023). It provides examples and directions to run reasoning experiments on HotPotQA and decision-making experiments on AlfWorld.
How it works
The repository contains notebooks and scripts to run agents of different types (ReAct, CoT_context, CoT_no_context) with various reflexion strategies (NONE, LAST_ATTEMPT, REFLEXION, LAST_ATTEMPT_AND_REFLEXION). It separates experiments into HotPotQA reasoning runs and AlfWorld decision-making runs, with logs stored under specific run directories.
Getting started
To get started, clone the repository and navigate to the relevant directory:
git clone https://github.com/noahshinn/reflexion && cd ./hotpotqa_runs
Install dependencies:
pip install -r requirements.txt
Set the OpenAI API key:
export OPENAI_API_KEY=<your key>
Agent types available:
ReAct- ReAct AgentCoT_context- CoT Agent given supporting context about the questionCoT_no_context- CoT Agent given no supporting context about the question
Reflexion strategies are defined in an Enum and include:
ReflexionStrategy.NONEReflexionStrategy.LAST_ATTEMPTReflexionStrategy.REFLEXIONReflexionStrategy.LAST_ATTEMPT_AND_REFLEXION
For AlfWorld, run instructions are provided in a separate directory and script:
git clone https://github.com/noahshinn/reflexion && cd ./alfworld_runs
./run_reflexion.sh
The logs will be sent to ./root/<run_name>.
Other notes
The README references related materials and sources:
- Original implementation and blog posts linked in the text
- Citations and contact information are provided
Getting updates
Latest releases show no versioned releases in the list.
Traction
Stars: 3221 Forks: 314 Open issues: 24
Caveats
License: MIT Created: 2023-03-22 Last push: 2025-01-14 Language: Python






