A framework for building Natural Language RL Agents.
NOTE โน๏ธ |
---|
This project is currently a proof of concept for a broader framework for using language models as the agent's behavior policy instead of traditional reinforcement learning techniques to power agents. |
Create a virtual environment
python -m venv ~/venvs/langgym
source ~/venvs/langgym/bin/activate
pip install -e .
Export your OpenAI API key:
export OPENAI_API_KEY=...
Run a simulation with
python langgym/simple.py --max-cycles 20 --goal-reward -0.05 --output-dir experiments
Visualize simulations with the streamlit dashboard:
streamlit run langgym/dashboard.py
These are a few ideas to improve the NLRLA (natural-language generative agent):
- ๐ง Memory: Add a text representation of the agent's experiences so far into its internal memory.
- ๐ Summarized Memories: Store an external memory buffer of observations, actions, and rewards, and ask the agent to summarize its experience so far. Add this to the agent's internal memory.
- ๐ญ Strategic Reflection: Ask the agent to create high-level strategies, which are feed into its own prompt when generating an action.
These are items in the roadmap, in no particular order:
- ๐ Support multi-agent
Environment
s in the Multi Particle Environment suite from thePettingZoo
library (see here) - ๐ Support additional environment suites, like Atari, Classic, etc.
- ๐ Create LangGym API for traversing a
Universe
of differentEnvironment
s. Agents can choose which environments they want to play in. - ๐ Create persistent agents that can store internal memories across their
experiences across the different
Environment
s. - ๐ Support use of lighter-weight language models like Alpaca, Pythia, etc.