HomeAI News
MetaGPT exploded out of the circle! You can be a boss with just $2, GitHub raked in 11.2k stars, and the AI ​​​​agent "all-rounder" was born
191

MetaGPT exploded out of the circle! You can be a boss with just $2, GitHub raked in 11.2k stars, and the AI ​​​​agent "all-rounder" was born

Hayo News
Hayo News
August 7th, 2023
View OriginalTranslated by Google
Just look at MetaGPT to see how hot AI agents are. A project that can make you a boss with 2 dollars, GitHub has garnered 11.2k stars.

Intelligent body is the future!

Recently, another AI agent project, MetaGPT, has exploded and gained 11.2k stars on GitHub in just one month.

This is a multi-agent framework capable of playing different roles, an engineer, product manager, architect and project manager.

Similar to AutoGPT, but tailored for product requirements, design, competitive analysis, API, and documentation.

Address: https://github.com/geekan/MetaGPT

The most important thing is that it can output the entire process of the software company and the well-arranged SOP by only inputting a sentence from the boss.

Among them, Code = SOP(Team) is the core philosophy. Visualize the SOP and use it for the team formed by the LLM.

Schematic diagram of multiple roles in a software company (being gradually implemented)

MetaGPT

Examples (both generated by GPT-4)

For example, if you enter python startup.py "write a recommendation system similar to Toutiao", you will get a series of outputs, one of which is the data structure and API design:

It costs about $0.2 (GPT-4 API fee) to generate an example including analysis and design, and about $2.0 for a complete project.

The following is a comparison chart of MetaGPT and the software development SOP of the human team.

MetaGPT's approach demonstrates the ability to decompose high-level tasks into detailed operational components handled by different roles, such as product managers, architects, project managers, and engineers.

This approach is similar to human software development teams, but with the advantage of increased efficiency, precision, and consistency.

The core components of MetaGPT are as follows:

netizen realized

Some netizens used MetaGPT for ten minutes to make a small game Flappy Bird.

‍She said that MetaGPT is too powerful and may really replace software companies!

The following is the whole process of making the game by this netizen.

First, install MetaGPT on your computer via the "traditional installation" process and enter your OpenAI API key.

After telling the system your needs in the form of prompt, you can watch MetaGPT write code for you.

python startup.py "write p5.js code for Flappy Bird where you control a yellow bird continuously flying between a series of green pipes. The bird flaps every time you left click the mouse. If the bird falls to the ground or hits a pipe , you lose. This game goes on infinitely until you lose and you get points the further you go" --code_review True

Next, run python main.py. However, at this time the program reported a bunch of bugs.

The problem is not big, throw this pile of code directly to Code Interpreter, and let GPT-4 debug.

After the code is changed, use Midjourney to generate a red bird.

By the way, what is the format and size of the GPT-4 image.

Then use canvas to adjust the size of the bird and the pipe.

Finally, run the game.

Netizens said that although there are some minor problems, such as the pipe on the top did not kill the bird. But it worked, and I didn't write a single line of code, or even debug! ! ! ! !

Just keep the bird out of the way of the pipe at the bottom.

Some netizens also made the same game, and the effect is as follows:

In addition, some Japanese netizens also used it to make "Blackjack".

Install

traditional installation

plain text ANTLR4 Bash C C# css CoffeeScript CMake Dart Django Docker EJS Erlang Git Go GraphQL Groovy HTML Java JavaScript JSON JSX Kotlin LaTeX less Lua Makefile markdown MATLAB Markup Objective-C Perl PHP PowerShell .properties Protocol Buffers Python R Ruby Sass (Sass) Sass (Scss) Scheme SQL Shell Swift SVG TSX TypeScript WebAssembly YAML XML # Step 1: Make sure NPM is installed. and install mermaid-js using npm npm --version sudo npm install -g @mermaid-js/mermaid-cli # Step 2: Make sure you have installed Python 3.9+. This can be checked with the following command: python --version # Step 3: Clone the warehouse to the local machine and install it. git clone https://github.com/geekan/metagpt cd metatagpt python setup.py install

Docker installation

plain text ANTLR4 Bash C C# css CoffeeScript CMake Dart Django Docker EJS Erlang Git Go GraphQL Groovy HTML Java JavaScript JSON JSX Kotlin LaTeX less Lua Makefile markdown MATLAB Markup Objective-C Perl PHP PowerShell .properties Protocol Buffers Python R Ruby Sass (Sass) Sass (Scss) Scheme SQL Shell Swift SVG TSX TypeScript WebAssembly YAML XML # Step 1: Download metagpt official image and prepare config.yaml docker pull metagpt/metagpt:v0.3 mkdir -p /opt/metagpt/{config,workspace} docker run --rm metagpt/metagpt:v0.3 cat /app/metagpt/config/config.yaml > /opt/metagpt/config/config.yaml vim /opt/metagpt/config/config.yaml # Modify config # Step 2: Run the metagpt demo using the container docker run --rm \ --privileged \ -v /opt/metagpt/config:/app/metagpt/config \ -v /opt/metagpt/workspace:/app/metagpt/workspace\ metagpt/metagpt:v0.3 \ 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:/app/metagpt/config \ -v /opt/metagpt/workspace:/app/metagpt/workspace\ metagpt/metagpt:v0.3 docker exec -it metagpt /bin/bash $ python startup.py "Write a cli snake game"

