ReCode  by FoundationAgents

LLM agent framework for unified planning and action via recursive code

Created 2 months ago
525 stars

Top 60.0% on SourcePulse

GitHubView on GitHub
Project Summary

ReCode revolutionizes LLM agents by unifying planning and action via recursive code generation, enabling adaptive, human-like decision-making. It targets researchers and developers seeking universal granularity control, allowing agents to dynamically decompose complex tasks from high-level strategies into executable code primitives. This approach yields significant performance gains and superior data efficiency.

How It Works

The system employs a divide-and-conquer strategy, organizing partial programs in a tree structure where each node represents a sub-task. LLMs recursively expand placeholder functions into specific calls or subroutines using environment-specific prompts and few-shot examples. A dynamic execution loop immediately runs each node, with fresh observations guiding further expansion, retries, or completion. A constrained Python executor manages shared state, validates code, and exposes tools, facilitating robust, adaptive execution from strategic planning to concrete actions.

Quick Start & Requirements

Setup requires Python 3.10+ within a conda environment; separate environments are advised for ALFWorld, ScienceWorld, and WebShop due to potential conflicts. Key steps include:

  • Creating/activating a conda environment (e.g., conda create -n recode-envname python=3.10).
  • Configuring environment-specific assets (ALFWorld data, WebShop setup.sh, pip install -e ., conda install openjdk=11, pip install en_core_web_lg).
  • Setting up LLM access via configs/profiles.yaml.
  • Running evaluations with python run.py (e.g., python run.py -a recode -e alfworld -n 1 --profile default). Prerequisites include specific dataset paths and LLM API access.

Highlighted Details

  • ReCode achieved significant performance improvements across ALFWorld, WebShop, and ScienceWorld, outperforming baselines by 20.9% on average.
  • It reached a perfect 100 score in ALFWorld using claude-4-sonnet.
  • Supervised fine-tuning (SFT) demonstrated exceptional data efficiency, with ReCode+SFT outperforming ReAct+SFT and CodeAct+SFT.

Maintenance & Community

Contact zhaoyangyu713@gmail.com for technical assistance. No community channels (Discord, Slack) or public roadmap are listed.

Licensing & Compatibility

The README omits a software license, preventing an assessment of its compatibility for commercial use or integration into closed-source projects.

Limitations & Caveats

Users may face dependency conflicts between environments, requiring separate conda installations. The WebShop requirements.txt might be incomplete, potentially necessitating direct contact with the maintainer. The absence of a stated license is a significant adoption blocker.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind).

ROMA by sentient-agi

1.6%
5k
A meta-agent framework for building hierarchical multi-agent systems
Created 8 months ago
Updated 1 month ago
Feedback? Help us improve.