MEnvAgent: Scalable Polyglot Environment Construction for Verifiable Software Engineering
Official implementation of MEnvAgent, an automated framework for constructing executable environments across 10 programming languages to enable scalable generation of verifiable software engineering data.
MEnvAgent employs a multi-agent system structured into three iterative stages:
Overview of MEnvAgent: (Top) Environment Reuse Mechanism retrieves and adapts historical environments. (Bottom) Planning-Execution-Verification loop with autonomous agents.
Instead of building environments from scratch, MEnvAgent:
MEnvBench is a comprehensive benchmark for evaluating multi-language environment building and test execution, comprising 1,000 tasks (10 languages × 20 repositories × 5 instances) selected from 200 high-quality open-source repositories.
We evaluate performance across two critical dimensions: success rate and efficiency. As shown in the visualizations below, MEnvAgent consistently occupies the top-left corner, achieving the best balance of being both faster and more accurate ("better & faster").
![]() | ![]() |
|---|---|
| Fail-to-Pass (F2P) vs. Time | Pass Rate vs. Time |
Compared to state-of-the-art baselines, MEnvAgent delivers:
| Field | Type | Description |
|---|---|---|
| repo | str | The full GitHub repository name (e.g., "home-assistant/core"). |
| pull_number | int | The pull request number associated with the fix (e.g., 807). |
| instance_id | str | A unique identifier for the task instance (e.g., "home-assistant__core-807"). |
| issue_numbers | list | A list of linked issue numbers (e.g., [103876]). |
| base_commit | str | The commit SHA of the repository prior to the fix. |
| version | str | The version of the dataset (e.g., "0.10"). |
| patch | str | The ground-truth patch (git diff) that resolves the issue. |
| test_patch | str | The test patch (git diff) containing new tests to reproduce the issue. |
| problem_statement | str | The natural language description of the issue. |
| hints_text | str | Hints extracted from the issue discussion to aid resolution. |
| all_hints_text | str | Comprehensive context including all comments and code review details. |
| commit_urls | list | A list of URLs pointing to the relevant commits. |
| created_at | str | The creation timestamp (e.g., "2015-12-27T19:33:55Z"). |
| language | str | The programming language of the repository (e.g., "Python"). |
We release MEnvData, a high-quality polyglot SWE dataset comprising 3,005 task instances from 942 repositories across 10 programming languages:
log_parser logic.🤗 Hugging Face Dataset: https://huggingface.co/datasets/ernie-research/MEnvData-SWE
# Load the dataset using Hugging Face
from datasets import load_dataset
# MEnvData-SWE
dataset = load_dataset("ernie-research/MEnvData-SWE")
# MEnvData-SWE-Trajectory
dataset = load_dataset("ernie-research/MEnvData-SWE-Trajectory")
MEnvData-SWE extends the standard schema with executable environment configurations. Each instance contains the following fields:
| Field | Type | Description |
|---|---|---|
| repo | str | The full GitHub repository name (e.g., "home-assistant/core"). |
| pull_number | int | The pull request number associated with the fix. |
| instance_id | str | A unique identifier for the task instance. |
| issue_numbers | list | A list of linked issue numbers. |
| base_commit | str | The commit SHA of the repository prior to the fix. |
| version | str | The version of the dataset. |
| patch | str | The ground-truth patch (git diff) that resolves the issue. |
| test_patch | str | The test patch (git diff) containing new tests to reproduce the issue. |
| problem_statement | str | The natural language description of the issue. |
| hints_text | str | Hints extracted from the issue discussion. |
| all_hints_text | str | Comprehensive context including all comments and reviews. |
| commit_urls | list | A list of URLs pointing to the relevant commits. |
| created_at | str | The creation timestamp (e.g., "2015-12-27T19:33:55Z"). |
| language | str | The programming language (e.g., "Python"). |
| env_setup_script | str | Incremental bash commands used to configure the environment (for reuse scenarios). |
| original_env_setup_script | str | The foundational setup commands. Represents the reused base image's setup or the full build script if built from scratch. |
| eval_script | str | The complete verification script that applies the test_patch and executes the test commands. |
| image_name | str | The specific Docker image name/tag available for this instance. |
Note: We are actively expanding MEnvData-SWE with additional repositories and task instances. Stay tuned for potential future releases.
git clone https://github.com/your-org/MEnvAgent.git
cd MEnvAgent
conda create --name menvagent python=3.10 -y
conda activate menvagent
pip install -r requirements.txt
# Set your LLM API configuration
export OPENAI_API_BASE_URL=<your_base_url>
export OPENAI_KEY=<your_api_key>
# (Optional) Configure proxy settings if needed
export http_proxy="http://your-proxy:port"
export https_proxy="http://your-proxy:port"
export no_proxy="localhost,127.0.0.1"
If MEnvAgent helps your research or projects, please cite our paper:
@misc{guo2026menvagent,
title={MEnvAgent: Scalable Polyglot Environment Construction for Verifiable Software Engineering},
author={Chuanzhe Guo and Jingjing Wu and Sijun He and Yang Chen and Zhaoqi Kuang and Shilong Fan and Bingjin Chen and Siqi Bao and Jing Liu and Hua Wu and Qingfu Zhu and Wanxiang Che and Haifeng Wang},
year={2026},
url={https://arxiv.org/abs/2601.22859},
}
MEnvAgent builds upon foundational work in software engineering and LLM agents:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For questions, issues, or collaborations, please:
Python
93.0%
Shell
7.0%
MEnvAgent: Scalable Polyglot Environment Construction for Verifiable Software Engineering
Official implementation of MEnvAgent, an automated framework for constructing executable environments across 10 programming languages to enable scalable generation of verifiable software engineering data.
MEnvAgent employs a multi-agent system structured into three iterative stages:
Overview of MEnvAgent: (Top) Environment Reuse Mechanism retrieves and adapts historical environments. (Bottom) Planning-Execution-Verification loop with autonomous agents.
Instead of building environments from scratch, MEnvAgent:
MEnvBench is a comprehensive benchmark for evaluating multi-language environment building and test execution, comprising 1,000 tasks (10 languages × 20 repositories × 5 instances) selected from 200 high-quality open-source repositories.
We evaluate performance across two critical dimensions: success rate and efficiency. As shown in the visualizations below, MEnvAgent consistently occupies the top-left corner, achieving the best balance of being both faster and more accurate ("better & faster").
![]() | ![]() |
|---|---|
| Fail-to-Pass (F2P) vs. Time | Pass Rate vs. Time |
Compared to state-of-the-art baselines, MEnvAgent delivers:
| Field | Type | Description |
|---|---|---|
| repo | str | The full GitHub repository name (e.g., "home-assistant/core"). |
| pull_number | int | The pull request number associated with the fix (e.g., 807). |
| instance_id | str | A unique identifier for the task instance (e.g., "home-assistant__core-807"). |
| issue_numbers | list | A list of linked issue numbers (e.g., [103876]). |
| base_commit | str | The commit SHA of the repository prior to the fix. |
| version | str | The version of the dataset (e.g., "0.10"). |
| patch | str | The ground-truth patch (git diff) that resolves the issue. |
| test_patch | str | The test patch (git diff) containing new tests to reproduce the issue. |
| problem_statement | str | The natural language description of the issue. |
| hints_text | str | Hints extracted from the issue discussion to aid resolution. |
| all_hints_text | str | Comprehensive context including all comments and code review details. |
| commit_urls | list | A list of URLs pointing to the relevant commits. |
| created_at | str | The creation timestamp (e.g., "2015-12-27T19:33:55Z"). |
| language | str | The programming language of the repository (e.g., "Python"). |
We release MEnvData, a high-quality polyglot SWE dataset comprising 3,005 task instances from 942 repositories across 10 programming languages:
log_parser logic.🤗 Hugging Face Dataset: https://huggingface.co/datasets/ernie-research/MEnvData-SWE
# Load the dataset using Hugging Face
from datasets import load_dataset
# MEnvData-SWE
dataset = load_dataset("ernie-research/MEnvData-SWE")
# MEnvData-SWE-Trajectory
dataset = load_dataset("ernie-research/MEnvData-SWE-Trajectory")
MEnvData-SWE extends the standard schema with executable environment configurations. Each instance contains the following fields:
| Field | Type | Description |
|---|---|---|
| repo | str | The full GitHub repository name (e.g., "home-assistant/core"). |
| pull_number | int | The pull request number associated with the fix. |
| instance_id | str | A unique identifier for the task instance. |
| issue_numbers | list | A list of linked issue numbers. |
| base_commit | str | The commit SHA of the repository prior to the fix. |
| version | str | The version of the dataset. |
| patch | str | The ground-truth patch (git diff) that resolves the issue. |
| test_patch | str | The test patch (git diff) containing new tests to reproduce the issue. |
| problem_statement | str | The natural language description of the issue. |
| hints_text | str | Hints extracted from the issue discussion. |
| all_hints_text | str | Comprehensive context including all comments and reviews. |
| commit_urls | list | A list of URLs pointing to the relevant commits. |
| created_at | str | The creation timestamp (e.g., "2015-12-27T19:33:55Z"). |
| language | str | The programming language (e.g., "Python"). |
| env_setup_script | str | Incremental bash commands used to configure the environment (for reuse scenarios). |
| original_env_setup_script | str | The foundational setup commands. Represents the reused base image's setup or the full build script if built from scratch. |
| eval_script | str | The complete verification script that applies the test_patch and executes the test commands. |
| image_name | str | The specific Docker image name/tag available for this instance. |
Note: We are actively expanding MEnvData-SWE with additional repositories and task instances. Stay tuned for potential future releases.
git clone https://github.com/your-org/MEnvAgent.git
cd MEnvAgent
conda create --name menvagent python=3.10 -y
conda activate menvagent
pip install -r requirements.txt
# Set your LLM API configuration
export OPENAI_API_BASE_URL=<your_base_url>
export OPENAI_KEY=<your_api_key>
# (Optional) Configure proxy settings if needed
export http_proxy="http://your-proxy:port"
export https_proxy="http://your-proxy:port"
export no_proxy="localhost,127.0.0.1"
If MEnvAgent helps your research or projects, please cite our paper:
@misc{guo2026menvagent,
title={MEnvAgent: Scalable Polyglot Environment Construction for Verifiable Software Engineering},
author={Chuanzhe Guo and Jingjing Wu and Sijun He and Yang Chen and Zhaoqi Kuang and Shilong Fan and Bingjin Chen and Siqi Bao and Jing Liu and Hua Wu and Qingfu Zhu and Wanxiang Che and Haifeng Wang},
year={2026},
url={https://arxiv.org/abs/2601.22859},
}
MEnvAgent builds upon foundational work in software engineering and LLM agents:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For questions, issues, or collaborations, please:
Python
93.0%
Shell
7.0%