Official Repository of "GraphTeam: Facilitating Large Language Model-based Graph Analysis via Multi-Agent Collaboration".
Python
46
29 commits
updated Mar 28, 2025
Official Repository of "GraphTeam: Facilitating Large Language Model-based Graph Analysis via Multi-Agent Collaboration".
GraphTeam consists of five LLM-based agents from three modules, where agents with different specialties collaborate to address complex problems. Specifically:
Input-Output Normalization Module:
External Knowledge Retrieval Module:
Problem-Solving Module:
Extensive experiments on six graph analysis benchmarks demonstrate that GraphTeam achieves state-of-the-art performance with an average 25.85% improvement over the best baseline in terms of accuracy.
The overall pipeline of our multi-agent system GraphTeam (left), and the comparison between GraphTeam and state-of-the-art baseline on six benchmarks (right).
The overall framework of GraphTeam, which includes five agents from three functional groups.
Performance comparison on six graph analysis benchmarks in terms of accuracy (%).
First, create a Conda virtual environment with a specified Python version.
conda create -n myenv python=3.10.14
Activate the virtual environment:
conda activate myenv
With the virtual environment activated, run the following command to install the project dependencies:
pip install -r requirements.txt
Docker is used to execute code after it is generated. Follow these steps:
docker pull chuqizhi72/graphteam:latest
graphteamdocker run -it --name graphteam chuqizhi72/graphteam:latest /bin/bash
Ensure that the Conda virtual environment is activated. If not, run:
conda activate myenv
Ensure the Docker container is started. If not, run:
docker start graphteam
docker exec -it graphteam /bin/bash
run.pyWithin the activated virtual environment, navigate to the project directory, ensure your current working directory is set to multi-agents-4-graph-analysis, and set your OpenAI API key in run.py. Then, run run.py:
cd multi-agents-4-graph-analysis
Setting the OpenAI API Key:
Open run.py located at multi-agents-4-graph-analysis/GraphTeam/run.py in your preferred text editor.
Locate the line where the OpenAI API key is set. It should look like this:
os.environ['OPENAI_API_KEY'] = 'your-api-key-here'
Replace 'your-api-key-here' with your actual OpenAI API key:
os.environ['OPENAI_API_KEY'] = 'sk-your-openai-api-key'
Running the Script:
After setting the API key, execute the script from the multi-agents-4-graph-analysis directory:
python GraphTeam/run.py
Note for Running the NLGraph Benchmark:
The project includes an answer_format_dict that specifies the required output format for different problem types. To ensure consistency and accuracy in the results when running the NLGraph benchmark, you need to modify the run_threaded function in the run.py file.
Open run.py located at multi-agents-4-graph-analysis/GraphTeam/run.py in your preferred text editor.
Locate the run_threaded function and answer_format_dict.
Find the following commented lines within the function:
# if is NLGraph, the question should add output format
# question = question + answer_format_dict[category_data['type'][i]]
Uncomment these lines by removing the # symbols:
# if is NLGraph, the question should add output format
question = question + answer_format_dict[category_data['type'][i]]
This modification ensures that each question includes the appropriate output format directive, guiding the system to format the output correctly and enhancing the reliability of the results.
run.pySolution: Ensure all dependencies are correctly installed and that both the Conda environment and Docker are activated. Check the paths and configurations in run.py to ensure they are correct. Additionally, verify that you have set your OpenAI API key correctly in run.py.
Solution: When running the project, ensure that your current working directory is set to multi-agents-4-graph-analysis. This ensures that all relative paths and configurations function correctly.
Solution: The relevant documentation is located in the data directory of the project. The relevant documentation is located in the memory directory of the project. Ensure that all relevant files are present and properly formatted.
The project includes an answer_format_dict that specifies the required output format for different problem types. To ensure consistency and accuracy in the results when running the NLGraph benchmark, you need to modify the run_threaded function in the run.py file.
Open run.py located at multi-agents-4-graph-analysis/GraphTeam/run.py in your preferred text editor.
Locate the run_threaded function.
Find the following commented lines within the function:
# if is NLGraph, the question should add output format
# question = question + answer_format_dict[category_data['type'][i]]
Uncomment these lines by removing the # symbols:
# if is NLGraph, the question should add output format
question = question + answer_format_dict[category_data['type'][i]]
This modification ensures that each question includes the appropriate output format directive, guiding the system to format the output correctly and enhancing the reliability of the results.
We would like to acknowledge the following contributors for their valuable support and contributions to the GraphTeam project:
Their dedication and expertise have been instrumental in the development and success of this project.
@misc{li2024largelanguagemodelsanalyze,
title={Can Large Language Models Analyze Graphs like Professionals? A Benchmark, Datasets and Models},
author={Xin Li and Weize Chen and Qizhi Chu and Haopeng Li and Zhaojun Sun and Ran Li and Chen Qian and Yiwei Wei and Zhiyuan Liu and Chuan Shi and Maosong Sun and Cheng Yang},
year={2024},
eprint={2409.19667},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2409.19667},
}
@misc{li2024graphteamfacilitatinglargelanguage,
title={GraphTeam: Facilitating Large Language Model-based Graph Analysis via Multi-Agent Collaboration},
author={Xin Li and Qizhi Chu and Yubin Chen and Yang Liu and Yaoqi Liu and Zekai Yu and Weize Chen and Chen Qian and Chuan Shi and Cheng Yang},
year={2024},
eprint={2410.18032},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2410.18032},
}
Python
99.5%
Official Repository of "GraphTeam: Facilitating Large Language Model-based Graph Analysis via Multi-Agent Collaboration".
Python
46
29 commits
updated Mar 28, 2025
Official Repository of "GraphTeam: Facilitating Large Language Model-based Graph Analysis via Multi-Agent Collaboration".
GraphTeam consists of five LLM-based agents from three modules, where agents with different specialties collaborate to address complex problems. Specifically:
Input-Output Normalization Module:
External Knowledge Retrieval Module:
Problem-Solving Module:
Extensive experiments on six graph analysis benchmarks demonstrate that GraphTeam achieves state-of-the-art performance with an average 25.85% improvement over the best baseline in terms of accuracy.
The overall pipeline of our multi-agent system GraphTeam (left), and the comparison between GraphTeam and state-of-the-art baseline on six benchmarks (right).
The overall framework of GraphTeam, which includes five agents from three functional groups.
Performance comparison on six graph analysis benchmarks in terms of accuracy (%).
First, create a Conda virtual environment with a specified Python version.
conda create -n myenv python=3.10.14
Activate the virtual environment:
conda activate myenv
With the virtual environment activated, run the following command to install the project dependencies:
pip install -r requirements.txt
Docker is used to execute code after it is generated. Follow these steps:
docker pull chuqizhi72/graphteam:latest
graphteamdocker run -it --name graphteam chuqizhi72/graphteam:latest /bin/bash
Ensure that the Conda virtual environment is activated. If not, run:
conda activate myenv
Ensure the Docker container is started. If not, run:
docker start graphteam
docker exec -it graphteam /bin/bash
run.pyWithin the activated virtual environment, navigate to the project directory, ensure your current working directory is set to multi-agents-4-graph-analysis, and set your OpenAI API key in run.py. Then, run run.py:
cd multi-agents-4-graph-analysis
Setting the OpenAI API Key:
Open run.py located at multi-agents-4-graph-analysis/GraphTeam/run.py in your preferred text editor.
Locate the line where the OpenAI API key is set. It should look like this:
os.environ['OPENAI_API_KEY'] = 'your-api-key-here'
Replace 'your-api-key-here' with your actual OpenAI API key:
os.environ['OPENAI_API_KEY'] = 'sk-your-openai-api-key'
Running the Script:
After setting the API key, execute the script from the multi-agents-4-graph-analysis directory:
python GraphTeam/run.py
Note for Running the NLGraph Benchmark:
The project includes an answer_format_dict that specifies the required output format for different problem types. To ensure consistency and accuracy in the results when running the NLGraph benchmark, you need to modify the run_threaded function in the run.py file.
Open run.py located at multi-agents-4-graph-analysis/GraphTeam/run.py in your preferred text editor.
Locate the run_threaded function and answer_format_dict.
Find the following commented lines within the function:
# if is NLGraph, the question should add output format
# question = question + answer_format_dict[category_data['type'][i]]
Uncomment these lines by removing the # symbols:
# if is NLGraph, the question should add output format
question = question + answer_format_dict[category_data['type'][i]]
This modification ensures that each question includes the appropriate output format directive, guiding the system to format the output correctly and enhancing the reliability of the results.
run.pySolution: Ensure all dependencies are correctly installed and that both the Conda environment and Docker are activated. Check the paths and configurations in run.py to ensure they are correct. Additionally, verify that you have set your OpenAI API key correctly in run.py.
Solution: When running the project, ensure that your current working directory is set to multi-agents-4-graph-analysis. This ensures that all relative paths and configurations function correctly.
Solution: The relevant documentation is located in the data directory of the project. The relevant documentation is located in the memory directory of the project. Ensure that all relevant files are present and properly formatted.
The project includes an answer_format_dict that specifies the required output format for different problem types. To ensure consistency and accuracy in the results when running the NLGraph benchmark, you need to modify the run_threaded function in the run.py file.
Open run.py located at multi-agents-4-graph-analysis/GraphTeam/run.py in your preferred text editor.
Locate the run_threaded function.
Find the following commented lines within the function:
# if is NLGraph, the question should add output format
# question = question + answer_format_dict[category_data['type'][i]]
Uncomment these lines by removing the # symbols:
# if is NLGraph, the question should add output format
question = question + answer_format_dict[category_data['type'][i]]
This modification ensures that each question includes the appropriate output format directive, guiding the system to format the output correctly and enhancing the reliability of the results.
We would like to acknowledge the following contributors for their valuable support and contributions to the GraphTeam project:
Their dedication and expertise have been instrumental in the development and success of this project.
@misc{li2024largelanguagemodelsanalyze,
title={Can Large Language Models Analyze Graphs like Professionals? A Benchmark, Datasets and Models},
author={Xin Li and Weize Chen and Qizhi Chu and Haopeng Li and Zhaojun Sun and Ran Li and Chen Qian and Yiwei Wei and Zhiyuan Liu and Chuan Shi and Maosong Sun and Cheng Yang},
year={2024},
eprint={2409.19667},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2409.19667},
}
@misc{li2024graphteamfacilitatinglargelanguage,
title={GraphTeam: Facilitating Large Language Model-based Graph Analysis via Multi-Agent Collaboration},
author={Xin Li and Qizhi Chu and Yubin Chen and Yang Liu and Yaoqi Liu and Zekai Yu and Weize Chen and Chen Qian and Chuan Shi and Cheng Yang},
year={2024},
eprint={2410.18032},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2410.18032},
}
Python
99.5%