agentverse


Nameagentverse JSON
Version 0.1.8.1 PyPI version JSON
download
home_pagehttps://github.com/OpenBMB/AgentVerse
SummaryA versatile framework that streamlines the process of creating custom multi-agent environments for large language models (LLMs).
upload_time2023-10-27 14:16:57
maintainer
docs_urlNone
authorAgentVerse Team
requires_python>=3.9
license
keywords
VCS
bugtrack_url
requirements pyyaml fastapi uvicorn py3langid iso-639 openai opencv-python gradio httpx astunparse langchain scikit-learn pydantic typing-extensions typing-inspect colorlog rapidfuzz spacy colorama fschat tiktoken
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center"> ๐Ÿค– AgentVerse ๐Ÿช </h1>

<!--
<h3 align="center">
    <p>A Framework for Multi-LLM Environment Simulation</p>
</h3>
-->

<p align="center">
    <a href="https://github.com/OpenBMB/AgentVerse/blob/main/LICENSE">
        <img alt="License: Apache2" src="https://img.shields.io/badge/License-Apache_2.0-green.svg">
    </a>
    <a href="https://www.python.org/downloads/release/python-3916/">
        <img alt="Python Version" src="https://img.shields.io/badge/python-3.9+-blue.svg">
    </a>
    <a href="https://github.com/OpenBMB/AgentVerse/actions/">
        <img alt="Build" src="https://img.shields.io/github/actions/workflow/status/OpenBMB/AgentVerse/test.yml">
    </a>
    <a href="https://github.com/psf/black">
        <img alt="Code Style: Black" src="https://img.shields.io/badge/code%20style-black-black">
<!--     </a>
    <a href="https://github.com/OpenBMB/AgentVerse/issues">
        <img alt="Contributions: Welcome" src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat">
    </a> -->
    <a href="https://huggingface.co/AgentVerse">
        <img alt="HuggingFace" src="https://img.shields.io/badge/hugging_face-play-yellow">
    </a>
    <a href="https://discord.gg/MjG3vzaT">
        <img alt="Discord" src="https://img.shields.io/badge/AgentVerse-Discord-purple?style=flat">
    </a>
    
    
</p>

<p align="center">
<img src="./imgs/title.png" width="512">
</p>

<p align="center">
    ใ€English | <a href="README_zh.md">Chinese</a>ใ€‘
</p>

**AgentVerse** is designed to facilitate the deployment of multiple LLM-based agents in various applications. AgentVerse primarily provides two frameworks: **task-solving** and **simulation**. 

