Skip to main content

package for research community simulation

Project description

sotopia

Research Town: Simulator of Research Community

Python 3.10 GitHub pull request pre-commit bear-ified Code style: black Github Action Checked with mypy

Arxiv Discord WeChat codecov

Introduction

Research Town is a multi-agent platform designed for studying community-level automatic research. To achieve community-based simulation, it defines:

  1. 🤖 Researcher: LLM research agents capable of skills such as reading papers, writing papers, discussing ideas, rebutting arguments, and writing reviews.
  2. 🎩 Environments: Multi-agent environments, similar to virtual study rooms, where research agents collaborate on tasks like idea discussion, rebuttal writing, or paper writing.
  3. ⚙️ Engines: Finite-state machines that manage agent involvement in environments and determine the next steps after task completion. For instance, engines guide agents coming out of idea discussion environment to paper writing environment and help select suitable agents to work together.

Get started

Install from pip

You can install research_town from pypi to use it as a package:

pip install research_town

Install from scratch

Use a virtual environment, e.g. with anaconda3:

conda create -n research_town python=3.10
conda activate research_town
curl -sSL https://install.python-poetry.org | python3

To run examples provided in the examples:

poetry install --extras "retriever collector logger"

To develop the UI part (both frontend and backend):

cd frontend
npm install
npm start
cd backend
uvicorn main:app --reload

Configure API keys

OpenAI key is required to run the code. Please set the environment variable OPENAI_API_KEY to your key. The recommend way is to add the key to the conda environment:

conda env config vars set OPENAI_API_KEY=your_key

For some experiments, TogetherAI key is required to run the code. Please set the environment variable TOGETHERAI_API_KEY to your key (notice: not TOGETHER_API_KEY). The recommend way is to add the key to the conda environment:

conda env config vars set TOGETHER_API_KEY=your_key

Developing

Install dev options

Follow the installation instruction above and then, instead of running python -m pip install -e ., run the following commands:

python -m pip install -e ".[dev]"
mypy --install-types --non-interactive research_town
python -m pip install pre-commit
pre-commit install

The installation of pre-commit would avoid formatting error and large file injects into github commits.

New branch for each feature

git checkout -b feature/feature-name and PR to main branch.

Before committing

Run poetry run pytest to make sure all tests pass (this will ensure dynamic typing passed with beartype) and poetry run mypy --config-file pyproject.toml . to check static typing. (You can also run pre-commit run --all-files to run all checks)

Check github action result

Check the github action result to make sure all tests pass. If not, fix the errors and push again.

Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

research_town-0.0.1b1.tar.gz (38.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

research_town-0.0.1b1-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

Details for the file research_town-0.0.1b1.tar.gz.

File metadata

  • Download URL: research_town-0.0.1b1.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.7.3 Darwin/22.6.0

File hashes

Hashes for research_town-0.0.1b1.tar.gz
Algorithm Hash digest
SHA256 e4844f43471f84bf23098bad4cd6bcfa5c9dd49b091cff886f778f80813f772d
MD5 6c68358b5c29700bc6a927344eaaf2f1
BLAKE2b-256 ad7df365ff89eebbc4df91cf4f77efea94aa2e9a0c09bcb48245f281808939d4

See more details on using hashes here.

File details

Details for the file research_town-0.0.1b1-py3-none-any.whl.

File metadata

  • Download URL: research_town-0.0.1b1-py3-none-any.whl
  • Upload date:
  • Size: 48.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.7.3 Darwin/22.6.0

File hashes

Hashes for research_town-0.0.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3f4bef401a73033e3a8a7d6212ae83589fcd273d81e72b3f4ae081688793637
MD5 71dec24c24c021df22eabefcdad52f7c
BLAKE2b-256 e4852be3fcf3eb9b451666610de205f0b2123aaf9f5456de3752a0dd76948f43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page