reflexion  by noahshinn

Language agent research paper using verbal reinforcement learning

Created 2 years ago
2,864 stars

Top 16.6% on SourcePulse

GitHubView on GitHub
Project Summary

Reflexion provides a framework for language agents that learn from their mistakes through verbal reinforcement learning, enhancing performance on complex reasoning and decision-making tasks. It is targeted at AI researchers and developers building advanced language agents.

How It Works

Reflexion agents augment standard language models with a mechanism for self-reflection and memory. After an initial attempt, the agent generates a "reflection" on its errors, which is then incorporated as context for subsequent attempts. This iterative process allows the agent to learn from past failures and improve its strategy over time, mimicking human learning.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt (within hotpotqa_runs or alfworld_runs directories).
  • Set OPENAI_API_KEY environment variable.
  • For decision-making tasks, run ./run_reflexion.sh after configuring run_reflexion.sh.
  • For reasoning tasks, run notebooks in ./hotpotqa_runs/notebooks/.
  • Requires Python and OpenAI API access (GPT-4 recommended).

Highlighted Details

  • Implements ReAct, CoT (with/without context) agent types.
  • Supports multiple reflection strategies: NONE, LAST_ATTEMPT, REFLEXION, LAST_ATTEMPT_AND_REFLEXION.
  • Includes pre-computed logs for reasoning (HotPotQA), decision-making (AlfWorld), and programming tasks.

Maintenance & Community

Licensing & Compatibility

  • License not explicitly stated in the README.
  • Requires OpenAI API, which has its own terms of service and costs.

Limitations & Caveats

Rerunning experiments may be infeasible for individual developers due to GPT-4 access limitations and significant API costs. The project focuses on specific benchmarks and may require adaptation for other tasks.

Health Check
Last Commit

8 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
35 stars in the last 30 days

Explore Similar Projects

Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research) and Will Brown Will Brown(Research Lead at Prime Intellect).

agent-lightning by microsoft

6.0%
2k
Train any AI agent with rollouts and feedback
Created 3 months ago
Updated 2 days ago
Feedback? Help us improve.