OpenManus Framework

repository·main·Indexed 13 days ago

https://github.com/foundationagents/openmanus

An open-source framework for building general AI agents as an alternative to proprietary platforms. It supports standard agentic workflows, multi-agent flows, and Model Context Protocol (MCP) tool integration. Features include a sandbox execution environment via Daytona, browser automation with Playwright, and a chart visualization tool (v1.0.0) utilizing VMind for intelligent generation.

Tokens
9K
Snippets
41
Records
48
Agent score
97%

What's inside OpenManus

  1. Install and setup the Daytona sandbox agent

    main

    To run OpenManus within a Daytona sandbox environment, you must first install the required dependencies in your existing OpenManus Python environment and then configure your Daytona API key. This setup allows the agent to use sandbox-specific tools like sb_browser_use, sb_shell, and sb_files to perform tasks in an isolated environment.

    # 1. Activate your environment
    conda activate 'Your OpenManus python env'
    
    # 2. Install dependencies
    pip install daytona==0.21.8 structlog==25.4.0
    
    # 3. Prepare configuration
    cd OpenManus
    cp config/config.example-daytona.toml config/config.toml
    
    # 4. Run the sandbox main script
    python sandbox_main.py
  2. Run OpenManus

    main

    Depending on the mode you want to use, run one of the following commands:

    • Standard Mode: Run the general agent.
      python main.py
    • MCP Tool Version: Run using Model Context Protocol tools.
      python run_mcp.py
    • Multi-Agent Flow: Run the experimental multi-agent version.
      python run_flow.py
    # Standard
    python main.py
    
    # MCP version
    python run_mcp.py
    
    # Multi-agent flow
    python run_flow.py
  3. Install the Chart Visualization Tool

    main

    The Chart Visualization Tool generates data processing code via Python and uses @visactor/vmind to produce chart specifications, with @visactor/vchart handling the rendering.

    Mac / Linux Setup

    1. Install Node.js >= 18 using nvm:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
    source ~/.bashrc
    nvm install node
    nvm use 22 # Replace 22 with your installed version
    1. Install dependencies:
    cd app/tool/chart_visualization
    npm install

    Windows Setup

    1. Install nvm-windows by downloading nvm-setup.exe from the official GitHub repository.
    2. Install Node.js using nvm:
    nvm install node
    nvm use 22 # Replace 22 with your installed version
    1. Install dependencies:
    cd app/tool/chart_visualization
    npm install
    cd app/tool/chart_visualization
    npm install
  4. Configure LLM settings in config.toml

    main

    OpenManus requires LLM API configuration.

    1. Create your configuration file by copying the example:
    cp config/config.example.toml config/config.toml
    1. Edit config/config.toml to provide your API keys and model preferences.

    Supported configuration sections include [llm] for global settings and [llm.vision] for vision-specific model settings.

    cp config/config.example.toml config/config.toml
  5. Install OpenManus using uv (Recommended)

    main

    The recommended installation method uses uv for faster dependency management.

    1. Install uv:
      curl -LsSf https://astral.sh/uv/install.sh | sh
    2. Clone the repository and enter the directory:
      git clone https://github.com/FoundationAgents/OpenManus.git
      cd OpenManus
    3. Create and activate a Python 3.12 virtual environment:
      • Unix/macOS:
        uv venv --python 3.12
        source .venv/bin/activate
      • Windows:
        uv venv --python 3.12
        .venv\Scripts\activate
    4. Install dependencies:
        uv pip install -r requirements.txt
    5. (Optional) Install browser automation tools:
      playwright install
    curl -LsSf https://astral.sh/uv/install.sh | sh
    git clone https://github.com/FoundationAgents/OpenManus.git
    cd OpenManus
    uv venv --python 3.12
    source .venv/bin/activate
    uv pip install -r requirements.txt
    playwright install
  6. Set up Manus Agent with A2A Protocol

    main

    This integration combines the OpenManus agent with the A2A protocol (Agent-to-Agent). Note that current support is limited to non-streaming interactions.

    Prerequisites

    1. Activate your OpenManus Python environment (e.g., via conda).
    2. Install the required SDK:
      pip install a2a-sdk==0.2.5

    Running the A2A Server

    Navigate to the OpenManus directory and run the server module:

    cd OpenManus
    python -m protocol.a2a.app.main

    Running an A2A Client

    You can use the A2A official samples to interact with the agent via CLI or a web frontend. To run the Python CLI sample:

    git clone https://github.com/google-a2a/a2a-samples.git
    cd a2a-samples
    echo "GOOGLE_API_KEY=your_api_key_here" > .env
    cd samples/python/hosts/cli
    uv run .
    pip install a2a-sdk==0.2.5
    python -m protocol.a2a.app.main
  7. Install the Chart Visualization Tool on Mac / Linux

    main

    To install the tool on Mac or Linux, you must first install Node.js (version 18 or higher) using nvm, then install the tool's dependencies.

    1. Install and activate nvm and Node.js:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
    source ~/.bashrc
    nvm install node
    nvm use 22 # Replace 22 with your desired version
    1. Install dependencies:
    cd app/tool/chart_visualization
    npm install
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
    source ~/.bashrc
    nvm install node
    nvm use 22
    cd app/tool/chart_visualization
    npm install
  8. Install OpenManus using conda

    main

    Alternatively, you can use conda to set up your environment:

    1. Create and activate a new conda environment with Python 3.12:
      conda create -n open_manus python=3.12
      conda activate open_manus
    2. Clone the repository and enter the directory:
      git clone https://github.com/FoundationAgents/OpenManus.git
      cd OpenManus
    3. Install dependencies:
      pip install -r requirements.txt
    conda create -n open_manus python=3.12
    conda activate open_manus
    git clone https://github.com/FoundationAgents/OpenManus.git
    cd OpenManus
    pip install -r requirements.txt
  9. Monitor sandbox tool execution and results

    main

    When the agent performs tasks in the Daytona sandbox, you can monitor its progress and results using different interfaces depending on the tool being used:

    • sb_browser_use: View live browser operations via the VNC link printed in the terminal (e.g., https://6080-sandbox-123456.h7890.daytona.work).
    • sb_shell: View shell execution results via the Daytona Dashboard Sandboxes page.
    • sb_files: The agent uses this tool to operate on files within the sandbox.
  10. View OpenManus usage examples

    main
    OpenManus provides practical usage examples in the examples directory. These examples demonstrate how the agent handles complex, multi-step requests similar to the Manus platform. The examples are designed to showcase the agent's ability to research, plan, and generate structured outputs (like HTML handbooks) based on specific user constraints and preferences.
  11. Quick Start: Run OpenManus

    main

    Once configured, you can start using OpenManus with the following commands:

    • Standard Agent: Run the main entry point and type your ideas in the terminal:
      python main.py
    • MCP Tool Version: To use the Model Context Protocol (MCP) tools version:
      python run_mcp.py
    • Multi-Agent Version (Unstable): To run the experimental multi-agent flow:
      python run_flow.py
    python main.py
    # or
    python run_mcp.py
    # or
    python run_flow.py