$ show FoundationAgents/OpenManus
OpenManus is an open-source framework for building general AI agents, inspired by the Manus agent. It provides a modular architecture with a hierarchy of agents (BaseAgent, ReActAgent, ToolCallAgent, Manus, SWEAgent, BrowserAgent, etc.), a rich set of tools (bash, file editing, web search, browser automation, code execution, chart visualization, desktop automation), and multiple execution modes: single-agent CLI, multi-agent planning flow, MCP client/server, and sandboxed execution via Docker or Daytona. The system is LLM-agnostic, supporting OpenAI, Anthropic, Azure, AWS Bedrock, Ollama, and others through a configurable LLM abstraction. It also implements the A2A (Agent-to-Agent) protocol for inter-agent communication. While primarily an application framework, it includes data analysis and chart generation capabilities, giving it a hybrid character. The codebase is well-structured with clean abstractions, but contains some hardcoded values and Chinese comments that may hinder maintainability.
The LLM identified 5 files worth highlighting for reuse:
Implements a file editing tool that uses diff-based operations (insert, delete, replace) with context matching to safely modify files. It validates edits by checking surrounding context lines, preventing accidental corruption. This pattern is reusable for any system requiring controlled file modifications, such as code assistants or configuration management tools.
Provides desktop automation capabilities (mouse clicks, keyboard input, screenshot) within a sandboxed environment using VNC and xdotool. It abstracts the complexity of remote desktop control into a simple tool interface, making it reusable for any agent needing GUI interaction in isolated environments.
Generates charts from data using the VMind library (Node.js) and renders them via Puppeteer. It accepts data as a string, creates a chart specification, and returns a base64-encoded PNG. This component demonstrates a clean integration of a JavaScript visualization library into a Python agent framework, reusable for any system needing automated chart creation.
Implements a planning flow that uses an LLM to create a structured plan with steps, then delegates each step to an appropriate agent (e.g., Manus, SWEAgent). It tracks step statuses, handles failures with fallback, and supports dynamic agent selection based on step type. This pattern is reusable for any multi-step task orchestration system.
Provides a unified LLM abstraction supporting multiple providers (OpenAI, Anthropic, Azure, AWS Bedrock, Ollama, etc.) with features like automatic retry (tenacity), token counting (including image tokens), streaming, and tool-call support. It uses a singleton pattern per configuration and handles message formatting, making it a reusable foundation for any LLM-powered application.