How geekan/metagpt works
Project Overview
• MetaGPT is a multi-agent framework that simulates the complete workflow of a software company. Agents (such as product managers, architects, project managers, engineers, etc.) collaborate to translate simple requirements into complete, production-ready projects.
• The system integrates various components including configuration management, multiple environments (e.g., Android, Minecraft, Werewolf game simulation), role-based action modules, document/memory stores, external API integrations, and a refined processing pipeline for tasks.
Main System Components
a. Agent Roles & Action Modules:
• This includes the various role-specific modules found under directories like metagpt/actions, metagpt/roles, and metagpt/skills.
• One important module is debug_error (located at metagpt/actions/debug_error.py). This component is designed to capture, log, and trigger corrective measures when an action encounters unexpected behavior.
b. Core Framework and Workflow Orchestration:
• At its core, MetaGPT accepts a one-line requirement and then orchestrates the process of generating a complete repository with user stories, competitive analysis, APIs, documentations, etc.
• There are “SOP” components to embody the idea that “Code = SOP(Team)”, involving managers, architects, engineers and other agents.
c. External Services and Providers:
• The integration with external LLM/API providers (openai, azure, etc.) appears in the provider folder (e.g. metagpt/provider) and other configuration files (e.g., config/config2.yaml) that provide the API settings.
d. Data Storage & Memory:
• The project includes various document storage and memory management components (such as in metagpt/memory and metagpt/document_store) to maintain state and context across collaborative tasks.
e. Environment & External Agent Execution:
• There are several environment components found under metagpt/environment (Android, Minecraft, werewolf, etc.) which allow agents to operate in simulated real-world scenarios.
Focusing on the Debug Error Component
• Debug Error Module (metagpt/actions/debug_error.py) is a crucial part of the execution pipeline. It is designed to:
• Catch and log exceptions or unexpected outputs from action executions.
• Provide corrective measures or suggestions to re-run tasks if needed.
• Interact with other modules – for example, by sending information to logging utilities or by triggering alternative strategies in the agent chain.