← Back to list

“Creating AI Software Engineers with MetaGPT”

MetaGPT is a multi-agent framework that simulates a software company. Instead of a single AI generating code, multiple specialized AI…

REIT monero · 2026-06-16 23:44 · 0 claps · 2.4 min read
#metagpt #software-engneering
Open on Medium ↗
Wiki topics: AGT · AI Agents 💻 · Programming

“Creating AI Software Engineers with MetaGPT

MetaGPT is a multi-agent framework that simulates a software company. Instead of a single AI generating code, multiple specialized AI agents collaborate through structured Standard Operating Procedures (SOPs). Its core philosophy is:

Code = SOP(Team)

A software project is generated by a team of AI agents playing roles such as Product Manager, Architect, Engineer, and QA Engineer.

High-Level Workflow

User Requirement
        │
        ▼
┌─────────────────┐
│ Product Manager │
└────────┬────────┘
         │ PRD
         ▼
┌─────────────────┐
│   Architect     │
└────────┬────────┘
         │ Design Docs
         ▼
┌─────────────────┐
│ Project Manager │
└────────┬────────┘
         │ Tasks
         ▼
┌─────────────────┐
│   Engineers     │
└────────┬────────┘
         │ Code
         ▼
┌─────────────────┐
│       QA        │
└────────┬────────┘
         │ Test Reports
         ▼
     Final Project

This assembly-line approach helps reduce hallucinations and keeps each agent focused on a specific responsibility.

Step 1: Product Manager Agent

Input:

Build a task management web app.

The Product Manager generates:

Product Requirements Document (PRD)

# Task Manager
## Features
- User registration
- Login
- Create tasks
- Update tasks
- Delete tasks
- Task filtering
## User Stories
As a user,
I want to create tasks
so I can manage my work.
As a user,
I want to mark tasks completed
so I can track progress.

Output becomes input for the Architect.

Step 2: Architect Agent

The Architect designs:

Example:

Frontend:
  React
Backend:
  FastAPI
Database:
  PostgreSQL
Authentication:
  JWT

API Design:

POST /login
POST /register
GET /tasks
POST /tasks
PUT /tasks/{id}
DELETE /tasks/{id}

Database Design:

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    username TEXT,
    password_hash TEXT
);
CREATE TABLE tasks (
    id SERIAL PRIMARY KEY,
    title TEXT,
    completed BOOLEAN,
    user_id INTEGER
);

The architecture document is passed downstream.

Step 3: Project Manager Agent

Breaks the architecture into executable tasks.

Example:

Sprint 1:
  - Create FastAPI project
  - Create database schema
Sprint 2:
  - Implement authentication
Sprint 3:
  - Implement CRUD endpoints
Sprint 4:
  - Write tests

Task decomposition is critical because smaller coding tasks improve reliability.

Step 4: Engineer Agent

The Engineer receives a specific task.

Example task:

Implement task creation endpoint.

Generated code:

from fastapi import APIRouter
from pydantic import BaseModel
router = APIRouter()
class Task(BaseModel):
    title: str
tasks = []
@router.post("/tasks")
def create_task(task: Task):
    tasks.append(task)
    return {"message": "created"}

The engineer does not redesign the system; it follows the architecture document.

Step 5: QA Engineer

Generated tests:

from fastapi.testclient import TestClient
from main import app
client = TestClient(app)
def test_create_task():
    response = client.post(
        "/tasks",
        json={"title": "Study"}
    )
    assert response.status_code == 200

QA may generate bug reports:

Bug #1
Endpoint:
POST /tasks
Issue:
Empty title accepted.
Expected:
Validation error.

This feedback loops back to the Engineer.

MetaGPT Internal Agent Structure

A simplified MetaGPT role definition looks like:

class Engineer(Role):
    name = "Alex"
    profile = "Engineer"
    goal = "Write clean code"
    constraints = [
        "Follow architecture",
        "Write tests"
    ]

Simplified MetaGPT Team Code

A minimal example resembles:

from metagpt.team import Team
from metagpt.roles import (
    ProductManager,
    Architect,
    Engineer,
    QaEngineer
)
team = Team()
team.hire([
    ProductManager(),
    Architect(),
    Engineer(),
    QaEngineer()
])
team.run_project(
    "Build a todo application"
)

The actual framework contains additional message routing, memory management, and workflow orchestration.

Communication Between Agents

Agents communicate through structured messages.

Example:

Message(
    sender="Architect",
    receiver="Engineer",
    content="""
    Create FastAPI service.
    Requirements:
    - JWT Authentication
    - PostgreSQL
    """
)

This prevents later agents from inventing requirements and helps maintain consistency.

Output Artifacts Generated by MetaGPT

A single prompt can generate:

requirements/
    PRD.md
design/
    architecture.md
    api_design.md
tasks/
    task_list.md
src/
    backend/
    frontend/
tests/
    test_api.py
docs/
    deployment.md

MetaGPT can generate requirements, architecture documents, APIs, code, tests, and supporting documentation from one initial requirement.

Why MetaGPT Works Better Than a Single Coding Agent

Traditional approach:

Prompt
  ↓
LLM
  ↓
Code

MetaGPT approach:

Prompt
 ↓
PM
 ↓
Architect
 ↓
PMO
 ↓
Engineer
 ↓
QA
 ↓
Code

These are the primary reasons MetaGPT outperformed many earlier chat-based multi-agent systems in software engineering benchmarks.


메타데이터
post_id
c1eb137ba3e4
slug
creating-ai-software-engineers-with-metagpt-c1eb137ba3e4
url
https://medium.com/@juricavoda/creating-ai-software-engineers-with-metagpt-c1eb137ba3e4
canonical_url
https://medium.com/@juricavoda/creating-ai-software-engineers-with-metagpt-c1eb137ba3e4
author_url
https://medium.com/@juricavoda
status
ok
fetched_at
2026-08-03 08:42:30