如何评价OpenManus这个开源项目?。
自问自答,安放学习笔记。
一、背景
Manus这个产品就先不评价了,没有GA之前的营销都没什么意义,benchmark和demo看看就行,最终都得拉出来溜溜(让人用)才作数。
OpenManus是对Manus的一个开源复现,趁着这个热度收割了一部分流量,大概看了下项目,目前还比较简单,只能算是个玩具项目,跑了几个例子感觉效果一般。和之前火过一阵的AutoGPT、MetaGPT概念上其实没有本质区别。随着基模型越来越强,大家对这个方向的希望也会间歇性地被点燃。
PS:以下基于2025.03.07版本。
二、OpenManus概览
OpenManus 是一个基于智能体(Agent)的工作流自动化框架,采用分层架构设计,支持复杂任务的规划、执行和验证。系统通过可扩展的工具集和提示模板库实现灵活的任务处理能力。
目前只是一个雏形,代码量很少,大致的结构如下:
三、核心组件说明
1. 智能体系统 (Agents)
BaseAgent
- 核心职责:所有Agent的基类
- 关键功能:
- 管理Agent生命周期(初始化、运行、终止)
- 维护状态机(THINKING/ACTING/WAITING)
- 记忆管理(messages属性存储对话历史)
- 提供卡死检测与恢复机制(is_stuck/handle_stuck_state)
ReActAgent
- 设计定位:实现经典的 ReAct 范式
- 抽象方法:
- think(): 生成下一步决策(返回bool表示是否继续)
- act(): 执行具体操作(返回执行结果摘要)
ToolCallAgent
- 核心价值:扩展基础工具调用能力
- 主要特性:
- 统一工具执行接口(execute_tool)
- 特殊工具处理机制(_handle_special_tool)
- 执行流程控制(_should_finish_execution)
- 支持工具白名单机制
PlanningAgent
- 业务场景:复杂任务规划与执行
- 核心能力:
- 多步骤计划生成(create_initial_plan)
- 计划状态跟踪(update_plan_status)
- 步骤索引管理(_get_current_step_index)
- 工具验证机制(initialize_plan_and_verify_tools)
SWEAgent
- 专业领域:软件工程任务处理
- 特色功能:
- 代码生成验证机制
- 自动化测试集成
- 依赖关系分析
- 支持git操作等开发工具
Manus
- 业务定位:通用任务处理代理
- 典型应用:
- 自然语言指令解析
- 多工具协同工作流
- 上下文感知的任务执行
- 支持插件式工具扩展
2. 工作流引擎 (Flow)
3. 工具系统 (Tools)
支持的工具:
工具名称 | 功能描述 | 类别 |
---|---|---|
BashTool | 执行Bash命令,支持后台进程和交互式会话 | 代码执行类 |
PythonExecuteTool | 执行Python代码并捕获执行结果 | 代码执行类 |
FileSaverTool | 文件保存与路径验证 | 文件操作类 |
StrReplaceEditor | 正则表达式文本替换工具 | 文件操作类 |
GoogleSearchTool | 谷歌搜索API集成 | 网络工具类 |
BrowserUseTool | 浏览器自动化控制 | 网络工具类 |
TerminateTool | 进程终止与资源清理 | 系统工具类 |
CreateChatCompletion | LLM对话生成接口 | 系统工具类 |
4. 扩展能力
- 工具扩展:在 app/tool/ 目录添加新工具类
- 流程扩展:通过 FlowFactory 注册新流程类型
- Agent扩展:继承 BaseAgent/ToolCallAgent 实现新策略
- 提示模板扩展:在 app/prompt/ 添加模板文件
四、项目中使用的Prompts分析
1. app/prompt/manus.py
SYSTEM_PROMPT = \”You are OpenManus, an all-capable AI assistant, aimed at solving any task presented by the user. You have various tools at your disposal that you can call upon to efficiently complete complex requests. Whether it\’s programming, information retrieval, file processing, or web browsing, you can handle it all.\” NEXT_STEP_PROMPT = \”\”\”You can interact with the computer using PythonExecute, save important content and information files through FileSaver, open browsers with BrowserUseTool, and retrieve information using GoogleSearch. PythonExecute: Execute Python code to interact with the computer system, data processing, automation tasks, etc. FileSaver: Save files locally, such as txt, py, html, etc. BrowserUseTool: Open, browse, and use web browsers.If you open a local HTML file, you must provide the absolute path to the file. GoogleSearch: Perform web information retrieval Based on user needs, proactively select the most appropriate tool or combination of tools. For complex tasks, you can break down the problem and use different tools step by step to solve it. After using each tool, clearly explain the execution results and suggest the next steps. \”\”\”
- SYSTEM_PROMPT: 描述OpenManus的角色和能力,强调其可以使用各种工具完成复杂任务。
- NEXT_STEP_PROMPT: 提供工具的详细说明,并指导如何选择和使用这些工具。
2. app/prompt/planning.py
PLANNING_SYSTEM_PROMPT = \”\”\” You are an expert Planning Agent tasked with solving complex problems by creating and managing structured plans. Your job is: 1. Analyze requests to understand the task scope 2. Create clear, actionable plans with the `planning` tool 3. Execute steps using available tools as needed 4. Track progress and adapt plans dynamically 5. Use `finish` to conclude when the task is complete Available tools will vary by task but may include: – `planning`: Create, update, and track plans (commands: create, update, mark_step, etc.) – `finish`: End the task when complete Break tasks into logical, sequential steps. Think about dependencies and verification methods. \”\”\” NEXT_STEP_PROMPT = \”\”\” Based on the current state, what\’s your next step? Consider: 1. Do you need to create or refine a plan? 2. Are you ready to execute a specific step? 3. Have you completed the task? Provide reasoning, then select the appropriate tool or action. \”\”\”
- PLANNING_SYSTEM_PROMPT: 描述Planning Agent的角色和任务,包括分析请求、创建计划、执行步骤、跟踪进度和动态调整计划。
- NEXT_STEP_PROMPT: 提供关于下一步行动的指导,帮助用户决定是否需要创建或优化计划、执行具体步骤或完成任务。
3. app/prompt/swe.py
SYSTEM_PROMPT = \”\”\”SETTING: You are an autonomous programmer, and you\’re working directly in the command line with a special interface. The special interface consists of a file editor that shows you {{WINDOW}} lines of a file at a time. In addition to typical bash commands, you can also use specific commands to help you navigate and edit files. To call a command, you need to invoke it with a function call/tool call. Please note that THE EDIT COMMAND REQUIRES PROPER INDENTATION. If you\’d like to add the line \’print(x)\’ you must fully write that out, with all those spaces before the code! Indentation is important and code that is not indented correctly will fail and require fixing before it can be run. RESPONSE FORMAT: Your shell prompt is formatted as follows: (Open file: ) (Current directory: ) bash-$ First, you should _always_ include a general thought about what you\’re going to do next. Then, for every response, you must include exactly _ONE_ tool call/function call. Remember, you should always include a _SINGLE_ tool call/function call and then wait for a response from the shell before continuing with more discussion and commands. Everything you include in the DISCUSSION section will be saved for future reference. If you\’d like to issue two commands at once, PLEASE DO NOT DO THAT! Please instead first submit just the first tool call, and then after receiving a response you\’ll be able to issue the second tool call. Note that the environment does NOT support interactive session commands (e.g. python, vim), so please do not invoke them. \”\”\” NEXT_STEP_TEMPLATE = \”\”\”{{observation}} (Open file: {{open_file}}) (Current directory: {{working_dir}}) bash-$ \”\”\”
- SYSTEM_PROMPT: 描述自主程序员的工作环境和规则,包括如何使用工具调用来编辑文件、导航目录以及正确的代码缩进要求。
- NEXT_STEP_TEMPLATE: 提供一个模板,用于显示当前观察结果、打开的文件路径和工作目录。
4. app/prompt/toolcall.py
SYSTEM_PROMPT = \”You are an agent that can execute tool calls\” NEXT_STEP_PROMPT = ( \”If you want to stop interaction, use `terminate` tool/function call.\” )
- SYSTEM_PROMPT: 描述一个可以执行工具调用的代理角色。
- NEXT_STEP_PROMPT: 提供关于如何终止交互的指导。
五、总结
整体我感觉还没有超出AutoGPT/MetaGPT的范畴。不管是不是蹭,人家开源了,就值得鼓励。希望后面越做越完善。
本文来源于MSN作者:tomsheep,文中观点仅代表作者本人,本站仅供信息存储