Coder Social home page Coder Social logo

metagpt's Introduction

MetaGPT: The Multi-Role Meta Programming Framework

English / δΈ­ζ–‡

Currently, we have managed to enable GPT to work in software company, collaborating to tackle more complex tasks.

  1. The team can handle Boss's one line Requirement cooperate and generate user stories / competetive analysis / requirements / data structures / apis / files etc.
  2. The team consists of product manager / architect / project manager / engineer, it provides the full process of a software company.

A software company consists of LLM-based roles

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 Python 3.9+ is installed on your system. You can check this by using:
python --version

# Step 2: Ensure that NPM is installed on your system. You can check this by using:
npm --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"

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: str = '$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.

Demo

demo-cli-blackjack-compress.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.