docker run ... does the following:

Run in privileged mode, with permission to run the browser

Map the host directory /opt/metagpt/config to the container directory /app/metagpt/config

Map the host directory /opt/metagpt/workspace to the container directory /app/metagpt/workspace

Execute the demo command python startup.py "Write a cli snake game"

Build the mirror yourself

plain text ANTLR4 Bash C C# css CoffeeScript CMake Dart Django Docker EJS Erlang Git Go GraphQL Groovy HTML Java JavaScript JSON JSX Kotlin LaTeX less Lua Makefile markdown MATLAB Markup Objective-C Perl PHP PowerShell .properties Protocol Buffers Python R Ruby Sass (Sass) Sass (Scss) Scheme SQL Shell Swift SVG TSX TypeScript WebAssembly YAML XML # You can also build the metagpt mirror yourself git clone https://github.com/geekan/MetaGPT.git cd MetaGPT && docker build -t metagpt:custom .

configuration

Configure your OPENAI_API_KEY in config/key.yaml/config/config.yaml/env

Priority order: config/key.yaml > config/config.yaml > env

plain text ANTLR4 Bash C C# css CoffeeScript CMake Dart Django Docker EJS Erlang Git Go GraphQL Groovy HTML Java JavaScript JSON JSX Kotlin LaTeX less Lua Makefile markdown MATLAB Markup Objective-C Perl PHP PowerShell .properties Protocol Buffers Python R Ruby Sass (Sass) Sass (Scss) Scheme SQL Shell Swift SVG TSX TypeScript WebAssembly YAML XML # Copy the configuration file and make the necessary changes cp config/config.yaml config/key.yaml
picture

Demo: Launch a Startup

plain text ANTLR4 Bash C C# css CoffeeScript CMake Dart Django Docker EJS Erlang Git Go GraphQL Groovy HTML Java JavaScript JSON JSX Kotlin LaTeX less Lua Makefile markdown MATLAB Markup Objective-C Perl PHP PowerShell .properties Protocol Buffers Python R Ruby Sass (Sass) Sass (Scss) Scheme SQL Shell Swift SVG TSX TypeScript WebAssembly YAML XML python startup.py "Write a cli snake game" # Using code review mode will increase overhead, but it will also improve code quality and success rate python startup.py "Write a cli snake game" --code_review True

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

Platform or Tool Preference

You can state the platform or tool you want to use when stating your requirements.

plain text ANTLR4 Bash C C# css CoffeeScript CMake Dart Django Docker EJS Erlang Git Go GraphQL Groovy HTML Java JavaScript JSON JSX Kotlin LaTeX less Lua Makefile markdown MATLAB Markup Objective-C Perl PHP PowerShell .properties Protocol Buffers Python R Ruby Sass (Sass) Sass (Scss) Scheme SQL Shell Swift SVG TSX TypeScript WebAssembly YAML XML python startup.py "Write a cli snake game based on pygame"

use

plain text ANTLR4 Bash C C# css CoffeeScript CMake Dart Django Docker EJS Erlang Git Go GraphQL Groovy HTML Java JavaScript JSON JSX Kotlin LaTeX less Lua Makefile markdown MATLAB Markup Objective-C Perl PHP PowerShell .properties Protocol Buffers Python R Ruby Sass (Sass) Sass (Scss) Scheme SQL Shell Swift SVG TSX TypeScript WebAssembly YAML XML name startup.py - We are a software startup comprised of AI. By investing in us, you are empowering a future filled with limitless possibilities. SYNOPSIS startup.py IDEA <flags> DESCRIPTION We are a software startup comprised of AI. By investing in us, you are empowering a future filled with limitless possibilities. # We are an AI software startup. By investing in us, you empower a future full of possibilities. POSITIONAL ARGUMENTS IDEA Type: str Your innovative idea, such as "Creating a snake game." FLAGS --investment=INVESTMENT Type: float Default: 3.0 As an investor, you have the opportunity to contribute a certain dollar amount to this AI company. # As an investor, you have the opportunity to invest a certain dollar amount into this AI company. --n_round=N_ROUND Type: int Default: 5 NOTES You can also use the syntax of FLAGS to handle POSITIONAL ARGUMENTS.

Code

plain text ANTLR4 Bash C C# css CoffeeScript CMake Dart Django Docker EJS Erlang Git Go GraphQL Groovy HTML Java JavaScript JSON JSX Kotlin LaTeX less Lua Makefile markdown MATLAB Markup Objective-C Perl PHP PowerShell .properties Protocol Buffers Python R Ruby Sass (Sass) Sass (Scss) Scheme SQL Shell Swift SVG TSX TypeScript WebAssembly YAML XML 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 look at the examples, which have single-role (with knowledge base) usage examples and LLM-only usage examples.

References:

https://arxiv.org/pdf/2308.00352.pdf

https://github.com/geekan/MetaGPT

https://twitter.com/99aico/status/1684249002437668864

Reprinted from 新智元 桃子 好困View Original

Comments

no dataCoffee time! Feel free to comment