MacNet is a specialized branch of ChatDev that focuses on supporting the research of agent scaling on arbitrary topologies using the Multi-Agent Collaboration Networks (MacNet) framework. MacNet utilizes directed acyclic graphs to facilitate effective task-oriented collaboration among agents through linguistic interactions. It supports cooperation across various topologies and among a large number of agents without exceeding context limits.
To get started with MacNet, follow these steps:
-
Generate Graph Structure: Run
generate_graph.py
to generate the desired graph structure for your multi-agent collaboration network. You can customize the number of nodes and the topology of the graph. For example:python generate_graph.py --node_num 10 --topology tree
-
Configure MacNet: The
generate_graph.py
will automatically update the graph config in theconfig.yaml
file. You can check other parameters for deploying agents, including the LLM backend and prompt. Additionally, MacNet supports the SRDD_Profile dataset, which is a large-scale agent role prompt dataset. It allows you to randomly select system profile prompts for the deployed agents in the topology based on the software category. To use SRDD_Profile, specify the category using the--type
parameter when runningrun.py
.
-
Run MacNet: Execute
run.py
to deploy agents on the specified graph topology and generate software based on the configuration inconfig.yaml
. During this process, you can observe the complete graph structure, the code changes occurring from one node to another, and the corresponding agent suggestions. MacNet will run agents on the graph in the topological order. You can observe the code changes in each node transition and agent suggestions on each edge in real-time.python run.py --task "Develop a basic Gomoku game." --name "Gomoku" [--type <software_category>]
--task
: Specifies the prompt or description of the software to be developed.--name
: Specifies the name of the software project.--type
(optional): Specifies the software category for selecting system profile prompts from the SRDD_Profile dataset.
-
Access Generated Software: After the execution of
run.py
, the generated software can be found in theWareHouse
directory. Each software project will have its own folder with a timestamp. -
View Logs: The complete logs of the MacNet execution can be found in the
MacNetLog
directory. The logs are organized by timestamp and provide detailed information about the multi-agent collaboration process.
- Example of various generated topologies:
- Example of the MacNet running process, including the suggestions and code diffs between agents on adjacent nodes:
- Example of the generated software:
@article{macnet,
title={Scaling Large-Language-Model-based Multi-Agent Collaboration},
author={Chen Qian and Zihao Xie and Yifei Wang and Wei Liu and Yufan Dang and Zhuoyun Du and Weize Chen and Cheng Yang and Zhiyuan Liu and Maosong Sun}
journal={arXiv preprint arXiv:2406.07155},
url = {https://arxiv.org/abs/2406.07155},
year={2024}
}
@article{chatdev,
title = {ChatDev: Communicative Agents for Software Development},
author = {Chen Qian and Wei Liu and Hongzhang Liu and Nuo Chen and Yufan Dang and Jiahao Li and Cheng Yang and Weize Chen and Yusheng Su and Xin Cong and Juyuan Xu and Dahai Li and Zhiyuan Liu and Maosong Sun},
journal = {arXiv preprint arXiv:2307.07924},
url = {https://arxiv.org/abs/2307.07924},
year = {2023}
}
@article{colearning,
title = {Experiential Co-Learning of Software-Developing Agents},
author = {Chen Qian and Yufan Dang and Jiahao Li and Wei Liu and Zihao Xie and Yifei Wang and Weize Chen and Cheng Yang and Xin Cong and Xiaoyin Che and Zhiyuan Liu and Maosong Sun},
journal = {arXiv preprint arXiv:2312.17025},
url = {https://arxiv.org/abs/2312.17025},
year = {2023}
}
@article{iagents,
title={Autonomous Agents for Collaborative Task under Information Asymmetry},
author={Wei Liu and Chenxi Wang and Yifei Wang and Zihao Xie and Rennai Qiu and Yufan Dnag and Zhuoyun Du and Weize Chen and Cheng Yang and Chen Qian},
journal={arXiv preprint arXiv:2406.14928},
url = {https://arxiv.org/abs/2406.14928},
year={2024}
}
More research from our lab can be accessed here.
MacNet is built upon the foundation of ChatDev, a project that aims to revolutionize software development through communicative agents.
If you have any questions, feedback, or would like to get in touch, please feel free to reach out to us via email at [email protected].