Building a Virtual Software Company with MetaGPT A Step-by-Step Guide

Building a Virtual Software Company with MetaGPT A Step-by-Step Guide

ai

MetaGPT is a powerful multi-agent framework introduced by brilliant minds from The Chinese University of Hong Kong, University of California, Berkeley, and DeepWisdom, led by Sirui Hong. It’s designed to simulate real-world software development teams, enabling agents like product managers, engineers, and architects to work together autonomously.

If you're new to multi-agent systems, you might want to check out our previous blog on Multi-Agent Frameworks, where we explored how these frameworks help build robust and multidimensional solutions.

MetaGPT offers both a command-line interface and a Chainlit-based UI for easier interaction. In this blog, we’ll walk through both options.

Key Features of MetaGPT

Getting Started

You can get started with MetaGPT in two ways:

  1. Install via pip (quick and simple)
  2. Install from source (ideal for customization)

Create a Virtual Environment

Using Conda:

conda create -n metagpt python=3.9 && conda activate metagpt

Using venv:

python -m venv metagpt && source metagpt/bin/activate

If you're on VS Code:

  1. Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
  2. Search for "Python: Select Interpreter"
  3. Click “Create New Virtual Environment”
  4. Choose conda or venv
  5. Pick your Python version (3.9–3.11 recommended)

Install via pip

MetaGPT supports Python 3.9 to 3.11 (for version 0.8.2 and below), for more details checkout https://pypi.org/project/metagpt/.

pip install metagpt

Today chainlit is not supported if you install via pip. If you want to use Chainlit, please install from source.

If you face dependency issues, then either you can adjust your OS environment or try installing lower version of MetaGPT, for example:

pip install metagpt==0.8.1

Install from Source

git clone [email protected]:FoundationAgents/MetaGPT.git
cd MetaGPT

After cloning install metaGPT in editable mode:

pip install -e .

The reason being any changes you make to the source code will be immediately reflected in your environment, allowing for flexible customization.

After running the above command you should be able to access metagpt command in your terminal and if not then checkout lower version of MetaGPT, for example

git checkout v0.8.1

Setup Configuration

Initialize the config file:

metagpt --init-config

This will generate a config at ~/.metagpt/config2.yaml. Customize it as needed. For reference, see the example config.

Below is a sample config of Azure AI foundary:

llm:
  api_type: "azure"
  base_url: "https://<service-name>.services.ai.azure.com"
  api_key: "<your-api-key>"
  api_version: "2024-10-21"
  model: "<deploy-model-name>"

Or you can directly modify the config located at MetaGPT/config/config2.yaml.

Running Your Software Company

MetaGPT's main interface is command line but supports a Chainlit UI for more interactive experiences.

Option 1: Command Line Interface

metagpt "Design a web app for a company that sells shoes"

All outputs—including documents and code—will be generated under the ./workspace directory.

commandline_metapt_example

Option 2: Chainlit UI (Manual Setup Required)

⚠️ Note: As of June 7, 2025, the official Chainlit UI support is deprecated. You’ll need to modify some files manually to get it working.

Install Chainlit

Using pip:

pip install chainlit

Using conda:

conda install -c conda-forge chainlit

Modify the Chainlit UI Setup

Modify file init_setup.py located at MetaGPT/examples/ui_with_chainlit/:

MetaGPT/examples/ui_with_chainlit/init_setup.py
from metagpt.environment import Environment
from metagpt.logs import logger, set_llm_stream_logfunc
from metagpt.roles import Role
from metagpt.utils.common import any_to_name
+from metagpt.environment.mgx.mgx_env import MGXEnv
import chainlit as cl
 
def log_llm_stream_chainlit(msg):
    cl.run_sync(cl.Message(content=msg).send())
 
set_llm_stream_logfunc(func=log_llm_stream_chainlit)
 
- class ChainlitEnv(Environment):
+ class ChainlitEnv(MGXEnv):
...
 
+    async def ask_human(self, question: str, sent_from: Role = None) -> str:
+        rsp = await cl.AskUserMessage(content=question, timeout=120).send()
+        return "Human response: " + rsp['output']

What we change here is:

Then, modify app.py in the same folder:

MetaGPT/examples/ui_with_chainlit/app.py
from init_setup import ChainlitEnv
 
@cl.on_message
async def startup(message: cl.Message) -> None:
    idea = message.content
    company = Team(env=ChainlitEnv())
 
-   company.hire([
-       ProductManager(),
-       Architect(),
-       ProjectManager(),
-       Engineer(n_borg=5, use_code_review=True),
-       QaEngineer(),
-   ])
 
+   company.hire([
+       TeamLeader(),
+       ProductManager(),
+       Architect(),
+       ProjectManager(),
+       Engineer2(),
+       DataAnalyst(),
+   ])

What we change here is:

Run the app:

chainlit run MetaGPT/examples/ui_with_chainlit/app.py

Open your browser at http://localhost:8000, and start by typing your project idea into the input box.

chainlit_ui_metagpt_example1 chainlit_ui_metagpt_example2

If icons/images don’t load properly, it's expected—feel free to ignore.

Role Customization

MetaGPT supports multiple roles. You can explore them under metagpt/roles/. There are two types:

  1. Base Roles – suited for specific, predictable tasks.
  2. Role Zero – dynamic, multi-capability roles.

Available Roles

Built-In Tools

Actions

Actions represent what agents can do (Standard Operating Procedures).

These actions define the capabilities each role can execute, such as writing PRDs, designing systems, or performing analysis.

Conclusion

MetaGPT stands out in the rapidly evolving world of AI-powered software development. By mimicking the structure of real-world teams and allowing deep customization of agents and their actions, it brings powerful automation to product ideation and engineering processes. Whether you're looking to spin up a virtual software team for a side project or exploring advanced use cases in enterprise environments, MetaGPT offers a compelling and extensible foundation.

Give it a spin—and let your agents do the heavy lifting.