MetaGPT:多智能体框架

[ En |中 |神父 |日 ] 给GPT分配不同的角色,形成一个协作实体,处理复杂任务。
新闻
🚀 2025年3月10日:🎉 mgx.dev 是@ProductHunt #1周产品!🏆
🚀 2025年3月4日:🎉 mgx.dev 是@ProductHunt每日#1产品!🏆
🚀 2025年2月19日:今天,我们正式发布了自然语言编程产品MGX(MetaGPT X)——全球首个AI代理开发团队。更多详情请见推特。
🚀 2025年2月17日:我们介绍了两篇论文:SPO和AOT,请查看代码!
🚀 2025年1月22日:我们的论文《AFlow:自动化代理工作流程生成》在ICLR 2025上被接受口头报告(排名前1.8%),在基于LLM的代理类别中排名第2。
👉👉 早期新闻
软件公司作为多代理系统
- MetaGPT只需输入一行需求,输出用户故事/竞争分析/需求/数据结构/API/文档等。
- 在内部,MetaGPT包括产品经理/架构师/项目经理/工程师。它提供软件公司的整个流程,并附带精心编排的标准作程序(SOP)。
Code = SOP(Team)这是核心理念。我们将标准作业程序(SOP)具体化,应用于由大型语言模型(LLM)组成的团队。

软件公司多智能体原理图(逐步实现)
开始
安装
确保你的系统安装的是Python 3.9或更高版本,但低于3.12。您可以通过以下方法进行验证:。
你可以这样用conda:python --versionconda create -n metagpt python=3.9 && conda activate metagpt
pip install --upgrade metagpt
# or `pip install --upgrade git+https://github.com/geekan/MetaGPT.git`
# or `git clone https://github.com/geekan/MetaGPT && cd MetaGPT && pip install --upgrade -e .`
在实际使用前先安装Node和pnpm。
如需详细安装指导,请参阅 cli_install 或 docker_install
配置
您可以通过执行以下命令启动MetaGPT配置,或者手动创建文件:~/.metagpt/config2.yaml
# Check https://docs.deepwisdom.ai/main/en/guide/get_started/configuration.html for more details
metagpt --init-config # it will create ~/.metagpt/config2.yaml, just modify it to your needs
你可以根据示例和文档进行配置:~/.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("<path>")
print(repo) # it will print the repo structure with files
你也可以用数据解释器写代码:
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的拥抱面空间上
- Matthew Berman:如何安装MetaGPT——用一个提示创建初创公司!!
- 官方演示视频
metagpt_video_wall_2025.mp4
教程
- 🗒 在线文档
- 💻 用途
- 🔎 MetaGPT能做什么?
- 🛠 如何打造自己的经纪人?
- MetaGPT 使用与开发指南 |特工101
- MetaGPT 使用与开发指南 |多代理入门
- 🧑 💻 贡献
- 制定路线图
- 🔖 使用场景
- 数据解释器
- 辩论
- 研究员
- 收据助理
- ❓ 常见问题解答


没有回复内容