FoundationAgents/MetaGPT

GitHub: FoundationAgents/MetaGPT

MetaGPT 是一个多智能体协作框架,通过模拟软件公司内部的角色分工与标准流程,将一行需求自动转化为包含文档、代码在内的完整软件项目。

Stars: 65190 | Forks: 8211

# MetaGPT:多智能体框架

MetaGPT logo: Enable GPT to work in a software company, collaborating to tackle more complex tasks.

[ En | | Fr | ] 为 GPT 分配不同角色,以组成一个用于复杂任务的协作实体。

License: MIT Discord Follow Twitter Follow

## 新闻 🚀 2025年3月10日:🎉 [mgx.dev](https://mgx.dev/) 荣获 @ProductHunt 本周产品榜第一名!🏆 🚀 2025年3月4日:🎉 [mgx.dev](https://mgx.dev/) 荣获 @ProductHunt 今日产品榜第一名!🏆 🚀 2025年2月19日:今天我们正式发布我们的自然语言编程产品:[MGX (MetaGPT X)](https://mgx.dev/) —— 世界上第一个 AI 智能体开发团队。更多详情请查阅 [Twitter](https://x.com/MetaGPT_/status/1892199535130329356)。 🚀 2025年2月17日:我们发表了两篇论文:[SPO](https://arxiv.org/pdf/2502.06855) 和 [AOT](https://arxiv.org/pdf/2502.12018),请查看[代码](examples)! 🚀 2025年1月22日:我们的论文 [AFlow: Automating Agentic Workflow Generation](https://openreview.net/forum?id=z5uVAKwmjf) 被 ICLR 2025 接收为**口头报告 (top 1.8%)**,在基于 LLM 的 Agent 类别中**排名第二**。 👉👉 [早期新闻](docs/NEWS.md) ## 软件公司即多智能体系统 1. MetaGPT 将**一行需求**作为输入,并输出**用户故事 / 竞品分析 / 需求 / 数据结构 / API / 文档等**。 2. 在内部,MetaGPT 包含**产品经理 / 架构师 / 项目经理 / 工程师**。它提供了**软件公司的完整流程以及精心设计的 SOP**。 1. `Code = SOP(Team)` 是核心理念。我们将 SOP 具体化,并将其应用于由 LLM 组成的团队。 ![由基于 LLM 的角色组成的软件公司](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/468d657a2c191545.jpg)

软件公司多智能体示意图(逐步实现中)

