GitHub - leochame/OpenManus-Java

OpenManusJava

OpenManusJava Logo

An Intelligent Thinking System Based on Java - A Multi-modal Agent Framework with Fast/Slow Thinking

Java Spring Boot LangChain4j License

๐Ÿš€ Quick Start โ€ข ๐ŸŽฏ Features โ€ข ๐Ÿ—๏ธ Architecture โ€ข

๐Ÿ“‹ Project Overview

OpenManusJava is an intelligent thinking system developed based on Spring Boot and LangChain4j. It adopts a "fast thinking/slow thinking" dual-mode architecture, combining the efficiency of direct output with the depth of a think-execute-reflect loop. The system can automatically or manually select the most appropriate thinking mode according to task complexity, significantly improving the processing quality of complex tasks.

๐ŸŽฏ Features

๐Ÿง  Multi-modal Intelligent Thinking

  • Fast Thinking Mode: Direct execution for high efficiency, suitable for simple tasks.
  • Slow Thinking Mode: Think-execute-reflect loop, suitable for complex tasks.
  • Automatic Mode: Intelligently selects the thinking mode based on task complexity.

๐Ÿ’ญ Intelligent Agent System

  • FastThinkWorkflow: A workflow for quick responses.
  • ThinkDoReflectWorkflow: A workflow for cyclic reflection.
  • Multiple Specialized Agents: Specialized agents for thinking, execution, reflection, etc.

๐Ÿ”ง Tool Ecosystem

  • Code Execution: Executes code and analyzes the results.
  • File Operations: Manages files and content.
  • Web Access: Intelligently retrieves information.

๐ŸŽจ User Interface

  • Modern 3-Column Workspace:
    • Left: An intelligent chat panel for core human-computer interaction.
    • Middle: A versatile tool panel displaying structured search results, tool outputs, and files.
    • Right: A browser workspace with multi-tab support, address bar navigation, and dual-mode (Web/VNC) capabilities.
  • Real-time Thinking Process: Visualizes the AI's thinking steps and logs.
  • Responsive Design: Adapts to desktop, tablet, and mobile devices.

๐Ÿ–ผ๏ธ UI Preview

Workspace Overview

Web Preview (Proxy Mode)

Note: Some websites block being embedded in an iframe via security headers like X-Frame-Options or CSP frame-ancestors. If you see โ€œๆญค็ฝ‘็ซ™ๆ— ๆณ•ๅœจๆญค้ข„่งˆโ€, enable the โ€œไปฃ็†โ€ toggle in the address bar to load the page through the backend proxy.

๐Ÿ—๏ธ Architecture

Core Architecture Diagram

graph TD
    User --> UI[Web Interface]
    UI --> Controller[AgentController]
    
    Controller --> Service[AgentService]
    
    subgraph "Workflow"
        Service -->|Complex Task| TDR[ThinkDoReflectWorkflow<br/>Deep Thinking]
        Service -->|Simple Task| FT[FastThinkWorkflow<br/>Quick Response]
    end
    
    TDR --> TA[ThinkingAgent<br/>Analyze & Plan]
    TA --> EA[ExecutionAgent<br/>Execute Task]
    EA --> RA[ReflectionAgent<br/>Evaluate Result]
    RA -->|Task Complete| FinalResult[Final Result]
    RA -->|Needs More Work| TA
    
    subgraph "Tool Layer"
        CodeTool[Code Execution Tool]
        FileTool[File Operation Tool]
        SearchTool[Information Retrieval Tool]
    end
    
    EA --> CodeTool
    EA --> FileTool
    EA --> SearchTool
    
    FT --> FinalResult
    FinalResult --> WebSocket --> UI
Loading

Technology Stack

Component Technology Purpose
Backend Framework Spring Boot 3.2.0 Core application framework
AI Integration LangChain4j 1.1.0 LLM integration and multi-agent collaboration
Frontend Vue.js 3 + Element Plus Modern, responsive user interface
Real-time Comms WebSocket + STOMP Real-time messaging and log streaming
API RESTful API Service interface
Documentation Markdown Project documentation

๐Ÿš€ Quick Start

Prerequisites

  • Java 21+
  • Maven 3.9+
  • Alibaba Cloud Bailian API Key (or other supported LLM service)

Installation

  1. Clone the project

    git clone https://github.com/OpenManus/OpenManus-Java.git
    cd OpenManus-Java
  2. Configure API keys (recommended) Copy dotenv.example to .env and fill in your API keys:

  3. Optional: override application config Use src/main/resources/application-example.yml as a reference, and create src/main/resources/application-local.yml for personal overrides.

  4. Start the application

    If you created application-local.yml, run with the local profile:

    mvn spring-boot:run -Dspring-boot.run.profiles=local
  5. Access the service Open your browser and go to: http://localhost:8089

For a one-command setup (Docker Compose), see: docs/QUICK_START.md.

๐Ÿ“Š Usage

Unified API Endpoint

All interactions are handled through a unified streaming API, think-do-reflect-stream, which automatically processes and returns real-time progress.

# Example Request
curl -X POST http://localhost:8089/api/agent/think-do-reflect-stream \
  -H "Content-Type: application/json" \
  -d '{"input": "Analyze the development trend of the tourism industry during the Spring Festival."}'

API Documentation

Swagger UI: http://localhost:8089/swagger-ui.html

๐Ÿ“ฌ Contact Me

๐Ÿ™ Acknowledgements

Thanks to the following open-source projects for their support:

๐Ÿ“„ License

This project is licensed under the MIT License.


๐ŸŒŸ If this project is helpful to you, please give it a Star!