$ show FoundationAgents/MetaGPT
MetaGPT is a multi-agent orchestration framework designed to automate software engineering workflows and complex task execution. It functions as a Python library and CLI tool where autonomous agents (Roles like Product Manager, Architect, Engineer) collaborate via a message-passing environment to generate code, designs, and documentation. The system abstracts LLM interactions, supports Retrieval-Augmented Generation (RAG) for knowledge retrieval, and includes specialized environments for simulation (Minecraft, Stanford Town) and automation (Android, Web Browsing). It is primarily an application framework rather than a data research repository, though it incorporates research-grade components like Tree of Thought planning and AutoML evaluation. The architecture is modular, separating Roles, Actions, Tools, and Environments to allow for extensibility. Key entry points include the CLI command `metagpt` and the `metagpt.software_company` module for project generation. The codebase relies heavily on external dependencies, particularly LLM APIs (OpenAI, Azure, etc.) and browser automation tools (Playwright), which introduces maintenance complexity. While the core framework is well-structured with factory patterns and serialization support, the heavy coupling to external services and the presence of complex, niche extensions (e.g., Minecraft bot integration) contribute to a medium technical drift rating.
The LLM identified 5 files worth highlighting for reuse:
Implements the ActionNode pattern for structured LLM output generation and parsing. It handles the conversion of LLM responses into typed data structures (JSON/Markdown) with built-in review and revision loops. This is a reusable component for any project requiring reliable, structured generation from LLMs without relying on strict model formatting.
Contains factory classes for instantiating RAG components (Retriever, Embedding, Index, Ranker) based on configuration. This module demonstrates a clean abstraction for swapping vector stores (FAISS, Chroma, Qdrant) and retrieval strategies without changing core logic, making it highly reusable for RAG implementations.
Defines the base Role class which encapsulates the agent loop (think/act/react), memory management, and action execution. It provides a reusable template for creating autonomous agents with configurable behaviors, short-term/long-term memory, and interaction with an environment.
Provides a unified abstraction layer for interacting with various LLM providers (OpenAI, Azure, Anthropic, etc.). It includes standardized interfaces for completion, streaming, and cost management, along with retry logic for transient failures. This pattern is essential for building LLM-agnostic applications.
Implements polymorphic serialization and deserialization for Roles, Actions, and Teams using Pydantic. This allows for state persistence and recovery of complex agent states, enabling features like long-term memory and experiment tracking. It is a reusable utility for managing agent state across sessions.