## 开始使用 ### 安装 ``` pip install --upgrade metagpt # 或 `pip install --upgrade git+https://github.com/geekan/MetaGPT.git` # 或 `git clone https://github.com/geekan/MetaGPT && cd MetaGPT && pip install --upgrade -e .` ``` **在实际使用前请安装 [node](https://nodejs.org/en/download) 和 [pnpm](https://pnpm.io/installation#using-npm).** 有关详细的安装指南,请参阅 [cli_install](https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html#install-stable-version) 或 [docker_install](https://docs.deepwisdom.ai/main/en/guide/get_started/installation.html#install-with-docker) ### 配置 你可以通过运行以下命令初始化 MetaGPT 的配置,或者手动创建 `~/.metagpt/config2.yaml` 文件: ``` # 查看 https://docs.deepwisdom.ai/main/en/guide/get_started/configuration.html 获取更多详情 metagpt --init-config # it will create ~/.metagpt/config2.yaml, just modify it to your needs ``` 你可以根据[示例](https://github.com/geekan/MetaGPT/blob/main/config/config2.example.yaml)和[文档](https://docs.deepwisdom.ai/main/en/guide/get_started/configuration.html)配置 `~/.metagpt/config2.yaml`: ``` llm: api_type: "openai" # or azure / ollama / groq etc. Check LLMType for more options model: "gpt-4-turbo" # or gpt-3.5-turbo base_url: "https://api.openai.com/v1" # or forward url / other llm url api_key: "YOUR_API_KEY" ``` ### 使用 安装完成后,你可以在 CLI 中使用 MetaGPT ``` metagpt "Create a 2048 game" # this will create a repo in ./workspace ``` 或者将其作为库使用 ``` from metagpt.software_company import generate_repo from metagpt.utils.project_repo import ProjectRepo repo: ProjectRepo = generate_repo("Create a 2048 game") # or ProjectRepo("") print(repo) # it will print the repo structure with files ``` 你也可以使用 [Data Interpreter](https://github.com/geekan/MetaGPT/tree/main/examples/di) 来编写代码: ``` import asyncio from metagpt.roles.di.data_interpreter import DataInterpreter async def main(): di = DataInterpreter() await di.run("Run data analysis on sklearn Iris dataset, include a plot") asyncio.run(main()) # or await main() in a jupyter notebook setting ``` ### 快速开始 & 演示视频 - 在 [MetaGPT Huggingface Space](https://huggingface.co/spaces/deepwisdom/MetaGPT-SoftwareCompany) 试用 - [Matthew Berman: 如何安装 MetaGPT - 用一个提示词构建初创公司!!](https://youtu.be/uT75J_KG_aY) - [官方演示视频](https://github.com/geekan/MetaGPT/assets/2707039/5e8c1062-8c35-440f-bb20-2b0320f8d27d) https://github.com/user-attachments/assets/888cb169-78c3-4a42-9d62-9d90ed3928c9 ## 教程 - 🗒 [在线文档](https://docs.deepwisdom.ai/main/en/) - 💻 [使用方法](https://docs.deepwisdom.ai/main/en/guide/get_started/quickstart.html) - 🔎 [MetaGPT 能做什么?](https://docs.deepwisdom.ai/main/en/guide/get_started/introduction.html) - 🛠 如何构建你自己的智能体? - [MetaGPT 使用与开发指南 | Agent 101](https://docs.deepwisdom.ai/main/en/guide/tutorials/agent_101.html) - [MetaGPT 使用与开发指南 | MultiAgent 101](https://docs.deepwisdom.ai/main/en/guide/tutorials/multi_agent_101.html) - 🧑‍💻 贡献 - [开发路线图](docs/ROADMAP.md) - 🔖 用例 - [Data Interpreter](https://docs.deepwisdom.ai/main/en/guide/use_cases/agent/interpreter/intro.html) - [辩论](https://docs.deepwisdom.ai/main/en/guide/use_cases/multi_agent/debate.html) - [研究员](https://docs.deepwisdom.ai/main/en/guide/use_cases/agent/researcher.html) - [发票助手](https://docs.deepwisdom.ai/main/en/guide/use_cases/agent/receipt_assistant.html) - ❓ [常见问题](https://docs.deepwisdom.ai/main/en/guide/faq.html) ## 支持 ### Discord 加入我们 📢 加入我们的 [Discord 频道](https://discord.gg/ZRHeExS6xv)!期待在那里见到你!🎉 ### 联系方式 如果你对本项目有任何疑问或反馈,请随时联系我们。非常感谢你的建议! - **邮箱:** alexanderwu@deepwisdom.ai - **GitHub Issues:** 对于更多技术咨询,你也可以在我们的 [GitHub 仓库](https://github.com/geekan/metagpt/issues)中创建一个新 issue。 我们将在 2-3 个工作日内回复所有问题。 ## 引用 要了解最新的研究和发展,请在 Twitter 上关注 [@MetaGPT_](https://twitter.com/MetaGPT_)。 要在出版物中引用 [MetaGPT](https://openreview.net/forum?id=VtmBAGCN7o),请使用以下 BibTeX 条目。 ``` @inproceedings{hong2024metagpt, title={Meta{GPT}: Meta Programming for A Multi-Agent Collaborative Framework}, author={Sirui Hong and Mingchen Zhuge and Jonathan Chen and Xiawu Zheng and Yuheng Cheng and Jinlin Wang and Ceyao Zhang and Zili Wang and Steven Ka Shing Yau and Zijuan Lin and Liyang Zhou and Chenyu Ran and Lingfeng Xiao and Chenglin Wu and J{\"u}rgen Schmidhuber}, booktitle={The Twelfth International Conference on Learning Representations}, year={2024}, url={https://openreview.net/forum?id=VtmBAGCN7o} } ``` 更多工作请参考 [学术工作](docs/ACADEMIC_WORK.md)。
标签:AGI, AIGC, AI智能体, AI软件公司, AutoGPT替代, C2, DLL 劫持, DNS解析, LLM应用开发, MetaGPT, MITM代理, PyRIT, Python, QA测试AI, RAG, SaaS, 产品经理AI, 人工智能, 代码生成, 代码辅助, 企业级AI, 协作式AI, 复杂任务解决, 多智能体系统, 大语言模型, 工作流自动化, 工程师AI, 开源项目, 无后门, 智能体编排, 架构设计AI, 深度学习, 渗透测试工具, 用户模式Hook绕过, 自动编程, 自然语言编程, 请求拦截, 软件开发套件, 软件开发自动化, 逆向工具, 通用人工智能