AI Manus × Claw Documentation

repository·main·Indexed 23 days ago

https://github.com/simpleyyt/ai-manus

A general-purpose AI Agent system featuring a plan-and-execute architecture that runs tasks in isolated Docker sandboxes. It integrates with OpenClaw for session management and supports a variety of tools including Browser, Shell, File, and MCP. The system includes a Vue 3 frontend with VNC sandbox interaction and a backend utilizing MongoDB and Redis for session history.

Tokens
32.3K
Snippets
55
Records
172
Agent score
79%

What's inside AI Manus

  1. Overview of AI Manus × Claw Frontend features

    main

    The frontend provides a comprehensive interface for interacting with AI agents and the Claw backend:

    • Chat Interface: Supports task sessions, plan panels, and SSE (Server-Sent Events) event streaming.
    • Tool Panels: Rich renderers for various tools including Search, Files, Terminal, Browser, and MCP.
    • Sandbox Interaction: Includes a VNC viewer for real-time viewing and takeover of the sandbox environment.
    • Claw Page: An integrated OpenClaw experience featuring real-time WebSocket messaging, auto-expiry countdowns, and file management.
    • Core Utilities: Authentication/login, session sharing, file upload/download, and internationalization (English and Chinese) via vue-i18n.
  2. Overview of AI Manus × Claw

    main

    AI Manus is an open-source, general-purpose AI Agent system designed for private enterprise deployment. It allows users to run various tools and operations within a secure sandbox environment.

    Key features include:

    • Deployment: Minimal requirements; can be deployed with just an LLM service without external dependencies.
    • Agent Loop: Uses a 'Plan-and-Execute' pattern with composable System Prompts and native structured output tools (e.g., create_plan, complete_step).
    • Tool Support: Includes Terminal, Browser, File, Web Search, and messaging tools. Supports real-time monitoring, manual takeover, and external MCP (Model Context Protocol) tool integration.
    • Claw Integration: Deeply integrated with OpenClaw to provide one-click AI assistant deployment, user-isolated containers, automatic expiration countdowns, and full chat history.
    • Sandbox: Each task is assigned a dedicated sandbox running within a local Docker environment.
    • Session Management: Uses MongoDB and Redis to manage session history and support background tasks.
    • Library: A dedicated 'Library' page aggregates attachments and artifacts from all user sessions, supporting type filtering, searching, file-level favorites, and previews.
  3. AI Manus Project Structure

    main

    The repository is organized into several sub-projects:

    • frontend: The Manus web user interface.
    • backend: The Manus server-side logic.
    • sandbox: The isolated Docker environment for agent tasks.
    • claw: The OpenClaw plugin and container image that bridges the OpenClaw Gateway with the Manus backend.
    • mockserver: A mock LLM server used for development and testing.
  4. Sandbox Container Environment and Debugging

    main

    The sandbox container is pre-configured with the following environment:

    • OS: Ubuntu 22.04
    • Python: 3.10
    • Node.js: 20.x
    • Browser: Google Chrome

    Debugging Browser Sessions:

    1. Connect to the VNC client at localhost:5900.
    2. Access Chrome DevTools via http://localhost:9222/devtools/inspector.html in a browser.
  5. Core Features of AI Manus

    main

    AI Manus provides a comprehensive suite of agentic capabilities:

    • Agent Loop: Uses a plan-and-execute model with composable system prompts and native structured output tools such as create_plan and complete_step.
    • Tool Support: Includes Terminal, Browser, File, Web Search, and message tools. These tools support real-time viewing, user takeover, and external MCP (Model Context Protocol) tool integration.
    • Task Management: Uses Mongo/Redis to manage session history and supports background tasks.
    • Library System: A sidebar Library aggregates attachments and artifacts from all user sessions, featuring type filters, search, favorites, and previews.
    • Conversation Capabilities: Supports stopping/interrupting conversations and file uploads/downloads.
    • Localization: Supports both Chinese and English.
  6. Understand the frontend project structure

    main

    The project follows a standard Vue 3 composition pattern. Key directories include:

    • src/api/: API layer containing Axios clients, SSE, authentication, file handling, Claw, and configuration logic.
    • src/components/: Reusable UI components, including toolViews/ (Browser, File, Terminal, Search, MCP), filePreviews/, login/, settings/, icons/, and ui/ (based on reka-ui).
    • src/composables/: Reusable composable functions like useAgentEvents and useAuth.
    • src/pages/: Main page components such as HomePage.vue, ChatPage.vue, ClawPage.vue, LoginPage.vue, and SharePage.vue.
    • src/locales/: Internationalization (i18n) files for Chinese and English.
    • src/router/: Vue Router configuration.
    • src/types/: TypeScript type definitions.
  7. What is the AI Manus Sandbox service?

    main
    The AI Manus Sandbox is an isolated execution environment based on Docker containers. It provides AI Agents with secure capabilities for executing Shell commands, performing file operations, and conducting browser automation. The service exposes its functionality via a FastAPI-based API and is designed to interact with the backend services.
  8. What is the AI Manus Sandbox and its core features?

    main

    The AI Manus Sandbox is an isolated execution environment based on Docker containers designed for AI Agents. It provides a secure space for agents to perform tasks without affecting the host system.

    Core Capabilities:

    • Shell Command Execution: Securely run shell commands with session management.
    • File Operations: Full file system access (read, write, search, manipulate).
    • Browser Environment: Includes Google Chrome with Chrome DevTools Protocol support and a remote debugging interface.
    • VNC Remote Access: Provides a remote desktop view via VNC and a WebSocket interface.
    • Process Management: Uses Supervisor to manage component processes.
  9. How AI Manus architecture and agent execution works

    main

    AI Manus operates using a Plan-and-Execute loop within isolated Docker sandboxes.

    Execution Flow

    1. Request: The Web UI sends a request to the Backend to create an Agent.
    2. Sandbox Creation: The Backend uses /var/run/docker.sock to spin up a dedicated Ubuntu-based Docker Sandbox.
    3. Tooling: The Sandbox contains tools like Chrome (via xvfb/x11vnc/websockify for VNC viewing), File systems, Shell, and Web Search.
    4. Planning: The PlanAct Agent receives user messages and uses native Tool / Function Calling (via create_plan and complete_step) to generate structured plans and execute steps.
    5. Feedback: Events are streamed back to the Web UI via SSE (Server-Sent Events).

    Key Components

    • Backend: Manages agents, sandboxes, and orchestration.
    • Frontend: The user interface for chatting and viewing tools.
    • Sandbox: The isolated execution environment for tasks.
    • Claw: An OpenClaw-based assistant integration providing user isolation and chat history.
    • Library (库): A sidebar feature that aggregates attachments and artifacts produced during sessions.
  10. Use the Library to manage files

    main

    The Library (route /library) allows users to browse files uploaded or produced across different task sessions.

    Features

    • Aggregation: Files are retrieved via GET /api/v1/library/files, aggregated from all user sessions (session.files), and ordered by recent activity.
    • Filtering: Users can filter by document type (e.g., documents, images) or search by filename.
    • Favorites: Users can mark files as favorites. This state is stored per file ID in the MongoDB file_favorites collection. Use POST /api/v1/library/files/{file_id}/favorite to favorite and DELETE /api/v1/library/files/{file_id}/favorite to remove a favorite.
    • Preview: Users can use the FilePreviewer to view content or jump directly to the source session that produced the file.
  11. How the AI Manus system architecture works

    main

    AI Manus operates through a distributed architecture involving a Web frontend, a Server, and isolated Sandbox environments.

    Conversation Lifecycle

    1. Session Creation: The Web client sends a create Agent request to the Server. The Server creates a Sandbox via /var/run/docker.sock and returns a session_id.
    2. Sandbox Environment: Each Sandbox is an Ubuntu Docker container running a Chrome browser and API services for tools like File, Shell, and Search.
    3. Agent Processing: User messages are forwarded to the PlanAct Agent. The agent plans and executes steps using structured tool calls (e.g., create_plan, complete_step) and invokes Sandbox tools (Shell, Browser, File, Search, MCP).
    4. Real-time Updates: Events are sent through Redis queues and pushed to the Web via WebSockets:
      • Chat events: /api/v1/ws/chat (using join_session / leave_session).
      • Session list updates: /api/v1/ws/sessions.

    Browser Tooling

    To enable browser viewing, the Sandbox runs a headless browser with a VNC service (via xvfb and x11vnc), which is converted to WebSocket via websockify. The Web client connects using a NoVNC component through the Server endpoint: /api/v1/ws/vnc/{session_id} (requires Cookie or Bearer authentication).

  12. Configure LLM Model Providers and Gateways

    main

    AI Manus allows you to switch LLM providers via environment variables without code changes. You can choose between two gateway implementations using LLM_PROVIDER:

    1. langchain (default): Uses LangChain's init_chat_model. This is best for using multiple providers (OpenAI, Anthropic, Ollama, etc.) and leveraging the LangChain ecosystem (retries, JSON repair).
    2. openai: Uses the official OpenAI Python SDK directly. This is best if you only use OpenAI or OpenAI-compatible endpoints (like DeepSeek or vLLM) and want fewer dependencies.

    When using LLM_PROVIDER=langchain, you must set MODEL_PROVIDER to select the specific integration (e.g., openai, deepseek, anthropic, ollama). When using LLM_PROVIDER=openai, the MODEL_PROVIDER setting is ignored.

    # Example: Using LangChain with Anthropic
    LLM_PROVIDER=langchain
    MODEL_PROVIDER=anthropic
    MODEL_NAME=claude-3-5-sonnet-latest
    API_KEY=sk-ant-...
    
    # Example: Using OpenAI SDK directly with a DeepSeek-compatible endpoint
    LLM_PROVIDER=openai
    MODEL_NAME=deepseek-chat
    API_BASE=https://api.deepseek.com/v1
    API_KEY=sk-...