The KoMA framework consisting of the multi-agent interaction, the multi-step planning, the shared-memory, and the ranking-based reflection modules to enhance multi-agents’ decision-making in complex driving scenarios.
Fig.1 The knowledge-driven paradigm for single driving agent system and multiple driving agents system.
Fig.2 Knowledge-driven autonomous driving framework KoMA that incorporates multiple agents empowered by LLMs.
we recommend using conda to create an python virtual environment.
Note that if you want to use the Memory module, you need to run the code under linux
conda create -n KoMA python=3.9
conda activate KoMA
pip install -r requirements.txtAll configurable parameters are located in config.yaml.
Before running KoMA, set up your OpenAI API keys in config.yaml.
If you want to locally deploy some free open-source large language models via Ollama for testing, please download and deploy them according to the webpage https://ollama.com/. Note that you need to modify the API_TYPE in the config.yaml file and change the type of the large language model in LLMDriver/driverAgent (default is llama3).
python main.pyAll simulation scenarios are set in highway_env/envs.
The total number of vehicles in the initial simulation scenario does not exceed 8. We have only set up 8 random spawn locations for vehicles. You can customize the simulation scenario to solve this problem.
The configuration key 'KoMA-merge-generalization' should be replaced with 'KoMA-merge-onelane' in main.py.
config={
'KoMA-merge-onelane':
}test_GE_1_8-episode-0.mp4
config={
'KoMA-merge-threelane':
}test_GE1_5-episode-0.mp4
config={
'KoMA-merge-roundabout':
}roundabout_5-episode-0.mp4
All content is saved in the ./result/, including videos and documents.
The vector database is stored in the ./db/ .
If you use the project in your work, please consider citing it with:
@article{jiang2024koma,
title={Koma: Knowledge-driven multi-agent framework for autonomous driving with large language models},
author={Jiang, Kemou and Cai, Xuan and Cui, Zhiyong and Li, Aoyong and Ren, Yilong and Yu, Haiyang and Yang, Hao and Fu, Daocheng and Wen, Licheng and Cai, Pinlong},
journal={IEEE Transactions on Intelligent Vehicles},
year={2024},
publisher={IEEE}
}