diff --git a/README.md b/README.md index f5d9adbef..c87020439 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,9 @@ # MetaGPT: The Multi-Role Meta Programming Framework ## Objective -1. Our ultimate goal is to enable GPT to train, fine-tune, and ultimately, utilize itself, aiming to achieve a level of **self-evolution.** - 1. Once GPT can optimize itself, it will have the capacity to continually improve its own performance without the constant need for manual tuning. This kind of self-evolution enables an **autonomous cycle of growth** where the AI can identify areas for its own improvement, make necessary adjustments, and implement those changes to better achieve its objectives. **It could potentially lead to an exponential growth in the system's capabilities.** -2. Currently, we have managed to enable GPT to work in teams, collaborating to tackle more complex tasks. - 1. For instance, `startup.py` consists of **product manager / architect / project manager / engineer**, it provides the full process of a **software company.** - 2. The team can cooperate and generate **user stories / competetive analysis / requirements / data structures / apis / files etc.** - -### Philosophy - -The core assets of a software company are three: Executable Code, SOP (Standard Operating Procedures), and Team. -There is a formula: - -``` -Executable Code = SOP(Team) -``` - -We have practiced this process and expressed the SOP in the form of code, -and the team itself only used large language models. +1. Currently, we have managed to enable GPT to work in teams, collaborating to tackle more complex tasks. + 1. The team can handle **Boss's one line Requirement** cooperate and generate **user stories / competetive analysis / requirements / data structures / apis / files etc.** + 2. The team consists of **product manager / architect / project manager / engineer**, it provides the full process of a **software company.** ## Examples (fully generated by GPT-4) @@ -29,11 +15,11 @@ ## Examples (fully generated by GPT-4) 1. It requires around **$0.2** (GPT-4 api's costs) to generate one example with analysis and design. 2. It requires around **$2.0** (GPT-4 api's costs) to generate one example with a full project. -| | Design an MLOps/LLMOps framework that supports GPT-4 and other LLMs | Design a game like Candy Crush Saga | Design a RecSys like Toutiao | Design a roguelike game like NetHack | Design a search algorithm framework | Design a minimal pomodoro timer | -|----------------------|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------| -| Competitive Analysis | ![LLMOps Competitive Analysis](resources/workspace/llmops_framework/resources/competitive_analysis.png) | ![Candy Crush Competitive Analysis](resources/workspace/match3_puzzle_game/resources/competitive_analysis.png) | ![Jinri Toutiao Recsys Competitive Analysis](resources/workspace/content_rec_sys/resources/competitive_analysis.png) | ![NetHack Game Competitive Analysis](resources/workspace/pyrogue/resources/competitive_analysis.png) | ![Search Algorithm Framework Competitive Analysis](resources/workspace/search_algorithm_framework/resources/competitive_analysis.png) | ![Minimal Pomodoro Timer Competitive Analysis](resources/workspace/minimalist_pomodoro_timer/resources/competitive_analysis.png) | -| Data & API Design | ![LLMOps Data & API Design](resources/workspace/llmops_framework/resources/data_api_design.png) | ![Candy Crush Data & API Design](resources/workspace/match3_puzzle_game/resources/data_api_design.png) | ![Jinri Toutiao Recsys Data & API Design](resources/workspace/content_rec_sys/resources/data_api_design.png) | ![NetHack Game Data & API Design](resources/workspace/pyrogue/resources/data_api_design.png) | ![Search Algorithm Framework Data & API Design](resources/workspace/search_algorithm_framework/resources/data_api_design.png) | ![Minimal Pomodoro Timer Data & API Design](resources/workspace/minimalist_pomodoro_timer/resources/data_api_design.png) | -| Sequence Flow | ![LLMOps Sequence Flow](resources/workspace/llmops_framework/resources/seq_flow.png) | ![Candy Crush Sequence Flow](resources/workspace/match3_puzzle_game/resources/seq_flow.png) | ![Jinri Toutiao Recsys Sequence Flow](resources/workspace/content_rec_sys/resources/seq_flow.png) | ![NetHack Game Sequence Flow](resources/workspace/pyrogue/resources/seq_flow.png) | ![Search Algorithm Framework Sequence Flow](resources/workspace/search_algorithm_framework/resources/seq_flow.png) | ![Minimal Pomodoro Timer Sequence Flow](resources/workspace/minimalist_pomodoro_timer/resources/seq_flow.png) | +| | Design an MLOps/LLMOps framework that supports GPT-4 and other LLMs | Design a RecSys like Toutiao | Design a search algorithm framework | +|----------------------|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| +| Competitive Analysis | ![LLMOps Competitive Analysis](resources/workspace/llmops_framework/resources/competitive_analysis.png) | ![Jinri Toutiao Recsys Competitive Analysis](resources/workspace/content_rec_sys/resources/competitive_analysis.png) | ![Search Algorithm Framework Competitive Analysis](resources/workspace/search_algorithm_framework/resources/competitive_analysis.png) | +| Data & API Design | ![LLMOps Data & API Design](resources/workspace/llmops_framework/resources/data_api_design.png) | ![Jinri Toutiao Recsys Data & API Design](resources/workspace/content_rec_sys/resources/data_api_design.png) | ![Search Algorithm Framework Data & API Design](resources/workspace/search_algorithm_framework/resources/data_api_design.png) | +| Sequence Flow | ![LLMOps Sequence Flow](resources/workspace/llmops_framework/resources/seq_flow.png) | ![Jinri Toutiao Recsys Sequence Flow](resources/workspace/content_rec_sys/resources/seq_flow.png) | ![Search Algorithm Framework Sequence Flow](resources/workspace/search_algorithm_framework/resources/seq_flow.png) | ## Installation @@ -53,7 +39,7 @@ # Step 3: Clone the repository to your local machine, and install it. ## Configuration -- You can configure your `OPENAI_API_KEY` in `config/key.yaml / config/config.yaml / env` +- Configure your `OPENAI_API_KEY` in `config/key.yaml / config/config.yaml / env` - Priority order: `config/key.yaml > config/config.yaml > env` ```bash @@ -94,31 +80,7 @@ ### Code walkthrough await company.run(n_round=n_round) ``` -## Tutorial: single role and LLM examples - -### The framework support single role as well, here's a simple sales role use case - -```python -from metagpt.const import DATA_PATH -from metagpt.document_store import FaissStore -from metagpt.roles import Sales - -store = FaissStore(DATA_PATH / 'example.pdf') -role = Sales(profile='Sales', store=store) -result = await role.run('Which facial cleanser is good for oily skin?') -``` - -### The framework also provide llm interfaces - -```python -from metagpt.llm import LLM - -llm = LLM() -await llm.aask('hello world') - -hello_msg = [{'role': 'user', 'content': 'hello'}] -await llm.acompletion(hello_msg) -``` +You can check `examples` for more details on single role (with knowledge base) and LLM only examples. ## Contact Information @@ -129,12 +91,6 @@ ## Contact Information We aim to respond to all inquiries within 2-3 business days. - ## Demo -| blackjack | adventure-game | 2048 | pomodoro-timer | -|-----------|-----------|-----------|-----------| -| ![demo-cli-blackjack](https://github.com/geekan/MetaGPT/assets/2707039/a4769a6a-5f10-49b3-9b30-9a7aee23c331) | ![demo-adventure-game](https://github.com/geekan/MetaGPT/assets/2707039/28636e78-f30f-4aa2-998c-5dc1af94ce9c) | ![demo-py2048](https://github.com/geekan/MetaGPT/assets/2707039/7ca4b6be-87a3-45fe-a182-e15673282617) | ![pomodoro-timer-webpage](https://github.com/geekan/MetaGPT/assets/2707039/37f749ec-f0fa-45b0-a181-5651b3f172f2) | - - https://github.com/geekan/MetaGPT/assets/2707039/5e8c1062-8c35-440f-bb20-2b0320f8d27d diff --git a/README_CN.md b/README_CN.md index e62927514..be03995b4 100644 --- a/README_CN.md +++ b/README_CN.md @@ -4,21 +4,9 @@ # MetaGPT:多角色元编程框架 ## 目标 -1. 我们的最终目标是让 GPT 能够训练、微调,并最终利用自身,以实现**自我进化** - 1. 一旦 GPT 能够优化自身,它将有能力持续改进自己的性能,而无需经常手动调整。这种自我进化使得 AI 能够识别自身改进的领域,进行必要的调整,并实施那些改变以更好地达到其目标。**这可能导致系统能力的指数级增长** -2. 目前,我们已经使 GPT 能够以团队的形式工作,协作处理更复杂的任务 - 1. 例如,`startup.py` 包括**产品经理 / 架构师 / 项目经理 / 工程师**,它提供了一个**软件公司**的全过程 - 2. 该团队可以合作并生成**用户故事 / 竞品分析 / 需求 / 数据结构 / APIs / 文件等** - -### 哲学 - -软件公司核心资产有三:可运行的代码,SOP,团队。有公式: - -``` -可运行的代码 = SOP(团队) -``` - -我们践行了这个过程,并且将SOP以代码形式表达了出来,而团队本身仅使用了大模型 +1. 目前,我们已经使 GPT 能够以团队的形式工作,协作处理更复杂的任务 + 1. 该团队可以消化**一句话的老板需求**合作并生成**用户故事 / 竞品分析 / 需求 / 数据结构 / APIs / 文件等** + 2. 该团队包括**产品经理 / 架构师 / 项目经理 / 工程师**,它提供了一个**软件公司**的全过程 ## 示例(均由 GPT-4 生成) @@ -27,11 +15,11 @@ ## 示例(均由 GPT-4 生成) 1. 生成一个带有分析和设计的示例大约需要**$0.2** (GPT-4 api 的费用) 2. 生成一个完整项目的示例大约需要**$2.0** (GPT-4 api 的费用) -| | 设计一个支持 GPT-4 和其他 LLMs 的 MLOps/LLMOps 框架 | 设计一个像 Candy Crush Saga 的游戏 | 设计一个像今日头条的 RecSys | 设计一个像 NetHack 的 roguelike 游戏 | 设计一个搜索算法框架 | 设计一个简约的番茄钟计时器 | -|-------------|-------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------| -| 竞品分析 | ![LLMOps 竞品分析](resources/workspace/llmops_framework/resources/competitive_analysis.png) | ![Candy Crush 竞品分析](resources/workspace/match3_puzzle_game/resources/competitive_analysis.png) | ![今日头条 Recsys 竞品分析](resources/workspace/content_rec_sys/resources/competitive_analysis.png) | ![NetHack 游戏竞品分析](resources/workspace/pyrogue/resources/competitive_analysis.png) | ![搜索算法框架竞品分析](resources/workspace/search_algorithm_framework/resources/competitive_analysis.png) | ![简约番茄钟计时器竞品分析](resources/workspace/minimalist_pomodoro_timer/resources/competitive_analysis.png) | -| 数据 & API 设计 | ![LLMOps 数据 & API 设计](resources/workspace/llmops_framework/resources/data_api_design.png) | ![Candy Crush 数据 & API 设计](resources/workspace/match3_puzzle_game/resources/data_api_design.png) | ![今日头条 Recsys 数据 & API 设计](resources/workspace/content_rec_sys/resources/data_api_design.png) | ![NetHack 游戏数据 & API 设计](resources/workspace/pyrogue/resources/data_api_design.png) | ![搜索算法框架数据 & API 设计](resources/workspace/search_algorithm_framework/resources/data_api_design.png) | ![简约番茄钟计时器数据 & API 设计](resources/workspace/minimalist_pomodoro_timer/resources/data_api_design.png) | -| 序列流程图 | ![LLMOps 序列流程图](resources/workspace/llmops_framework/resources/seq_flow.png) | ![Candy Crush 序列流程图](resources/workspace/match3_puzzle_game/resources/seq_flow.png) | ![今日头条 Recsys 序列流程图](resources/workspace/content_rec_sys/resources/seq_flow.png) | ![NetHack 游戏序列流程图](resources/workspace/pyrogue/resources/seq_flow.png) | ![搜索算法框架序列流程图](resources/workspace/search_algorithm_framework/resources/seq_flow.png) | ![简约番茄钟计时器序列流程图](resources/workspace/minimalist_pomodoro_timer/resources/seq_flow.png) | +| | 设计一个支持 GPT-4 和其他 LLMs 的 MLOps/LLMOps 框架 | 设计一个像今日头条的 RecSys | 设计一个搜索算法框架 | +|-------------|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------| +| 竞品分析 | ![LLMOps 竞品分析](resources/workspace/llmops_framework/resources/competitive_analysis.png) | ![今日头条 Recsys 竞品分析](resources/workspace/content_rec_sys/resources/competitive_analysis.png) | ![搜索算法框架竞品分析](resources/workspace/search_algorithm_framework/resources/competitive_analysis.png) | +| 数据 & API 设计 | ![LLMOps 数据 & API 设计](resources/workspace/llmops_framework/resources/data_api_design.png) | ![今日头条 Recsys 数据 & API 设计](resources/workspace/content_rec_sys/resources/data_api_design.png) | ![搜索算法框架数据 & API 设计](resources/workspace/search_algorithm_framework/resources/data_api_design.png) | +| 序列流程图 | ![LLMOps 序列流程图](resources/workspace/llmops_framework/resources/seq_flow.png) | ![今日头条 Recsys 序列流程图](resources/workspace/content_rec_sys/resources/seq_flow.png) | ![搜索算法框架序列流程图](resources/workspace/search_algorithm_framework/resources/seq_flow.png) | ## 安装 @@ -50,7 +38,7 @@ # 第 3 步:克隆仓库到您的本地机器,并进行安装。 ## 配置 -- 您可以在 `config/key.yaml / config/config.yaml / env` 中配置您的 `OPENAI_API_KEY` +- 在 `config/key.yaml / config/config.yaml / env` 中配置您的 `OPENAI_API_KEY` - 优先级顺序:`config/key.yaml > config/config.yaml > env` ```bash @@ -93,31 +81,7 @@ ### 代码实现 await company.run(n_round=n_round) ``` -## 示例:单角色能力与底层LLM调用 - -### 框架同样支持单角色能力,以下是一个销售角色(完整示例见examples) - -```python -from metagpt.const import DATA_PATH -from metagpt.document_store import FaissStore -from metagpt.roles import Sales - -store = FaissStore(DATA_PATH / 'example.pdf') -role = Sales(profile='Sales', store=store) -result = await role.run('Which facial cleanser is good for oily skin?') -``` - -### 框架也支持LLM的直接接口 - -```python -from metagpt.llm import LLM - -llm = LLM() -await llm.aask('hello world') - -hello_msg = [{'role': 'user', 'content': 'hello'}] -await llm.acompletion(hello_msg) -``` +你可以查看`examples`,其中有单角色(带知识库)的使用例子与仅LLM的使用例子。 ## 联系信息