🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming https://atoms.dev/
Find a file
geekan 37902e4e71
Merge pull request #16 from sablin39/main
Adding a Dockerfile for docker implementation
2023-07-09 21:47:59 +08:00
config support azure via openai demo 2023-07-07 14:00:43 +08:00
docs Merge pull request #12 from eltociear/add_ja-readme 2023-07-07 12:58:55 +08:00
examples support streaming. not enable yet. 2023-07-06 00:01:47 +08:00
metagpt 兼容非git clone的直接下载用户 2023-07-08 23:01:32 +08:00
tests support azure via openai demo 2023-07-07 13:58:04 +08:00
.gitignore move scripts to docs 2023-07-05 22:07:43 +08:00
Dockerfile add cahce removal commands 2023-07-09 18:06:36 +08:00
LICENSE Create LICENSE 2023-06-30 17:58:37 +08:00
README.md Merge branch 'main' of github.com:sablin39/MetaGPT-docker into main 2023-07-09 18:09:43 +08:00
requirements.txt update requirements 2023-07-05 19:39:00 +08:00
setup.py check mmdc via running in case of setup failed. 2023-07-04 11:09:26 +08:00
startup.py using streaming api now. 2023-07-06 11:14:50 +08:00

MetaGPT: Multi-Agent Meta Programming Framework

MetaGPT logo: Enable GPT to work in software company, collaborating to tackle more complex tasks.

Assign different roles to GPTs to form a collaborative software entity for complex tasks.

CN doc EN doc JA doc Discord Follow License: MIT roadmap roadmap Twitter Follow

  1. MetaGPT takes a one line requirement as input and outputs user stories / competitive analysis / requirements / data structures / APIs / documents, etc.
  2. Internally, MetaGPT includes product managers / architects / project managers / engineers. It provides the entire process of a software company along with carefully orchestrated SOPs.
    1. Code = SOP(Team) is the core philosophy. We materialize SOP and apply it to teams composed of LLMs.

A software company consists of LLM-based roles

Software Company Multi-Role Schematic (Gradually Implementing)

Examples (fully generated by GPT-4)

For example, if you type python startup.py "Design a RecSys like Toutiao", you would get many outputs, one of them is data & api design

Jinri Toutiao Recsys Data & API Design

It requires around $0.2 (GPT-4 api's costs) to generate one example with analysis and design, around $2.0 to a full project.

Installation

# Step 1: Ensure that NPM is installed on your system. Then install mermaid-js.
npm --version
sudo npm install -g @mermaid-js/mermaid-cli

# Step 2: Ensure that Python 3.9+ is installed on your system. You can check this by using:
python --version

# Step 3: Clone the repository to your local machine, and install it.
git clone https://github.com/geekan/metagpt
cd metagpt
python setup.py install

Configuration

  • Configure your OPENAI_API_KEY in any of config/key.yaml / config/config.yaml / env
  • Priority order: config/key.yaml > config/config.yaml > env
# Copy the configuration file and make the necessary modifications.
cp config/config.yaml config/key.yaml
Variable Name config/key.yaml env
OPENAI_API_KEY # Replace with your own key OPENAI_API_KEY: "sk-..." export OPENAI_API_KEY="sk-..."
OPENAI_API_BASE # Optional OPENAI_API_BASE: "https://<YOUR_SITE>/v1" export OPENAI_API_BASE="https://<YOUR_SITE>/v1"

Docker Setup

You can also use docker to setup MetaGPT.

cd metagpt
docker build --network host -t metagpt:<version> .

There are some changes of mirrors in the dockerfile, for users outside mainland China, feel free to modify or delete them :)

You can also pull the image from dockerhub via docker pull sablin39/metagpt:<TAG>.

To run the docker image, you can use the following command.

docker run -it -v <MetaGPT-config-dir>:/app/metagpt/config -v <Workspace-dir>:/app/metagpt/workspace metagpt:<version> <command>

This command mounts the config and workspace folder in the host machine. You should use absolute directory of these folders.

Tutorial: Initiating a startup

python startup.py "Write a cli snake game"

After running the script, you can find your new project in the workspace/ directory.

Code walkthrough

from metagpt.software_company import SoftwareCompany
from metagpt.roles import ProjectManager, ProductManager, Architect, Engineer

async def startup(idea: str, investment: float = 3.0, n_round: int = 5):
    """Run a startup. Be a boss."""
    company = SoftwareCompany()
    company.hire([ProductManager(), Architect(), ProjectManager(), Engineer()])
    company.invest(investment)
    company.start_project(idea)
    await company.run(n_round=n_round)

You can check examples for more details on single role (with knowledge base) and LLM only examples.

Contact Information

If you have any questions or feedback about this project, please feel free to contact us. We highly appreciate your suggestions!

We will respond to all questions within 2-3 business days.

Demo

https://github.com/geekan/MetaGPT/assets/2707039/5e8c1062-8c35-440f-bb20-2b0320f8d27d