AgentVerse is an open source project designed to help users rapidly deploy multi-intelligent body systems based on the Large Language Model (LLM). It provides two core frameworks: task resolution and simulation environment. Task resolution framework through multiple intelligences collaborate to automate complex tasks , such as software development or consulting services. The simulation framework allows users to create customized environments for observing or interacting with multiple intelligences and is suitable for games or social behavior research. agentVerse supports the major LLMs (e.g., GPT-3.5 and LLaMA) and provides both command-line and graphical interfaces. Developed by the OpenBMB team, the project has been presented at ICLR 2024 and is continuously updated to support additional features such as local model integration and tool usage.
Function List
- multitasking: Support for multiple intelligences to collaborate on tasks such as software development, data analysis, or consulting systems.
- Simulation Environment Setup: Allows users to create custom scenarios to observe or interact with intelligent body behavior, suitable for gaming or social studies.
- Support for major language models: Compatible with OpenAI API, Azure OpenAI, and native models (e.g. LLaMA, Vicuna).
- Command line vs. graphical interfaceThe CLI and GUI provide two operation modes, which are easy for users to get started quickly.
- tool integration: Supporting intelligences to use external tools (e.g., web browsers, Jupyter Notebook) to accomplish complex tasks.
- Open Source and Extensible: The code is completely open source, users can modify or expand the function according to the demand.
- Rich examples and documentation: A variety of demo examples, such as NLP classroom, Prisoner's Dilemma and software design, are provided for easy learning and use.
Using Help
Installation process
AgentVerse supports Python 3.9 and above, and it is recommended to install it manually to get the latest features. Below are the detailed installation steps:
- Cloning Codebase::
Clone the AgentVerse code base locally using Git:git clone https://github.com/OpenBMB/AgentVerse.git --depth 1 cd AgentVerse
- Installation of dependencies::
Run the following command in the project directory to install the core dependencies:pip install -e .
If you need to use a local model (e.g. LLaMA), additionally install the following dependencies:
pip install -r requirements_local.txt
- Installation via pip(Optional):
If you don't want to clone the code base, you can install it directly via pip:pip install -U agentverse
- Configuring Environment Variables::
Users using the OpenAI API need to set up an API key:export OPENAI_API_KEY="your_api_key_here"
Additional settings are required if using the Azure OpenAI service:
export AZURE_OPENAI_API_KEY="your_api_key_here" export AZURE_OPENAI_API_BASE="your_api_base_here"
- Tool support (optional)::
If you need to run a simulation case with tools (such as thenlp_classroom_3players_withtool
), you need to install BMTools:git clone git+https://github.com/OpenBMB/BMTools.git cd BMTools pip install -r requirements.txt python setup.py develop
- vLLM support (optional)::
To use vLLM for large-scale inference tasks, you need to install and start the vLLM server, and then set the environment variables:export VLLM_API_KEY="your_api_key_here" export VLLM_API_BASE="http://your_vllm_url_here"
Modify the model settings in the task profile, for example:
model_type: vllm model: llama-2-7b-chat-hf
- FSChat support (local model)::
If you are using a local model (e.g. LLaMA), you need to install the FSChat dependency and start the local server:pip install -r requirements_local.txt bash scripts/run_local_model_server.sh
Modify the configuration file of the
llm_type
cap (a poem)model
, for example:llm: llm_type: local model: llama-2-7b-chat-hf
Usage
AgentVerse provides two main frameworks: task resolution and simulation environments. Here's how it works:
1. Mandate resolution framework
The task resolution framework is suitable for scenarios that require multiple intelligences to collaborate on complex tasks. Users can run preset or customized tasks from the command line.
- Running benchmark tests::
Test AgentVerse performance using the Humaneval dataset:agentverse-benchmark --task tasksolving/humaneval/gpt-3.5 --dataset_path data/humaneval/test.jsonl --overwrite
- Running a single task::
Run a preset brainstorming task:agentverse-tasksolving --task tasksolving/brainstorming
- Tool utilization tasks::
Run tasks with tools (such as solving a 24-point game):agentverse-tasksolving --task tasksolving/tool_using/24point
Ensure that the ToolServer for XAgent is started. more tool usage tasks are available in the
agentverse/tasks/tasksolving/tool_using/
Find it in the catalog.
2. Simulation environment framework
The simulation framework is suitable for studying the behavior of intelligences or creating interaction scenarios. Users can run simulations through the CLI or GUI.
- command-line operation::
Take the example of an NLP classroom (9 intelligences including 1 professor and 8 students):agentverse-simulation --task simulation/nlp_classroom_9players
- Graphical User Interface (GUI) operation::
Start the local web server to visualize the simulation:agentverse-simulation-gui --task simulation/nlp_classroom_9players
After startup, access the
http://127.0.0.1:7860/
View the simulation environment.
3. Customizing tasks and environments
Users can modify the agentverse/tasks/
directory to create custom tasks or simulation environments. Configuration files are typically in YAML format and contain information such as model type, task description, and intelligent body roles. For exampleagentverse/tasks/tasksolving/commongen/llama-2-7b-chat-hf/config.yaml
is a complete example of a task profile.
Featured Function Operation
- Multi-Intelligence Collaboration: In a task resolution framework, intelligences collaborate to accomplish tasks based on a division of roles (e.g., planner, executor). For example, in a software development task, one intelligent is responsible for requirements analysis, another generates code, and the last one performs testing.
- Tool Use: Intelligentsia can invoke external tools (e.g., Bing Search, Jupyter Notebook) to handle complex tasks. For example, in the 24-point game task, the intelligence uses tools to compute mathematical expressions.
- Analog Interaction: In the simulation framework, users can set the behavioral rules of the intelligences, observe their decision-making process in specific scenarios (e.g., the Prisoner's Dilemma), or interact with the intelligences through the GUI.
application scenario
- software development
AgentVerse's task resolution framework can be used to automate software development. Multiple intelligences work together, one to analyze requirements, one to generate code, and another to debug and test, significantly improving development efficiency. - Educational research
The NLP classroom scenarios in the simulation framework can be used to study the performance of a large language model in an educational setting. Users can observe the interaction between the professor and the student intelligences and analyze the effectiveness of the teaching. - Social Behavior Research
The simulation framework supports the creation of scenarios such as the Prisoner's Dilemma to study the behavioral patterns of intelligences in competitive or cooperative environments, and is suitable for sociological or game-theoretic research. - game development
The simulation framework allows users to create interactive game environments (e.g., Pokemon game demo) where intelligences take on the role of characters and interact with players, suitable for game prototyping.
QA
- What major language models does AgentVerse support?
AgentVerse supports OpenAI APIs (e.g. GPT-3.5), Azure OpenAI, and local models (e.g. LLaMA, Vicuna). Users need to configure the appropriate API key or local server. - How do I run a task with tools?
You need to install BMTools or XAgent's ToolServer first, and then run theagentverse-tasksolving --task tasksolving/tool_using/24point
and other commands. Ensure that the tool server is functioning properly. - How is the GUI of the simulation environment accessed?
(of a computer) runagentverse-simulation-gui --task simulation/nlp_classroom_9players
After visiting thehttp://127.0.0.1:7860/
The graphical interface can be viewed. - How can I contribute code or give feedback on an issue?
Users can submit an issue or pull request through GitHub.PULL_REQUEST_TEMPLATE
Submit a code, or contact the AgentVerse team (agentverse2@gmail.com).