SuperAPI AI Directory

XAgent

XAgent is an open-source experimental autonomous agent developed by OpenBMB, driven by a large language model (LLM), and designed to automatically solve various complex tasks. Its core design consists of three parts: the dispatcher, planner, and actor, supporting autonomous operation, a secure sandbox, tool extension, and a graphical interface, and it can collaborate with humans. Users can deploy the tool server via Docker, configure an OpenAI API key, and then interact with the agent using the command line or web GUI. XAgent is still in an early stage and is suitable for researchers and developers to explore the capabilities of autonomous agents, but attention should be paid to its requirements for model context length and API.

Open website

About this tool

XAgent is an open-source experimental autonomous agent, driven by a large language model (LLM), capable of automatically solving a variety of tasks, with the goal of becoming a general-purpose agent applicable to a wide range of scenarios. The project is developed by OpenBMB and is still in an early stage.

Main Features

  • Autonomy: It can automatically handle various tasks without human participation.
  • Security: All operations are restricted to running inside a Docker container.
  • Extensibility: New tools or new agents can easily be added to enhance capabilities.
  • Graphical Interface: It provides a friendly GUI and also supports command-line interaction.
  • Human-Agent Collaboration: It can follow user guidance and can also proactively seek human help when encountering difficulties.

Architecture Components

  • Dispatcher: Responsible for dynamically instantiating tasks and dispatching them to different agents.
  • Planner: Responsible for task planning and correction, breaking tasks into subtasks and generating milestones.
  • Actor: Responsible for executing actions to complete subtasks, utilizing various tools, and can also collaborate with humans.

ToolServer Tool Server ToolServer is a Docker container that provides a secure runtime environment for XAgent. It currently includes the following tools:

  • File editor: Read, write, and modify files.
  • Python Notebook: Run Python code to verify ideas, plot, etc.
  • Web browser: Search and access web pages.
  • Shell: Execute arbitrary shell commands, even install programs and host services.
  • Rapid API: Retrieve and call APIs from Rapid API, and you can also add new tools yourself.

Usage

  1. Build and start ToolServer: First install Docker and docker-compose, then build the image and start the container (for background running, you can use docker compose up -d).
  2. Install XAgent dependencies (Python >= 3.10 required).
  3. Configure XAgent: In assets/config.yml , provide at least one OpenAI key. It is recommended to use gpt-4-32k; gpt-4 can also be used for simple tasks, and at least provide one gpt-3.5-turbo-16k as a backup model. gpt-3.5-turbo is not recommended.
  4. Run XAgent: You can use --upload-files parameter to select the initial file; the local workspace is in local_workspace, and the run records are in running_records, including intermediate steps, inputs and outputs, tools used, and other information. You can reproduce a run from the records by setting record_dir .
  5. Graphical Interface: After starting the XAgent-Server container, visit http://localhost:5173,默认用户名 guest, password xagent.

Application Scenarios The material presents three cases:

  • Data analysis: the user submits iris.zip, and XAgent automatically breaks it down into subtasks such as data inspection, environment verification, writing analysis code, and generating a report.
  • Recommendation: when the user requests restaurant recommendations but provides insufficient information, XAgent calls the AskForHumanHelp tool to ask a human about location, budget, taste, dietary restrictions, etc., and then generates personalized recommendations.
  • Model training: the user wants to analyze movie reviews and assess public sentiment, and XAgent downloads the IMDB dataset to train a BERT model and make predictions.

Evaluation and Limitations XAgent outperforms AutoGPT in human preference evaluations across more than 50 real complex tasks (search reports, coding development, data analysis, mathematics, life assistant). The project has also participated in multiple benchmark tests. Limitations: the project is in an early stage; running it depends on Docker and the OpenAI API; it has requirements for model context length, with gpt-4-32k recommended, and at least gpt-3.5-turbo-16k needed as a fallback; specific fees, prices, platform support, etc. are not provided.