# MetaGPT **Repository Path**: jkException/MetaGPT ## Basic Information - **Project Name**: MetaGPT - **Description**: 多智能体框架 MetaGPT 可以使 GPT 以软件公司的形式工作,协作处理更复杂的任务 - **Primary Language**: Python - **License**: MIT - **Default Branch**: main - **Homepage**: https://www.oschina.net/p/metagpt - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 23 - **Created**: 2023-09-22 - **Last Updated**: 2023-09-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MetaGPT: The Multi-Agent Framework
Assign different roles to GPTs to form a collaborative software entity for complex tasks.
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. Software Company Multi-Role Schematic (Gradually Implementing)
## MetaGPT's Abilities https://github.com/geekan/MetaGPT/assets/34952977/34345016-5d13-489d-b9f9-b82ace413419 ## 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  It costs approximately **$0.2** (in GPT-4 API fees) to generate one example with analysis and design, and around **$2.0** for a full project. ## Installation ### Installation Video Guide - [Matthew Berman: How To Install MetaGPT - Build A Startup With One Prompt!!](https://youtu.be/uT75J_KG_aY) ### Traditional Installation ```bash # Step 1: Ensure that NPM is installed on your system. Then install mermaid-js. (If you don't have npm in your computer, please go to the Node.js offical website to install Node.js https://nodejs.org/ and then you will have npm tool in your computer.) 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 pip install -e. ``` **Note:** - If already have Chrome, Chromium, or MS Edge installed, you can skip downloading Chromium by setting the environment variable `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` to `true`. - Some people are [having issues](https://github.com/mermaidjs/mermaid.cli/issues/15) installing this tool globally. Installing it locally is an alternative solution, ```bash npm install @mermaid-js/mermaid-cli ``` - don't forget to the configuration for mmdc in config.yml ```yml PUPPETEER_CONFIG: "./config/puppeteer-config.json" MMDC: "./node_modules/.bin/mmdc" ``` - if `pip install -e.` fails with error `[Errno 13] Permission denied: '/usr/local/lib/python3.11/dist-packages/test-easy-install-13129.write-test'`, try instead running `pip install -e. --user` - To convert Mermaid charts to SVG, PNG, and PDF formats. In addition to the Node.js version of Mermaid-CLI, you now have the option to use Python version Playwright, pyppeteer or mermaid.ink for this task. - Playwright - **Install Playwright** ```bash pip install playwright ``` - **Install the Required Browsers** to support PDF conversion, please install Chrominum. ```bash playwright install --with-deps chromium ``` - **modify `config.yaml`** uncomment MERMAID_ENGINE from config.yaml and change it to `playwright` ```yaml MERMAID_ENGINE: playwright ``` - pyppeteer - **Install pyppeteer** ```bash pip install pyppeteer ``` - **Use your own Browsers** pyppeteer alow you use installed browsers, please set the following envirment ```bash export PUPPETEER_EXECUTABLE_PATH = /path/to/your/chromium or edge or chrome ``` please do not use this command to install browser, it is too old ```bash pyppeteer-install ``` - **modify `config.yaml`** uncomment MERMAID_ENGINE from config.yaml and change it to `pyppeteer` ```yaml MERMAID_ENGINE: pyppeteer ``` - mermaid.ink - **modify `config.yaml`** uncomment MERMAID_ENGINE from config.yaml and change it to `ink` ```yaml MERMAID_ENGINE: ink ``` Note: this method does not support pdf export. ### Installation by Docker ```bash # Step 1: Download metagpt official image and prepare config.yaml docker pull metagpt/metagpt:v0.3.1 mkdir -p /opt/metagpt/{config,workspace} docker run --rm metagpt/metagpt:v0.3.1 cat /app/metagpt/config/config.yaml > /opt/metagpt/config/key.yaml vim /opt/metagpt/config/key.yaml # Change the config # Step 2: Run metagpt demo with container docker run --rm \ --privileged \ -v /opt/metagpt/config/key.yaml:/app/metagpt/config/key.yaml \ -v /opt/metagpt/workspace:/app/metagpt/workspace \ metagpt/metagpt:v0.3.1 \ python startup.py "Write a cli snake game" # You can also start a container and execute commands in it docker run --name metagpt -d \ --privileged \ -v /opt/metagpt/config/key.yaml:/app/metagpt/config/key.yaml \ -v /opt/metagpt/workspace:/app/metagpt/workspace \ metagpt/metagpt:v0.3.1 docker exec -it metagpt /bin/bash $ python startup.py "Write a cli snake game" ``` The command `docker run ...` do the following things: - Run in privileged mode to have permission to run the browser - Map host directory `/opt/metagpt/config` to container directory `/app/metagpt/config` - Map host directory `/opt/metagpt/workspace` to container directory `/app/metagpt/workspace` - Execute the demo command `python startup.py "Write a cli snake game"` ### Build image by yourself ```bash # You can also build metagpt image by yourself. git clone https://github.com/geekan/MetaGPT.git cd MetaGPT && docker build -t metagpt:custom . ``` ## 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` ```bash # 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://