# MetaGPT

> A multi-agent framework that runs an LLM software company from one prompt

- Category: Agents & Automation / Multi-Agent Systems
- Language: Python
- Licence: MIT
- Repository: https://github.com/FoundationAgents/MetaGPT
- Website: https://docs.deepwisdom.ai
- Canonical page: https://ai-tldr.dev/tools/metagpt/

## In short

MetaGPT is an open-source framework that models a software company as a team of LLM-based agents. It sits in the Multi-Agent Systems category of the Agents & Automation tools and is open-source, written in Python and licensed MIT. To get started: install MetaGPT.

## Overview

MetaGPT is an open-source framework that models a software company as a team of LLM-based agents. You give it a one-line requirement, and it runs the request through roles such as product manager, architect, project manager, and engineer to produce user stories, requirements, data structures, APIs, design docs, and code.

It is aimed at developers and researchers who want to experiment with multi-agent collaboration rather than driving a single LLM call by hand. Its core idea is `Code = SOP(Team)`: standard operating procedures are encoded so each agent knows what to hand off to the next, which keeps the workflow structured.

Within the agent-frameworks space, MetaGPT sits in the multi-agent category. It can generate a whole project from a prompt, but it also exposes building blocks like the Data Interpreter and individual roles so you can assemble your own agents and workflows.

## What it does

- Turns a single one-line requirement into a generated repo placed under ./workspace
- Built-in roles modeled on a software company: product manager, architect, project manager, and engineer
- Outputs intermediate artifacts such as user stories, competitive analysis, requirements, data structures, and APIs
- Works from the CLI or as a Python library via generate_repo and ProjectRepo
- Data Interpreter role for running data-analysis tasks and producing plots
- Configurable LLM backend (OpenAI, Azure, Ollama, Groq and others) through a single config2.yaml file

## Getting started

Install MetaGPT with pip, set up your LLM config, then run it from the CLI or as a library. Requires Python 3.9 or later but below 3.12.

1. Install MetaGPT

   Install or upgrade the package from PyPI. Note: install Node and pnpm before actual use, as the README requires them.

```bash
pip install --upgrade metagpt
```

2. Initialize the config

   Generate the config file at ~/.metagpt/config2.yaml, then edit it to set your LLM provider, model, and API key.

```bash
metagpt --init-config
```

3. Generate a project from the CLI

   Pass a one-line requirement; MetaGPT creates the resulting repo under ./workspace.

```bash
metagpt "Create a 2048 game"  # this will create a repo in ./workspace
```

4. Use it as a Python library

   Call generate_repo to build a project programmatically and inspect the returned ProjectRepo.

```python
from metagpt.software_company import generate_repo
from metagpt.utils.project_repo import ProjectRepo

repo: ProjectRepo = generate_repo("Create a 2048 game")
print(repo)  # it will print the repo structure with files
```

## When to use it

- Prototype a small app or game from a single sentence and review the generated repo as a starting point
- Study how multi-agent SOPs split a build into PM, architect, and engineer roles for research or teaching
- Run data-analysis tasks with the Data Interpreter role, including generating plots
- Build your own custom agents and multi-agent workflows on top of MetaGPT's roles