- Task-solving: This framework assembles multiple agents as an automatic multi-agent system ([AgentVerse-Tasksolving](https://arxiv.org/pdf/2308.10848.pdf), [Multi-agent as system](https://arxiv.org/abs/2309.02427)) to collaboratively accomplish the corresponding tasks. 
Applications: software development system, consulting system, etc.

<p align="center">
<img width="616" alt="Screen Shot 2023-09-01 at 12 08 57 PM" src="https://github.com/OpenBMB/AgentVerse/assets/11704492/6db1c907-b7fc-42f9-946c-89853a28f386">
</p>

- Simulation: This framework allows users to set up custom environments to observe behaviors among, or interact with, multiple agents. โš ๏ธโš ๏ธโš ๏ธ We're refactoring the code. If you require a stable version that exclusively supports simulation framework, you can use [`release-0.1`](https://github.com/OpenBMB/AgentVerse/tree/release-0.1) branch. Applications: game, social behavior research of LLM-based agents, etc.

<p align="center">
<img width="616" alt="Screen Shot 2023-10-16 at 10 53 49 PM" src="https://github.com/OpenBMB/AgentVerse/assets/11704492/4102d1e2-3fe7-4656-aa2c-a218ce1f2c95">
</p>


---


# ๐Ÿ“ฐ What's New
- [2023/10/17] We're super excited to share our open-source AI community hugging face: [`AgentVerse`](https://huggingface.co/spaces/AgentVerse/agentVerse). You are able to try out the two simulation applications, NLP Classroom and Prisoner's Dilemma,with your code of the openai API key and the openai organization. Have fun!

- [2023/10/5] Re-factor our codebase to enable the deployment of both simulation and task-solving framework! We have placed the code for Minecraft example in the paper at the [`minecraft`](https://github.com/OpenBMB/AgentVerse/tree/minecraft) branch. Our tool-using example will soon be updated to the `main` branch. Stay tuned!

- [2023/8/22] We're excited to share our paper [AgentVerse: Facilitating Multi-Agent Collaboration and Exploring Emergent Behaviors in Agents](https://arxiv.org/abs/2308.10848) that  illistrate the task-solving framework 
in detail of AgentVerse.

- [2023/6/5] We are thrilled to present an array of [demos](#-simple-demo-video), including [NLP Classroom](#nlp-classroom), [Prisoner Dilemma](#prisoner-dilemma), [Software Design](#software-design), [Database Administrator](#database-administrator-dba), and a simple [H5 Pokemon Game](#pokemon) that enables the interaction with the characters in Pokemon! Try out these demos and have fun!
- [2023/5/1] ๐Ÿš€ [AgentVerse](https://github.com/OpenBMB/AgentVerse) is officially launched!




# ๐Ÿ—“ Coming Soon
- [x] Code release of our [paper](https://arxiv.org/abs/2308.10848)
- [x] Add support for local LLM (LLaMA, Vicunna, etc.)
- [ ] Add documentation
- [ ] Support more sophisticated memory for conversation history


<!--

## ๐Ÿ‘พ Simple Demo Video

We demonstrate the following cases that are expertly crafted by AgentVerse.


#### NLP Classroom
In the NLP class, the professor and students engage in interactive communication. When students have a question, they raise their hands and patiently wait for the professor to call on them. Only after being called on by the professor, can students speak and ask their questions.

Use the following command to launch the NLP Classroom example:
```bash
python agentverse_command/main_simulation_gui.py --task simulation/nlp_classroom_9players
```

https://github.com/OpenBMB/AgentVerse/assets/11704492/6ea07850-595e-4a28-a82e-f863011353c2


#### Prisoner Dilemma
A prisoner's Dilemma is a thought experiment that challenges two completely rational agents to a dilemma: they can cooperate with their partner for mutual benefit or betray their partner ("defect") for individual reward.

Use the following command to launch the Prisoner Dilemma example:
```bash
python agentverse_command/main_simulation_gui.py --task simulation/prisoner_dilemma
```

https://github.com/OpenBMB/AgentVerse/assets/11704492/017c46e5-c738-4fca-9352-b008e2d518bd


#### Software Design
In the Software Design example, a code writer, a code tester and a code reviewer collaborate on the code generation problem. Given a problem, the code writer first composes the code implementation. The code tester runs the unit tests and provides the feedback. The code viewer then generates a review. After collecting the test feedback and review, the code writer iteratively refines the code.

Use the following command to launch the Software Design example:
```bash
python agentverse_command/main_simulation_gui.py --task simulation/sde_team/sde_team_2players
```

https://github.com/OpenBMB/AgentVerse/assets/11704492/5058066a-abee-490d-8659-b4e54661626a


#### [Database Administrator (DBA)](https://github.com/TsinghuaDatabaseGroup/DB-GPT)

In the database diagnosis scenario, the Chief DBA monitors the system anomalies (e.g., slow queries, locks, crash down). If detected, the domain experts are alerted to analyze root causes, share insights, and suggest optimization solutions together. The Chief DBA then provides a summarized report to the user.

```bash
python agentverse_command/main_simulation_gui.py --task simulation/db_diag
```

https://github.com/OpenBMB/AgentVerse/assets/11704492/c633419d-afbb-47d4-bb12-6bb512e7af3a

#### [Text Evaluation (ChatEval)](https://github.com/chanchimin/ChatEval)
In the context of the text evaluation scenario, we recommend users explore the [ChatEval](https://github.com/chanchimin/ChatEval) repo. They've implemented a multi-agent referee team on AgentVerse to assess the quality of text generated by different models. When given two distinct pieces of text, roles within ChatEval can autonomously debate the nuances and disparities, drawing upon their assigned personas, and subsequently provide their judgments. Experiments indicate that their referee team, enriched with diverse roles specified in [config.yaml](#2-configuring-the-agents), aligns more closely with human evaluations. This demo is built upon the [Fastchat](https://github.com/lm-sys/FastChat) repo, and we'd like to express our appreciation for their foundational work.


https://github.com/OpenBMB/AgentVerse/assets/75533759/58f33468-f15b-4bac-ae01-8d0780019f85

#### Pokemon
**Currently available only in [`release-0.1`](https://github.com/OpenBMB/AgentVerse/tree/release-0.1)**. In the game, agents can walk around the game world, and interact with one another. As a player, you take on the role of an agent and can engage with others at any time. There are 6 characters in the Pokรฉmon environment who appeared in Pokemon Emerald: [May](https://bulbapedia.bulbagarden.net/wiki/May_(game)), [Professor Birch](https://bulbapedia.bulbagarden.net/wiki/Professor_Birch), [Steven Stone](https://bulbapedia.bulbagarden.net/wiki/Steven_Stone), [Maxie](https://bulbapedia.bulbagarden.net/wiki/Maxie), [Archie](https://bulbapedia.bulbagarden.net/wiki/Archie) and [Joseph](https://bulbapedia.bulbagarden.net/wiki/Mr._Stone). 

To launch the Pokemon game, first launch a local server with the following command:
```bash
uvicorn pokemon_server:app --reload --port 10002
```
Then open another terminal in the project's root path and run the following command:
```bash
cd ui
# If you do not have npm installed, you need to install it before running the following commands 
# https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
# We have tested on npm@9.6.4, node@20.0.0
npm install
npm run watch
```
Wait for the compilation to complete, and have fun! (WASD for moving around, and SPACE for launching a conversation.)

https://github.com/OpenBMB/AgentVerse/assets/11704492/4d07da68-f942-4205-b558-f155e95782e7

-->

<!--

## Contents

- [โœจ Features](#-features)
- [๐Ÿ“ฐ What's New](#-whats-new)
- [๐ŸŒŸ Join Us!](#-join-us)
  - [How Can You Contribute?](#how-can-you-contribute)
- [๐Ÿ—“ Coming Soon](#-coming-soon)
- [๐Ÿ‘พ Simple Demo Video](#-simple-demo-video)
    - [NLP Classroom](#nlp-classroom)
    - [Prisoner Dilemma](#prisoner-dilemma)
    - [Software Design](#software-design)
    - [Database Administrator (DBA)](#database-administrator-dba)
    - [Text Evaluation (ChatEval)](#text-evaluation-chateval)
    - [Pokemon](#pokemon)
- [Contents](#contents)
- [๐Ÿš€ Getting Started](#-getting-started)
  - [Installation](#installation)
  - [Simulation Example](#simulation)
  - [Task-Solving Example](#task-solving-cli-example)
- [๐Ÿ’ก Philosophy](#-philosophy)
  - [Environment](#environment)
  - [Agent](#agent)
- [โœ๏ธ Customize Your Own Environment](#๏ธ-customize-your-own-environment)
  - [A Simple Example: Building a Classroom Environment](#a-simple-example-building-a-classroom-environment)
      - [1. Creating a Task Directory and Configuring the Environment](#1-creating-a-task-directory-and-configuring-the-environment)
      - [2. Configuring the Agents](#2-configuring-the-agents)
      - [3. Writing an Output Parser](#3-writing-an-output-parser)
  - [Customization Guide for More Complex Environments](#customization-guide-for-more-complex-environments)
- [๐Ÿ”Ž Examples](#-examples)
- [Star History](#star-history)
- [Citation](#citation)
- [Contact](#contact)

-->

# Contents
- [๐Ÿ“ฐ What's New](#-whats-new)
- [๐Ÿ—“ Coming Soon](#-coming-soon)
- [Contents](#contents)
- [๐Ÿš€ Getting Started](#-getting-started)
  - [Installation](#installation)
  - [Simulation CLI Example](#simulation)
  - [Task-Solving CLI Example](#task-solving)
- [๐ŸŒŸ Join Us!](#-join-us)
  - [How Can You Contribute?](#how-can-you-contribute)
- [Social Media and Community](#social-media-and-community)
- [Star History](#star-history)
- [Citation](#citation)
- [Contact](#contact)




# ๐Ÿš€ Getting Started

## Installation

**Manually Install (Recommended!)**
```bash
git clone https://github.com/OpenBMB/AgentVerse.git --depth 1
cd AgentVerse
python setup.py develop
```
Some users have reported problems installing the `orjson` required by `gradio`. One simple workaround is to install it with Anaconda `conda install -c conda-forge orjson`.

**Install with pip**

Or you can install through pip
```bash
pip install -U agentverse
```


You also need to export your OpenAI API key as follows๏ผš
```bash
# Export your OpenAI API key
export OPENAI_API_KEY="your_api_key_here"
# Or if you are using Azure
export AZURE_OPENAI_API_KEY="your_api_key_here"
export AZURE_OPENAI_API_BASE="your_api_base_here"
```

If you want use Azure OpenAI services, pleas export your Azure OpenAI key and OpenAI API base as follows๏ผš
```bash
export AZURE_OPENAI_API_KEY="your_api_key_here"
export AZURE_OPENAI_API_BASE="your_api_base_here"
```

If you want to use the tools provided by BMTools, you need to install BMTools as follows:
```bash
git clone git+https://github.com/OpenBMB/BMTools.git
cd BMTools
pip install -r requirements.txt
python setup.py develop
```

## Simulation

### Framework Required Modules 
```
- agentverse 
  - agents
    - simulation_agent
  - environments
    - simulation_env
```

### CLI Example

You can create a multi-agent environments provided by us. Using the classroom scenario as an example. In this scenario, there are nine agents, one playing the role of a professor and the other eight as students.

```shell
agentverse-simulation --task simulation/nlp_classroom_9players
```

### GUI Example (Local)

We also provide a local website demo for this environment. You can launch it with

```shell
agentverse-simulation-gui --task simulation/nlp_classroom_9players
```
After successfully launching the local server, you can visit [http://127.0.0.1:7860/](http://127.0.0.1:7860/) to view the classroom environment.


## Task-Solving 


### Framework Required Modules 
```
- agentverse 
  - agents
    - simulation_env
  - environments
    - tasksolving_env
```

### CLI Example

To run the experiments with the task-solving environment proposed in our [paper](https://arxiv.org/abs/2308.10848), you can use the following command:

To run AgentVerse on a benchmark dataset, you can try
```shell
# Run the Humaneval benchmark using gpt-3.5-turbo (config file `agentverse/tasks/tasksolving/humaneval/gpt-3.5/config.yaml`)
agentverse-benchmark --task tasksolving/humaneval/gpt-3.5 --dataset_path data/humaneval/test.jsonl --overwrite
```

To run AgentVerse on a specific problem, you can try
```shell
# Run a single query (config file `agentverse/tasks/tasksolving/brainstorming/gpt-3.5/config.yaml`). The task is specified in the config file.
agentverse-tasksolving --task tasksolving/brainstorming
```

You can take a look at `agentverse/tasks/tasksolving` for more experiments we have done in our paper.


# AgentVerse Showcases

## Simulation Showcases
Refer to [simulation showcases](README_simulation_cases.md)

## Task-Solving Showcases
Refer to [tasksolving showcases](README_tasksolving_cases.md)



<!--
## ๐Ÿ’ก Philosophy

### Environment

At the core of our framework is the environment, which plays a crucial role in enabling researchers to study the behavior of agents under different conditions. We believe that the environment should be flexible and extensible, allowing researchers to easily customize it to fit their needs. To achieve this, we have abstracted the environment into five rule components, and implementing different environments is actually implementing different rules:

- **Describer**: This component provides a description of the environment at each turn for each agent. You can customize the describer to define the specific requirements of their environment, such as the agents with whom an agent can interact.
- **Order**: This component defines the order in which agents take actions within the environment. You can customize the order to reflect the desired interaction between agents. We provide several basic order options, including `random`, `sequential`, and `concurrent` (in which all agents take an action in each turn).
- **Selector**: This component selects the valid messages generated by agents. Sometimes agents may generate invalid responses, and the selector is used to filter out unexpected results.
- **Updater**: This component updates the memory of each agent. In certain cases, the response generated by one agent should not be seen by all agents (e.g., if agents are in different rooms). For each response, the updater updates only the agents who can see it.
- **Visibility**: This component maintains the list of agents that each agent can see throughout the environment's changes. For example, when an agent moves from one room to another, the list of visible agents of each agent should be updated by `visibility`.

By abstracting the environment into these five components, we have created a highly flexible and extensible framework that enables researchers to easily build and customize their own multi-agent environments.

### Agent

Another fundamental component is the agent. Currently we provide two types of agents: **ConversationAgent** and **ToolAgent**. You can also customize your own agent by inheriting BaseAgent class (tutorial coming soon).

-->





<!--

## โœ๏ธ Customize Your Own Environment

We have provided several examples in the `agentverse/tasks` directory. To customize your environment, you should

1. Create a task directory in `agentverse/tasks` 
2. Write the configuration file
3. Write the output parser that parses the response of your agents.
4. Add your parser in `agentverse/tasks/__init__.py`

We will use a simple example in `agentverse/tasks/nlp_classroom_3players` to illustrate the procedure.

### A Simple Example: Building a Classroom Environment

To illustrate how to customize your environment, we'll use a simple example of building a classroom environment where one agent is the professor, one is the student, and one is the teaching assistant.

##### 1. Creating a Task Directory and Configuring the Environment

First, we need to create a task directory and write our configuration file for the environment. In the `agentverse/tasks` directory, create a new directory called `nlp_classroom_3players`. Inside this directory, create a `config.yaml` file and write the following configuration:

```yaml
# config.yaml
environment:
  env_type: basic				# Use the basic environment provided in AgentVerse
  max_turns: 10					# Specify the maximum number of dialogue turns
  rule:
    order:
      type: sequential	# Use the sequential order
    visibility:
      type: all					# Each message can be seen by all agents
    selector:
      type: basic				# Basic selector (do not select)
    updater:
      type: basic				# Basic updater (update the message to all agents)
    describer:
      type: basic				# Basic describer (no description)
```

This configuration specifies that we will use the basic environment provided in AgentVerse, with a maximum of 10 dialogue turns. We'll use the sequential order, with all messages visible to all agents. We won't be using any selectors, our updater will update the messages to all the agents and our describer will provide no description.

##### 2. Configuring the Agents

Next, we'll configure the agents. In the `config.yaml` file, we'll add the configuration for each agent. Here's an example configuration for the professor:

```yaml
# config.yaml
agents:
  -
    agent_type: conversation
    name: Professor Micheal		# Name of the agent
    role_description: You are Prof. Micheal, ...	# Description of the agent
    memory: 
      memory_type: chat_history		# Will store all the chat history
    prompt_template: *professor_prompt
    llm:
      llm_type: text-davinci-003    # Will use OpenAICompletion LLM
      model: text-davinci-003       # The arguments passed to the api call
      temperature: 0.7
      max_tokens: 250
```

In this example, we'll use the `conversation` agent type. We've given the agent a name and a description, and we'll store the chat history in memory. We've also provided a prompt template with placeholders marked as ${placeholder}. These will be instantiated by the `_fill_prompt_template` method of the agent.

##### 3. Writing an Output Parser

The next step is to write a simple parser for your agent's response. Because you may have specified the output format in your prompt template, you need to provide a corresponding parser. In this example, we inform the model to output in the following format in our prompt template

```
Action: Speak
Action Input: (the content)
```

We'll write a parser to extract the content from the agent's response. Refer to the code for more details. We've decorated our parser function with `@output_parser_registry.register('classroom_parser')` to register it with our framework. Finally, we import our parser in `agentverse/tasks/__init__.py`.

With these steps, we've successfully built a simple classroom environment and customized it for our needs.

### Customization Guide for More Complex Environments

While we provide a basic framework for building environments with our five rule components, more complex environments may require further customization. A detailed documentation and tutorial is coming soon. Here we briefly introduce some steps you can take to customize your environment:

1. **Customize the five rule components**. Each rule component has an interface, allowing you to customize its behavior to suit your specific needs. It's important to note that these components are not necessarily independent and can interact through the `rule_params` dictionary in the environment. You can create your own rule components and integrate them with the existing ones to build more complex interactions between agents.
2. **Customize the environment itself**. Our `basic` environment provides a default execution order for the five rule components that is suitable for most cases, but you can inherit the `BaseEnvironment` class and write your own `run` method to implement a more sophisticated execution order.
3. **Customize the agent**. Depending on your specific use case, you may also need to inherit the `BaseAgent` class. For example, you may want to use your local LLM as your agents or create agents with specialized knowledge or skills.

-->


<!--

## ๐Ÿ”Ž Examples

Currently, we offer some simple examples in the `agentverse/tasks` directory, each demonstrating different possibilities of our framework. While the performance of these examples may not be optimal due to limited prompt engineering, they are intended to showcase the capabilities of our framework, such as allowing the use of tools.

Here's a brief overview of each example:

1. `nlp_classroom_3players`: This example illustrates a simple case in which agents will speak in sequential order. 
2. `nlp_classroom_9players`: This is an NLP class example. Here, students can raise their hand when they have a question, and the professor can call on the students to let them ask. Students are only allowed to speak after they are called on.
3. `nlp_classroom_9players_group`: This example showcases group discussions. The professor may initiate a group discussion when needed, and students can exclusively interact with fellow students within the same group during the discussion.
4. `nlp_classroom_3players_withtool`: Students in this classroom can use Bing search API when listening to the class.
5. `math_problem_2players_tools`: A simple example demonstrating how two agents can use the WolframAlpha API to play an arithmetic game.
6. `prisoner_dilema`: The Prisoner's Dilemma is a thought experiment involving two rational agents facing a choice between cooperating for mutual benefit or betraying their partner for individual gain.
7. `db_diag`: The Chief DBA monitors (agents) the database system for anomalies and alerts memory and CPU agents if any are detected. They (agents) analyze root causes and suggest optimization solutions. The Chief DBA (agent) provides a diagnosis summary to the user, who can give instructions or evaluate the proposed solutions' effectiveness.
8. `sde_team`: In the SDE team, code writer, code tester and code reviewer collaborate on the code generation problem. 
9. `pokemon`:  This example intimates Pokemon game.
-->


# ๐ŸŒŸ Join Us!
AgentVerse is on a mission to revolutionize the multi-agent environment for large language models, and we're eagerly looking for passionate collaborators to join us on this exciting journey.

## Leaders
<a href="https://github.com/chenweize1998"><img src="https://avatars.githubusercontent.com/u/32613237?v=4" alt="Leader" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/yushengsu-thu"><img src="https://avatars.githubusercontent.com/u/11704492?v=4" alt="Leader" style="width:5%; border-radius: 50%;"/></a>

## Contributors
<a href="https://github.com/chanchimin"><img src="https://avatars.githubusercontent.com/u/75533759?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/libowen2121"><img src="https://avatars.githubusercontent.com/u/19970308?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/Xial-kotori"><img src="https://avatars.githubusercontent.com/u/53430452?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/Dr-Left"><img src="https://avatars.githubusercontent.com/u/39025643?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/minleminzui"><img src="https://avatars.githubusercontent.com/u/54172054?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/Tsuruko04"><img src="https://avatars.githubusercontent.com/u/129145574?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/kierangilliam"><img src="https://avatars.githubusercontent.com/u/18583882?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/zhouxh19"><img src="https://avatars.githubusercontent.com/u/17394639?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/tzw2698"><img src="https://avatars.githubusercontent.com/u/68865752?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/JetSquirrel"><img src="https://avatars.githubusercontent.com/u/20291255?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/Muiruriscode"><img src="https://avatars.githubusercontent.com/u/85177347?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>
<a href="https://github.com/eltociear"><img src="https://avatars.githubusercontent.com/u/22633385?v=4" alt="Contributor" style="width:5%; border-radius: 50%;"/></a>


## How Can You Contribute?
- **Issue and Pull-Request**: If you encounter any problems when use AgentVerse, you can propose the issue in English. Beisdes, you can also autonomously ask us to assign issue to you and send the PR (Please follow the [PULL_REQUEST_TEMPLATE](https://github.com/OpenBMB/AgentVerse/blob/main/PULL_REQUEST_TEMPLATE.md)) after you solve it. 
  
- **Code Development**: If you're an engineer, help us refine, optimize, and expand the current framework. We're always looking for talented developers to enhance our existing features and develop new modules.

- **Documentation and Tutorials**: If you have a knack for writing, help us improve our documentation, create tutorials, or write blog posts to make AgentVerse more accessible to the broader community.

- **Application Exploration**: If you're intrigued by multi-agent applications and are eager to experiment using AgentVerse, we'd be thrilled to support your journey and see what you create!

- **Feedback and Suggestions**: Use AgentVerse and provide us with feedback. Your insights can lead to potential improvements and ensure that our framework remains top-notch.

Also, if you're passionate about advancing the frontiers of multi-agent applications, become core AgentVerse team members, or are eager to dive deeper into agent research. Please reach out [AgentVerse Team](mailto:agentverse2@gmail.com?subject=[GitHub]%AgentVerse%20Project), and CC to [Weize Chen](mailto:chenweize1998@gmail.com?subject=[GitHub]%AgentVerse%20Project) and [Yusheng Su](mailto:yushengsu.thu@gmail.com?subject=[GitHub]%AgentVerse%20Project). We're keen to welcome motivated individuals like you to our team!


## Social Media and Community

- Twitter: https://twitter.com/Agentverse71134

- Discord: https://discord.gg/MjG3vzaT.

- Hugging Face: https://huggingface.co/spaces/AgentVerse/agentVerse.

# Star History

[![Star History Chart](https://api.star-history.com/svg?repos=OpenBMB/AgentVerse&type=Date)](https://star-history.com/#OpenBMB/AgentVerse&Date)


## Citation
If you find this repo helpful, feel free to cite us.
```
@article{chen2023agentverse,
  title={Agentverse: Facilitating multi-agent collaboration and exploring emergent behaviors in agents},
  author={Chen, Weize and Su, Yusheng and Zuo, Jingwei and Yang, Cheng and Yuan, Chenfei and Qian, Chen and Chan, Chi-Min and Qin, Yujia and Lu, Yaxi and Xie, Ruobing and others},
  journal={arXiv preprint arXiv:2308.10848},
  year={2023}
}
```

# Contact

AgentVerse Team: agentverse2@gmail.com

Project leaders:

- Weize Chen: chenweize1998@gmail.com

- [Yusheng Su](https://yushengsu-thu.github.io/): yushengsu.thu@gmail.com


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OpenBMB/AgentVerse",
    "name": "agentverse",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "AgentVerse Team",
    "author_email": "agentverse2@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3a/42/7fb7428ac75dad7c20507ddfdd76b1f428e57818fd3e121b908d7783dff4/agentverse-0.1.8.1.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\"> \ud83e\udd16 AgentVerse \ud83e\ude90 </h1>\n\n<!--\n<h3 align=\"center\">\n    <p>A Framework for Multi-LLM Environment Simulation</p>\n</h3>\n-->\n\n<p align=\"center\">\n    <a href=\"https://github.com/OpenBMB/AgentVerse/blob/main/LICENSE\">\n        <img alt=\"License: Apache2\" src=\"https://img.shields.io/badge/License-Apache_2.0-green.svg\">\n    </a>\n    <a href=\"https://www.python.org/downloads/release/python-3916/\">\n        <img alt=\"Python Version\" src=\"https://img.shields.io/badge/python-3.9+-blue.svg\">\n    </a>\n    <a href=\"https://github.com/OpenBMB/AgentVerse/actions/\">\n        <img alt=\"Build\" src=\"https://img.shields.io/github/actions/workflow/status/OpenBMB/AgentVerse/test.yml\">\n    </a>\n    <a href=\"https://github.com/psf/black\">\n        <img alt=\"Code Style: Black\" src=\"https://img.shields.io/badge/code%20style-black-black\">\n<!--     </a>\n    <a href=\"https://github.com/OpenBMB/AgentVerse/issues\">\n        <img alt=\"Contributions: Welcome\" src=\"https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat\">\n    </a> -->\n    <a href=\"https://huggingface.co/AgentVerse\">\n        <img alt=\"HuggingFace\" src=\"https://img.shields.io/badge/hugging_face-play-yellow\">\n    </a>\n    <a href=\"https://discord.gg/MjG3vzaT\">\n        <img alt=\"Discord\" src=\"https://img.shields.io/badge/AgentVerse-Discord-purple?style=flat\">\n    </a>\n    \n    \n</p>\n\n<p align=\"center\">\n<img src=\"./imgs/title.png\" width=\"512\">\n</p>\n\n<p align=\"center\">\n    \u3010English | <a href=\"README_zh.md\">Chinese</a>\u3011\n</p>\n\n**AgentVerse** is designed to facilitate the deployment of multiple LLM-based agents in various applications. AgentVerse primarily provides two frameworks: **task-solving** and **simulation**. \n\n- Task-solving: This framework assembles multiple agents as an automatic multi-agent system ([AgentVerse-Tasksolving](https://arxiv.org/pdf/2308.10848.pdf), [Multi-agent as system](https://arxiv.org/abs/2309.02427)) to collaboratively accomplish the corresponding tasks. \nApplications: software development system, consulting system, etc.\n\n<p align=\"center\">\n<img width=\"616\" alt=\"Screen Shot 2023-09-01 at 12 08 57 PM\" src=\"https://github.com/OpenBMB/AgentVerse/assets/11704492/6db1c907-b7fc-42f9-946c-89853a28f386\">\n</p>\n\n- Simulation: This framework allows users to set up custom environments to observe behaviors among, or interact with, multiple agents. \u26a0\ufe0f\u26a0\ufe0f\u26a0\ufe0f We're refactoring the code. If you require a stable version that exclusively supports simulation framework, you can use [`release-0.1`](https://github.com/OpenBMB/AgentVerse/tree/release-0.1) branch. Applications: game, social behavior research of LLM-based agents, etc.\n\n<p align=\"center\">\n<img width=\"616\" alt=\"Screen Shot 2023-10-16 at 10 53 49 PM\" src=\"https://github.com/OpenBMB/AgentVerse/assets/11704492/4102d1e2-3fe7-4656-aa2c-a218ce1f2c95\">\n</p>\n\n\n---\n\n\n# \ud83d\udcf0 What's New\n- [2023/10/17] We're super excited to share our open-source AI community hugging face: [`AgentVerse`](https://huggingface.co/spaces/AgentVerse/agentVerse). You are able to try out the two simulation applications, NLP Classroom and Prisoner's Dilemma,with your code of the openai API key and the openai organization. Have fun!\n\n- [2023/10/5] Re-factor our codebase to enable the deployment of both simulation and task-solving framework! We have placed the code for Minecraft example in the paper at the [`minecraft`](https://github.com/OpenBMB/AgentVerse/tree/minecraft) branch. Our tool-using example will soon be updated to the `main` branch. Stay tuned!\n\n- [2023/8/22] We're excited to share our paper [AgentVerse: Facilitating Multi-Agent Collaboration and Exploring Emergent Behaviors in Agents](https://arxiv.org/abs/2308.10848) that  illistrate the task-solving framework \nin detail of AgentVerse.\n\n- [2023/6/5] We are thrilled to present an array of [demos](#-simple-demo-video), including [NLP Classroom](#nlp-classroom), [Prisoner Dilemma](#prisoner-dilemma), [Software Design](#software-design), [Database Administrator](#database-administrator-dba), and a simple [H5 Pokemon Game](#pokemon) that enables the interaction with the characters in Pokemon! Try out these demos and have fun!\n- [2023/5/1] \ud83d\ude80 [AgentVerse](https://github.com/OpenBMB/AgentVerse) is officially launched!\n\n\n\n\n# \ud83d\uddd3 Coming Soon\n- [x] Code release of our [paper](https://arxiv.org/abs/2308.10848)\n- [x] Add support for local LLM (LLaMA, Vicunna, etc.)\n- [ ] Add documentation\n- [ ] Support more sophisticated memory for conversation history\n\n\n<!--\n\n## \ud83d\udc7e Simple Demo Video\n\nWe demonstrate the following cases that are expertly crafted by AgentVerse.\n\n\n#### NLP Classroom\nIn the NLP class, the professor and students engage in interactive communication. When students have a question, they raise their hands and patiently wait for the professor to call on them. Only after being called on by the professor, can students speak and ask their questions.\n\nUse the following command to launch the NLP Classroom example:\n```bash\npython agentverse_command/main_simulation_gui.py --task simulation/nlp_classroom_9players\n```\n\nhttps://github.com/OpenBMB/AgentVerse/assets/11704492/6ea07850-595e-4a28-a82e-f863011353c2\n\n\n#### Prisoner Dilemma\nA prisoner's Dilemma is a thought experiment that challenges two completely rational agents to a dilemma: they can cooperate with their partner for mutual benefit or betray their partner (\"defect\") for individual reward.\n\nUse the following command to launch the Prisoner Dilemma example:\n```bash\npython agentverse_command/main_simulation_gui.py --task simulation/prisoner_dilemma\n```\n\nhttps://github.com/OpenBMB/AgentVerse/assets/11704492/017c46e5-c738-4fca-9352-b008e2d518bd\n\n\n#### Software Design\nIn the Software Design example, a code writer, a code tester and a code reviewer collaborate on the code generation problem. Given a problem, the code writer first composes the code implementation. The code tester runs the unit tests and provides the feedback. The code viewer then generates a review. After collecting the test feedback and review, the code writer iteratively refines the code.\n\nUse the following command to launch the Software Design example:\n```bash\npython agentverse_command/main_simulation_gui.py --task simulation/sde_team/sde_team_2players\n```\n\nhttps://github.com/OpenBMB/AgentVerse/assets/11704492/5058066a-abee-490d-8659-b4e54661626a\n\n\n#### [Database Administrator (DBA)](https://github.com/TsinghuaDatabaseGroup/DB-GPT)\n\nIn the database diagnosis scenario, the Chief DBA monitors the system anomalies (e.g., slow queries, locks, crash down). If detected, the domain experts are alerted to analyze root causes, share insights, and suggest optimization solutions together. The Chief DBA then provides a summarized report to the user.\n\n```bash\npython agentverse_command/main_simulation_gui.py --task simulation/db_diag\n```\n\nhttps://github.com/OpenBMB/AgentVerse/assets/11704492/c633419d-afbb-47d4-bb12-6bb512e7af3a\n\n#### [Text Evaluation (ChatEval)](https://github.com/chanchimin/ChatEval)\nIn the context of the text evaluation scenario, we recommend users explore the [ChatEval](https://github.com/chanchimin/ChatEval) repo. They've implemented a multi-agent referee team on AgentVerse to assess the quality of text generated by different models. When given two distinct pieces of text, roles within ChatEval can autonomously debate the nuances and disparities, drawing upon their assigned personas, and subsequently provide their judgments. Experiments indicate that their referee team, enriched with diverse roles specified in [config.yaml](#2-configuring-the-agents), aligns more closely with human evaluations. This demo is built upon the [Fastchat](https://github.com/lm-sys/FastChat) repo, and we'd like to express our appreciation for their foundational work.\n\n\nhttps://github.com/OpenBMB/AgentVerse/assets/75533759/58f33468-f15b-4bac-ae01-8d0780019f85\n\n#### Pokemon\n**Currently available only in [`release-0.1`](https://github.com/OpenBMB/AgentVerse/tree/release-0.1)**. In the game, agents can walk around the game world, and interact with one another. As a player, you take on the role of an agent and can engage with others at any time. There are 6 characters in the Pok\u00e9mon environment who appeared in Pokemon Emerald: [May](https://bulbapedia.bulbagarden.net/wiki/May_(game)), [Professor Birch](https://bulbapedia.bulbagarden.net/wiki/Professor_Birch), [Steven Stone](https://bulbapedia.bulbagarden.net/wiki/Steven_Stone), [Maxie](https://bulbapedia.bulbagarden.net/wiki/Maxie), [Archie](https://bulbapedia.bulbagarden.net/wiki/Archie) and [Joseph](https://bulbapedia.bulbagarden.net/wiki/Mr._Stone). \n\nTo launch the Pokemon game, first launch a local server with the following command:\n```bash\nuvicorn pokemon_server:app --reload --port 10002\n```\nThen open another terminal in the project's root path and run the following command:\n```bash\ncd ui\n# If you do not have npm installed, you need to install it before running the following commands \n# https://docs.npmjs.com/downloading-and-installing-node-js-and-npm\n# We have tested on npm@9.6.4, node@20.0.0\nnpm install\nnpm run watch\n```\nWait for the compilation to complete, and have fun! (WASD for moving around, and SPACE for launching a conversation.)\n\nhttps://github.com/OpenBMB/AgentVerse/assets/11704492/4d07da68-f942-4205-b558-f155e95782e7\n\n-->\n\n<!--\n\n## Contents\n\n- [\u2728 Features](#-features)\n- [\ud83d\udcf0 What's New](#-whats-new)\n- [\ud83c\udf1f Join Us!](#-join-us)\n  - [How Can You Contribute?](#how-can-you-contribute)\n- [\ud83d\uddd3 Coming Soon](#-coming-soon)\n- [\ud83d\udc7e Simple Demo Video](#-simple-demo-video)\n    - [NLP Classroom](#nlp-classroom)\n    - [Prisoner Dilemma](#prisoner-dilemma)\n    - [Software Design](#software-design)\n    - [Database Administrator (DBA)](#database-administrator-dba)\n    - [Text Evaluation (ChatEval)](#text-evaluation-chateval)\n    - [Pokemon](#pokemon)\n- [Contents](#contents)\n- [\ud83d\ude80 Getting Started](#-getting-started)\n  - [Installation](#installation)\n  - [Simulation Example](#simulation)\n  - [Task-Solving Example](#task-solving-cli-example)\n- [\ud83d\udca1 Philosophy](#-philosophy)\n  - [Environment](#environment)\n  - [Agent](#agent)\n- [\u270d\ufe0f Customize Your Own Environment](#\ufe0f-customize-your-own-environment)\n  - [A Simple Example: Building a Classroom Environment](#a-simple-example-building-a-classroom-environment)\n      - [1. Creating a Task Directory and Configuring the Environment](#1-creating-a-task-directory-and-configuring-the-environment)\n      - [2. Configuring the Agents](#2-configuring-the-agents)\n      - [3. Writing an Output Parser](#3-writing-an-output-parser)\n  - [Customization Guide for More Complex Environments](#customization-guide-for-more-complex-environments)\n- [\ud83d\udd0e Examples](#-examples)\n- [Star History](#star-history)\n- [Citation](#citation)\n- [Contact](#contact)\n\n-->\n\n# Contents\n- [\ud83d\udcf0 What's New](#-whats-new)\n- [\ud83d\uddd3 Coming Soon](#-coming-soon)\n- [Contents](#contents)\n- [\ud83d\ude80 Getting Started](#-getting-started)\n  - [Installation](#installation)\n  - [Simulation CLI Example](#simulation)\n  - [Task-Solving CLI Example](#task-solving)\n- [\ud83c\udf1f Join Us!](#-join-us)\n  - [How Can You Contribute?](#how-can-you-contribute)\n- [Social Media and Community](#social-media-and-community)\n- [Star History](#star-history)\n- [Citation](#citation)\n- [Contact](#contact)\n\n\n\n\n# \ud83d\ude80 Getting Started\n\n## Installation\n\n**Manually Install (Recommended!)**\n```bash\ngit clone https://github.com/OpenBMB/AgentVerse.git --depth 1\ncd AgentVerse\npython setup.py develop\n```\nSome users have reported problems installing the `orjson` required by `gradio`. One simple workaround is to install it with Anaconda `conda install -c conda-forge orjson`.\n\n**Install with pip**\n\nOr you can install through pip\n```bash\npip install -U agentverse\n```\n\n\nYou also need to export your OpenAI API key as follows\uff1a\n```bash\n# Export your OpenAI API key\nexport OPENAI_API_KEY=\"your_api_key_here\"\n# Or if you are using Azure\nexport AZURE_OPENAI_API_KEY=\"your_api_key_here\"\nexport AZURE_OPENAI_API_BASE=\"your_api_base_here\"\n```\n\nIf you want use Azure OpenAI services, pleas export your Azure OpenAI key and OpenAI API base as follows\uff1a\n```bash\nexport AZURE_OPENAI_API_KEY=\"your_api_key_here\"\nexport AZURE_OPENAI_API_BASE=\"your_api_base_here\"\n```\n\nIf you want to use the tools provided by BMTools, you need to install BMTools as follows:\n```bash\ngit clone git+https://github.com/OpenBMB/BMTools.git\ncd BMTools\npip install -r requirements.txt\npython setup.py develop\n```\n\n## Simulation\n\n### Framework Required Modules \n```\n- agentverse \n  - agents\n    - simulation_agent\n  - environments\n    - simulation_env\n```\n\n### CLI Example\n\nYou can create a multi-agent environments provided by us. Using the classroom scenario as an example. In this scenario, there are nine agents, one playing the role of a professor and the other eight as students.\n\n```shell\nagentverse-simulation --task simulation/nlp_classroom_9players\n```\n\n### GUI Example (Local)\n\nWe also provide a local website demo for this environment. You can launch it with\n\n```shell\nagentverse-simulation-gui --task simulation/nlp_classroom_9players\n```\nAfter successfully launching the local server, you can visit [http://127.0.0.1:7860/](http://127.0.0.1:7860/) to view the classroom environment.\n\n\n## Task-Solving \n\n\n### Framework Required Modules \n```\n- agentverse \n  - agents\n    - simulation_env\n  - environments\n    - tasksolving_env\n```\n\n### CLI Example\n\nTo run the experiments with the task-solving environment proposed in our [paper](https://arxiv.org/abs/2308.10848), you can use the following command:\n\nTo run AgentVerse on a benchmark dataset, you can try\n```shell\n# Run the Humaneval benchmark using gpt-3.5-turbo (config file `agentverse/tasks/tasksolving/humaneval/gpt-3.5/config.yaml`)\nagentverse-benchmark --task tasksolving/humaneval/gpt-3.5 --dataset_path data/humaneval/test.jsonl --overwrite\n```\n\nTo run AgentVerse on a specific problem, you can try\n```shell\n# Run a single query (config file `agentverse/tasks/tasksolving/brainstorming/gpt-3.5/config.yaml`). The task is specified in the config file.\nagentverse-tasksolving --task tasksolving/brainstorming\n```\n\nYou can take a look at `agentverse/tasks/tasksolving` for more experiments we have done in our paper.\n\n\n# AgentVerse Showcases\n\n## Simulation Showcases\nRefer to [simulation showcases](README_simulation_cases.md)\n\n## Task-Solving Showcases\nRefer to [tasksolving showcases](README_tasksolving_cases.md)\n\n\n\n<!--\n## \ud83d\udca1 Philosophy\n\n### Environment\n\nAt the core of our framework is the environment, which plays a crucial role in enabling researchers to study the behavior of agents under different conditions. We believe that the environment should be flexible and extensible, allowing researchers to easily customize it to fit their needs. To achieve this, we have abstracted the environment into five rule components, and implementing different environments is actually implementing different rules:\n\n- **Describer**: This component provides a description of the environment at each turn for each agent. You can customize the describer to define the specific requirements of their environment, such as the agents with whom an agent can interact.\n- **Order**: This component defines the order in which agents take actions within the environment. You can customize the order to reflect the desired interaction between agents. We provide several basic order options, including `random`, `sequential`, and `concurrent` (in which all agents take an action in each turn).\n- **Selector**: This component selects the valid messages generated by agents. Sometimes agents may generate invalid responses, and the selector is used to filter out unexpected results.\n- **Updater**: This component updates the memory of each agent. In certain cases, the response generated by one agent should not be seen by all agents (e.g., if agents are in different rooms). For each response, the updater updates only the agents who can see it.\n- **Visibility**: This component maintains the list of agents that each agent can see throughout the environment's changes. For example, when an agent moves from one room to another, the list of visible agents of each agent should be updated by `visibility`.\n\nBy abstracting the environment into these five components, we have created a highly flexible and extensible framework that enables researchers to easily build and customize their own multi-agent environments.\n\n### Agent\n\nAnother fundamental component is the agent. Currently we provide two types of agents: **ConversationAgent** and **ToolAgent**. You can also customize your own agent by inheriting BaseAgent class (tutorial coming soon).\n\n-->\n\n\n\n\n\n<!--\n\n## \u270d\ufe0f Customize Your Own Environment\n\nWe have provided several examples in the `agentverse/tasks` directory. To customize your environment, you should\n\n1. Create a task directory in `agentverse/tasks` \n2. Write the configuration file\n3. Write the output parser that parses the response of your agents.\n4. Add your parser in `agentverse/tasks/__init__.py`\n\nWe will use a simple example in `agentverse/tasks/nlp_classroom_3players` to illustrate the procedure.\n\n### A Simple Example: Building a Classroom Environment\n\nTo illustrate how to customize your environment, we'll use a simple example of building a classroom environment where one agent is the professor, one is the student, and one is the teaching assistant.\n\n##### 1. Creating a Task Directory and Configuring the Environment\n\nFirst, we need to create a task directory and write our configuration file for the environment. In the `agentverse/tasks` directory, create a new directory called `nlp_classroom_3players`. Inside this directory, create a `config.yaml` file and write the following configuration:\n\n```yaml\n# config.yaml\nenvironment:\n  env_type: basic\t\t\t\t# Use the basic environment provided in AgentVerse\n  max_turns: 10\t\t\t\t\t# Specify the maximum number of dialogue turns\n  rule:\n    order:\n      type: sequential\t# Use the sequential order\n    visibility:\n      type: all\t\t\t\t\t# Each message can be seen by all agents\n    selector:\n      type: basic\t\t\t\t# Basic selector (do not select)\n    updater:\n      type: basic\t\t\t\t# Basic updater (update the message to all agents)\n    describer:\n      type: basic\t\t\t\t# Basic describer (no description)\n```\n\nThis configuration specifies that we will use the basic environment provided in AgentVerse, with a maximum of 10 dialogue turns. We'll use the sequential order, with all messages visible to all agents. We won't be using any selectors, our updater will update the messages to all the agents and our describer will provide no description.\n\n##### 2. Configuring the Agents\n\nNext, we'll configure the agents. In the `config.yaml` file, we'll add the configuration for each agent. Here's an example configuration for the professor:\n\n```yaml\n# config.yaml\nagents:\n  -\n    agent_type: conversation\n    name: Professor Micheal\t\t# Name of the agent\n    role_description: You are Prof. Micheal, ...\t# Description of the agent\n    memory: \n      memory_type: chat_history\t\t# Will store all the chat history\n    prompt_template: *professor_prompt\n    llm:\n      llm_type: text-davinci-003    # Will use OpenAICompletion LLM\n      model: text-davinci-003       # The arguments passed to the api call\n      temperature: 0.7\n      max_tokens: 250\n```\n\nIn this example, we'll use the `conversation` agent type. We've given the agent a name and a description, and we'll store the chat history in memory. We've also provided a prompt template with placeholders marked as ${placeholder}. These will be instantiated by the `_fill_prompt_template` method of the agent.\n\n##### 3. Writing an Output Parser\n\nThe next step is to write a simple parser for your agent's response. Because you may have specified the output format in your prompt template, you need to provide a corresponding parser. In this example, we inform the model to output in the following format in our prompt template\n\n```\nAction: Speak\nAction Input: (the content)\n```\n\nWe'll write a parser to extract the content from the agent's response. Refer to the code for more details. We've decorated our parser function with `@output_parser_registry.register('classroom_parser')` to register it with our framework. Finally, we import our parser in `agentverse/tasks/__init__.py`.\n\nWith these steps, we've successfully built a simple classroom environment and customized it for our needs.\n\n### Customization Guide for More Complex Environments\n\nWhile we provide a basic framework for building environments with our five rule components, more complex environments may require further customization. A detailed documentation and tutorial is coming soon. Here we briefly introduce some steps you can take to customize your environment:\n\n1. **Customize the five rule components**. Each rule component has an interface, allowing you to customize its behavior to suit your specific needs. It's important to note that these components are not necessarily independent and can interact through the `rule_params` dictionary in the environment. You can create your own rule components and integrate them with the existing ones to build more complex interactions between agents.\n2. **Customize the environment itself**. Our `basic` environment provides a default execution order for the five rule components that is suitable for most cases, but you can inherit the `BaseEnvironment` class and write your own `run` method to implement a more sophisticated execution order.\n3. **Customize the agent**. Depending on your specific use case, you may also need to inherit the `BaseAgent` class. For example, you may want to use your local LLM as your agents or create agents with specialized knowledge or skills.\n\n-->\n\n\n<!--\n\n## \ud83d\udd0e Examples\n\nCurrently, we offer some simple examples in the `agentverse/tasks` directory, each demonstrating different possibilities of our framework. While the performance of these examples may not be optimal due to limited prompt engineering, they are intended to showcase the capabilities of our framework, such as allowing the use of tools.\n\nHere's a brief overview of each example:\n\n1. `nlp_classroom_3players`: This example illustrates a simple case in which agents will speak in sequential order. \n2. `nlp_classroom_9players`: This is an NLP class example. Here, students can raise their hand when they have a question, and the professor can call on the students to let them ask. Students are only allowed to speak after they are called on.\n3. `nlp_classroom_9players_group`: This example showcases group discussions. The professor may initiate a group discussion when needed, and students can exclusively interact with fellow students within the same group during the discussion.\n4. `nlp_classroom_3players_withtool`: Students in this classroom can use Bing search API when listening to the class.\n5. `math_problem_2players_tools`: A simple example demonstrating how two agents can use the WolframAlpha API to play an arithmetic game.\n6. `prisoner_dilema`: The Prisoner's Dilemma is a thought experiment involving two rational agents facing a choice between cooperating for mutual benefit or betraying their partner for individual gain.\n7. `db_diag`: The Chief DBA monitors (agents) the database system for anomalies and alerts memory and CPU agents if any are detected. They (agents) analyze root causes and suggest optimization solutions. The Chief DBA (agent) provides a diagnosis summary to the user, who can give instructions or evaluate the proposed solutions' effectiveness.\n8. `sde_team`: In the SDE team, code writer, code tester and code reviewer collaborate on the code generation problem. \n9. `pokemon`:  This example intimates Pokemon game.\n-->\n\n\n# \ud83c\udf1f Join Us!\nAgentVerse is on a mission to revolutionize the multi-agent environment for large language models, and we're eagerly looking for passionate collaborators to join us on this exciting journey.\n\n## Leaders\n<a href=\"https://github.com/chenweize1998\"><img src=\"https://avatars.githubusercontent.com/u/32613237?v=4\" alt=\"Leader\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/yushengsu-thu\"><img src=\"https://avatars.githubusercontent.com/u/11704492?v=4\" alt=\"Leader\" style=\"width:5%; border-radius: 50%;\"/></a>\n\n## Contributors\n<a href=\"https://github.com/chanchimin\"><img src=\"https://avatars.githubusercontent.com/u/75533759?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/libowen2121\"><img src=\"https://avatars.githubusercontent.com/u/19970308?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/Xial-kotori\"><img src=\"https://avatars.githubusercontent.com/u/53430452?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/Dr-Left\"><img src=\"https://avatars.githubusercontent.com/u/39025643?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/minleminzui\"><img src=\"https://avatars.githubusercontent.com/u/54172054?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/Tsuruko04\"><img src=\"https://avatars.githubusercontent.com/u/129145574?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/kierangilliam\"><img src=\"https://avatars.githubusercontent.com/u/18583882?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/zhouxh19\"><img src=\"https://avatars.githubusercontent.com/u/17394639?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/tzw2698\"><img src=\"https://avatars.githubusercontent.com/u/68865752?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/JetSquirrel\"><img src=\"https://avatars.githubusercontent.com/u/20291255?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/Muiruriscode\"><img src=\"https://avatars.githubusercontent.com/u/85177347?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n<a href=\"https://github.com/eltociear\"><img src=\"https://avatars.githubusercontent.com/u/22633385?v=4\" alt=\"Contributor\" style=\"width:5%; border-radius: 50%;\"/></a>\n\n\n## How Can You Contribute?\n- **Issue and Pull-Request**: If you encounter any problems when use AgentVerse, you can propose the issue in English. Beisdes, you can also autonomously ask us to assign issue to you and send the PR (Please follow the [PULL_REQUEST_TEMPLATE](https://github.com/OpenBMB/AgentVerse/blob/main/PULL_REQUEST_TEMPLATE.md)) after you solve it. \n  \n- **Code Development**: If you're an engineer, help us refine, optimize, and expand the current framework. We're always looking for talented developers to enhance our existing features and develop new modules.\n\n- **Documentation and Tutorials**: If you have a knack for writing, help us improve our documentation, create tutorials, or write blog posts to make AgentVerse more accessible to the broader community.\n\n- **Application Exploration**: If you're intrigued by multi-agent applications and are eager to experiment using AgentVerse, we'd be thrilled to support your journey and see what you create!\n\n- **Feedback and Suggestions**: Use AgentVerse and provide us with feedback. Your insights can lead to potential improvements and ensure that our framework remains top-notch.\n\nAlso, if you're passionate about advancing the frontiers of multi-agent applications, become core AgentVerse team members, or are eager to dive deeper into agent research. Please reach out [AgentVerse Team](mailto:agentverse2@gmail.com?subject=[GitHub]%AgentVerse%20Project), and CC to [Weize Chen](mailto:chenweize1998@gmail.com?subject=[GitHub]%AgentVerse%20Project) and [Yusheng Su](mailto:yushengsu.thu@gmail.com?subject=[GitHub]%AgentVerse%20Project). We're keen to welcome motivated individuals like you to our team!\n\n\n## Social Media and Community\n\n- Twitter: https://twitter.com/Agentverse71134\n\n- Discord: https://discord.gg/MjG3vzaT.\n\n- Hugging Face: https://huggingface.co/spaces/AgentVerse/agentVerse.\n\n# Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=OpenBMB/AgentVerse&type=Date)](https://star-history.com/#OpenBMB/AgentVerse&Date)\n\n\n## Citation\nIf you find this repo helpful, feel free to cite us.\n```\n@article{chen2023agentverse,\n  title={Agentverse: Facilitating multi-agent collaboration and exploring emergent behaviors in agents},\n  author={Chen, Weize and Su, Yusheng and Zuo, Jingwei and Yang, Cheng and Yuan, Chenfei and Qian, Chen and Chan, Chi-Min and Qin, Yujia and Lu, Yaxi and Xie, Ruobing and others},\n  journal={arXiv preprint arXiv:2308.10848},\n  year={2023}\n}\n```\n\n# Contact\n\nAgentVerse Team: agentverse2@gmail.com\n\nProject leaders:\n\n- Weize Chen: chenweize1998@gmail.com\n\n- [Yusheng Su](https://yushengsu-thu.github.io/): yushengsu.thu@gmail.com\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A versatile framework that streamlines the process of creating custom multi-agent environments for large language models (LLMs).",
    "version": "0.1.8.1",
    "project_urls": {
        "Homepage": "https://github.com/OpenBMB/AgentVerse"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b0a2ae2e091dc482feb31a7ead6a00e646941b3054d8024e8205a91540ffcbc",
                "md5": "ba5908f493f29d52be75eb65e06ab73f",
                "sha256": "f424a1622a710caae6fe7ea7f308ceef9d600f95401f556445f7988106cb5cbb"
            },
            "downloads": -1,
            "filename": "agentverse-0.1.8.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ba5908f493f29d52be75eb65e06ab73f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 300778,
            "upload_time": "2023-10-27T14:16:53",
            "upload_time_iso_8601": "2023-10-27T14:16:53.685560Z",
            "url": "https://files.pythonhosted.org/packages/2b/0a/2ae2e091dc482feb31a7ead6a00e646941b3054d8024e8205a91540ffcbc/agentverse-0.1.8.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a427fb7428ac75dad7c20507ddfdd76b1f428e57818fd3e121b908d7783dff4",
                "md5": "3cffabc4062b20a395f112f3cb9f78be",
                "sha256": "dbaa47af8a07cd8bdab266ee101d76fb291ba2a7c096b65a746069a7accef26c"
            },
            "downloads": -1,
            "filename": "agentverse-0.1.8.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3cffabc4062b20a395f112f3cb9f78be",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4364186,
            "upload_time": "2023-10-27T14:16:57",
            "upload_time_iso_8601": "2023-10-27T14:16:57.471737Z",
            "url": "https://files.pythonhosted.org/packages/3a/42/7fb7428ac75dad7c20507ddfdd76b1f428e57818fd3e121b908d7783dff4/agentverse-0.1.8.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-27 14:16:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OpenBMB",
    "github_project": "AgentVerse",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pyyaml",
            "specs": []
        },
        {
            "name": "fastapi",
            "specs": [
                [
                    "==",
                    "0.95.1"
                ]
            ]
        },
        {
            "name": "uvicorn",
            "specs": []
        },
        {
            "name": "py3langid",
            "specs": []
        },
        {
            "name": "iso-639",
            "specs": []
        },
        {
            "name": "openai",
            "specs": [
                [
                    "==",
                    "0.27.8"
                ]
            ]
        },
        {
            "name": "opencv-python",
            "specs": [
                [
                    "==",
                    "4.8.0.76"
                ]
            ]
        },
        {
            "name": "gradio",
            "specs": []
        },
        {
            "name": "httpx",
            "specs": [
                [
                    "==",
                    "0.25.0"
                ]
            ]
        },
        {
            "name": "astunparse",
            "specs": []
        },
        {
            "name": "langchain",
            "specs": [
                [
                    "==",
                    "0.0.157"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": []
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    "==",
                    "1.10.7"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    "==",
                    "4.5.0"
                ]
            ]
        },
        {
            "name": "typing-inspect",
            "specs": [
                [
                    "==",
                    "0.8.0"
                ]
            ]
        },
        {
            "name": "colorlog",
            "specs": []
        },
        {
            "name": "rapidfuzz",
            "specs": []
        },
        {
            "name": "spacy",
            "specs": []
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.6"
                ]
            ]
        },
        {
            "name": "fschat",
            "specs": []
        },
        {
            "name": "tiktoken",
            "specs": [
                [
                    "==",
                    "0.5.1"
                ]
            ]
        }
    ],
    "lcname": "agentverse"
}
        
Elapsed time: 0.31404s