KGCompass is a novel approach for repository-level software repair that accurately links code structure with repository metadata using a knowledge graph, enabling more precise bug localization and patch generation.
Paper link: https://arxiv.org/abs/2503.21710
This project uses Docker and Docker Compose to provide a fully reproducible environment. The setup includes:
- A base image with CUDA and Python pre-installed.
- A service for the Neo4j database with necessary plugins.
- An application service with all Python dependencies and access to the host's GPU.
- NVIDIA GPU & Drivers: A compatible NVIDIA GPU with recent drivers installed on your host machine.
- NVIDIA Container Toolkit: You must install this on your host to allow Docker to use the GPU. For Debian/Ubuntu-based systems, you can do so by running the following command block in your terminal:
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list \ && sudo apt-get update \ && sudo apt-get install -y nvidia-container-toolkit \ && sudo nvidia-ctk runtime configure --runtime=docker \ && sudo systemctl restart docker
- Docker & Docker Compose: This project uses Docker Compose V1.
- Ensure Docker is installed on your system.
- Install Docker Compose V1 (if not already present) by running:
LATEST_COMPOSE_V1="1.29.2" sudo curl -L "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_V1}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
- API Keys: Create a
.env
file in the project root by copying the example:Then, edit thecp .env.example .env
.env
file and fill in yourGITHUB_TOKEN
, andBAILIAN_API_KEY
.
Step 1: Build and Start All Services
This single command will build the base CUDA image, the Neo4j image, and the final application image, then start all services in the background.
docker-compose up -d --build
Step 2: Run the Repair Pipeline
Execute the repair script inside the application container. The container will have access to the GPU.
docker-compose exec app bash run_repair.sh <instance_id>
# Example:
docker-compose exec app bash run_repair.sh astropy__astropy-12907
Step 3: Stopping the Environment
docker-compose down -v
If you use KGCompass in your research, please cite the following paper:
@article{yang2025enhancing,
title={Enhancing Repository-Level Software Repair via Repository-Aware Knowledge Graphs},
author={Yang, Boyang and Tian, Haoye and Ren, Jiadong and Jin, Shunfu and Liu, Yang and Liu, Feng and Le, Bach},
journal={arXiv preprint arXiv:2503.21710},
year={2025}
}