RAGEN  by RAGEN-AI

Train LLM agents with reinforcement learning in interactive environments

created 6 months ago
2,174 stars

Top 21.2% on sourcepulse

GitHubView on GitHub
Project Summary

RAGEN provides a modular framework for training Large Language Model (LLM) agents in interactive, stochastic environments using reinforcement learning. It addresses challenges in multi-turn interactions and environmental uncertainty, enabling agents to learn complex reasoning and action strategies through trajectory-level optimization.

How It Works

RAGEN utilizes the StarPO (State-Thinking-Actions-Reward Policy Optimization) framework, which alternates between a rollout stage (LLM generates reasoning-guided actions and interacts with the environment) and an update stage (LLM is trained on entire interaction trajectories using importance sampling). This approach optimizes both reasoning and action strategies over multiple turns, offering flexibility in reward assignment and prompt-rollout structures.

Quick Start & Requirements

  • Install via bash scripts/setup_ragen.sh. Manual instructions are available in scripts/setup_ragen.md.
  • Requires Python and potentially specific LLM dependencies.
  • Training involves python train.py --config-name base or python train.py --config-name base-lora for parameter-efficient training.
  • Evaluation can be performed with python -m ragen.llm_agent.agent_proxy --config-name <eval_config>.

Highlighted Details

  • Modular design with Environment Manager, Context Manager, and Agent Proxy for easier environment integration.
  • Supports custom environments compatible with OpenAI Gym.
  • Demonstrates generalization capabilities on Sokoban and FrozenLake environments, showing stable performance with filtered trajectories and no KL divergence penalties.
  • Offers parameter-efficient training with LoRA.

Maintenance & Community

The project is actively updated, with recent refactoring for improved co-development and stability. Feedback is welcomed via GitHub issues. Notable contributors include researchers from multiple institutions.

Licensing & Compatibility

The README does not explicitly state a license. Users should verify licensing for commercial or closed-source use.

Limitations & Caveats

The project is described as a "minimally viable leap forward," suggesting it is research-oriented and may not be production-ready. Specific hardware requirements or LLM compatibility are not detailed.

Health Check
Last commit

3 days ago

Responsiveness

1 week

Pull Requests (30d)
3
Issues (30d)
10
Star History
501 stars in the last 90 days

Explore Similar Projects

Starred by Omar Sanseviero Omar Sanseviero(DevRel at Google DeepMind) and Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems).

LlamaGym by KhoomeiK

0.3%
1k
SDK for fine-tuning LLM agents with online reinforcement learning
created 1 year ago
updated 1 year ago
Feedback? Help us improve.