Skip to content
View ExpeRepair's full-sized avatar

Block or report ExpeRepair

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
ExpeRepair/README.md

ExpeRepair

ExpeRepair is a novel LLM-based program repair framework that continuously accumulates and reuses historical repair experiences via a dual-memory system. It comprises two core components:

  • Program Repair Module: Consists of a Test Agent and a Patch Agent that collaboratively handle three key tasks β€” test generation, patch generation, and patch validation.
  • Memory Module: Captures repair trajectories from the Program Repair Module, extracting concrete demonstrations and summarizing high-level repair strategies. These are stored in episodic memory and semantic memory, respectively. During future repairs, ExpeRepair retrieves relevant demonstrations and insights to enhance its repair strategy for new issues.

πŸš€ Quick Start

Installation

git clone <repository-url>
cd ExpeRepair-v1.0
pip install -r requirements.txt

Environment Setup

Set your API keys as environment variables:

export PYTHONPATH=$PYTHONPATH:$(pwd)
# OpenAI key
export OPENAI_KEY="your-openai-key"
# Anthropic Key
export CLAUDE_KEY="your-anthropic-key"

Following Agentless, ExpeRepair uses a repository structure format to localize suspicious files. You can either preprocess the repositories yourself, or download the prepared data: swebench_lite_repo_structure.zip.

After downloading, unzip and export its location:

export PROJECT_FILE_LOC={folder which you saved}

Finally, set up the testbed by following the instructions from the auto-code-rover project.

Running ExpeRepair on the Full Benchmark

  1. Run run_reproduce_initial.sh with all instance IDs.
  2. Run run_localization.sh with all instance IDs.
  3. For instances where reproduction succeeds (i.e., a valid reproducer_X.py script is generated), run generate_initial.py.
  4. For the remaining instances, run generate_w_memory.py, which leverages the accumulated memory and continues updating it.
  5. Finally, run validation.py and obtain_predictions.py with all instance IDs.

Usage

# reproduce the issue
bash inference/run_reproduce_initial.sh

# localize potential bug locations
bash inference/run_localization.sh

# generate candidate patches
bash inference/run_generate.sh

# validate candidate patches and select the best one
python inference/validation.py

# obtain the prediction results
python inference/obtain_predictions.py

πŸ™ Acknowledgement

Popular repositories Loading

  1. ExpeRepair ExpeRepair Public

    Python 109 14

  2. experiments experiments Public

    Forked from SWE-bench/experiments

    Open sourced predictions, execution logs, trajectories, and results from model inference + evaluation runs on the SWE-bench task.

    Shell