Introduction
MetaGPT assigns distinct roles to LLM agents — product manager, architect, project manager, and engineer — and coordinates them through standardized operating procedures. Given a one-line requirement, the agents collaborate to produce PRDs, system designs, and working code.
What MetaGPT Does
- Decomposes a natural-language requirement into structured outputs across multiple agent roles
- Generates product requirement documents, system design diagrams, and task breakdowns
- Produces runnable code with tests by following a simulated software development workflow
- Supports human-in-the-loop review at each stage of the pipeline
- Provides a plugin system for custom tools and actions per agent role
Architecture Overview
MetaGPT implements a message-passing architecture where each agent subscribes to specific message types. A shared environment holds project state, and a standardized operating procedure (SOP) defines the order in which roles act. Agents use structured output schemas to pass artifacts like PRDs and API specs, reducing hallucination through format constraints.
Self-Hosting & Configuration
- Install via pip or clone the repository for development setup
- Configure LLM providers in config2.yaml with API keys for OpenAI, Claude, or local models
- Set workspace directory and output preferences through environment variables
- Run as a CLI tool or import as a Python library for integration into larger pipelines
- Extend with custom roles by subclassing the Role base class and defining actions
Key Features
- Role-based agent collaboration following real software engineering workflows
- Structured intermediate artifacts reduce cascading errors between agents
- Multi-model support including OpenAI, Anthropic, and open-source LLMs
- Incremental development mode that builds on existing codebases
- Data interpreter agent for data analysis and visualization tasks
Comparison with Similar Tools
- CrewAI — simpler role definition with less structured inter-agent communication; MetaGPT enforces SOPs
- AutoGen — focuses on conversational agent patterns; MetaGPT models a full development pipeline
- ChatDev — similar software company simulation; MetaGPT adds structured document artifacts
- LangGraph — graph-based agent orchestration; MetaGPT provides pre-built software development roles
- OpenAI Swarm — lightweight agent handoffs; MetaGPT offers deeper role specialization
FAQ
Q: What LLM providers does MetaGPT support? A: OpenAI, Azure OpenAI, Anthropic Claude, Google Gemini, and any OpenAI-compatible local model server.
Q: Can MetaGPT work on existing codebases? A: Yes. The incremental development mode lets agents analyze and extend existing projects.
Q: How is MetaGPT different from a single-agent coding tool? A: It separates concerns across specialized roles, producing intermediate design documents that guide implementation and reduce errors.
Q: Does it require GPT-4? A: GPT-4 or Claude produce the best results, but it works with GPT-3.5 and open-source models at reduced quality.