In this work, we introduce a two-stage Strategy-Augmented Planning (SAP) framework that significantly enhances the opponent exploitation capabilities of LLM-based agents by utilizing a critical component, the Strategy Evaluation Network (SEN). Specifically, in the offline stage, we construct an explicit strategy space and subsequently collect strategy-outcome pair data for training the SEN network. During the online phase, SAP dynamically recognizes the opponent's strategies and greedily exploits them by searching best response strategy on the well-trained SEN, finally translating strategy to a course of actions by carefully designed prompts.
We recommend using uv to manage the environment. If you don’t have uv installed, you can install it with:
curl -LsSf https://astral.sh/uv/install.sh | shThen set up the project by cloning the repository and syncing dependencies:
git clone https://github.com/hsushuai/SAP.git
cd SAP
uv syncThis will automatically create a virtual environment in .venv and install dependencies from uv lock files.
To activate the environment:
source .venv/bin/activateTo run the MicroRTS environment, ensure an X server is running:
If you're using SSH on a remote server, enable X11 forwarding with:
ssh -X user@remote-serverThen, set the DISPLAY environment variable:
export DISPLAY=<YOUR_HOST_IP>:<PORT>Replace
<YOUR_HOST_IP>and<PORT>with your actual X server settings. For example:export DISPLAY=localhost:0
To verify the environment is working correctly, run the following test script:
python skill_rts/hello_world.pyYou should see a simple MicroRTS environment window launch successfully.
To run the experiments, you can use the provided scripts. For example, to evaluate the performance of the SAP agent, run:
python sap/experiments/eval_sap.pyMore scripts are available in the sap/experiments directory for different tasks and configurations.
There are three main directories in this repository: microrts, sap and skill_rts.
microrts: Contains the MicroRTS environment implementation and related utilities.sap: Contains the Strategy-Augmented Planning framework implementation, including the Strategy Evaluation Network (SEN) and related components.skill_rts: Contains the high-level skills and utilities for interacting with the MicroRTS environment.
This project builds on the foundations of MicroRTS-Py and PLAP. We gratefully acknowledge their contributions.
If you find this work useful, please consider citing our paper:
@misc{xu2025sap,
title={Strategy-Augmented Planning for Large Language Models via Opponent Exploitation},
author={Shuai Xu and Sijia Cui and Yanna Wang and Bo Xu and Qi Wang},
year={2025},
eprint={2505.08459},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2505.08459},
}