XAgent

XAgent: An Autonomous LLM Agent for Advanced Problem Solving

1 min


XAgent

An Autonomous LLM Agent for Advanced Problem Solving

Github logo

XAgent is a new LLM-based autonomous agent that can perform various tasks without human intervention. It is built on open-source code and can be customized for different domains and scenarios. XAgent aims to be a versatile and flexible agent that can handle complex and diverse challenges.

Features

Autonomy

XAgent can handle various tasks without human intervention.<br />

Safety

XAgent is designed to run safely. All actions are isolated inside a docker container. Run it anyway!<br />

Extensibility

XAgent is designed to be extensible. You can easily add new tools to improve agent's abilities and even new agents!

GUI

XAgent provides a user-friendly GUI for users to interact with the agent. You can also use the command line interface to interact with the agent.

Cooperation with Human

XAgent can work with you to solve tasks. It not only has the ability to follow your instructions in solving complex tasks on the fly but also can ask for your help when it faces difficulties.

XAgent Parts

XAgent is a modular system that consists of three components:

Dispatcher

dynamically creates and assigns tasks to different agents. It enables us to expand the system with new agents and enhance their capabilities.

Planner

Creates and adjusts plans for tasks. It breaks down a task into subtasks and sets milestones for them, enabling agents to tackle tasks incrementally.

Actor

Performs actions to accomplish goals and complete subtasks. The actor uses various tools to handle subtasks, and it can also cooperate with human to solve tasks.

ToolServer

ToolServer is a docker container that hosts various tools for XAgent to use in solving tasks. It offers a secure environment for XAgent to run different applications. Some of the tools available on ToolServer are:

 

File Editor

A text editor that can create, read, and edit files.

Python Notebook

An interactive Python notebook that can execute Python code for testing ideas, plotting graphs, etc.

Web Browser

A web browser that can search and access webpages.

Shell

A bash shell that can run any shell commands, including installing programs and hosting services.

Rapid API

A tool to access and use APIs from Rapid API, which provides a large collection of APIs for XAgent. For more details on the Rapid API collections, see ToolBench. You can also add new tools to ToolServer easily to improve XAgent's capabilities.

Getting Started

🛠️ Build and Setup ToolServer

ToolServer is the core component of XAgent. It is a docker container that hosts the tools and files that XAgent needs to perform its tasks. To use ToolServer, you need to install docker and docker-compose first. hen, you need to build the docker image for ToolServer and launch the docker container.

cd ToolServer
docker-compose up

Check here for detailed information about XAgent ToolServer.

🎮 Setup and Run XAgent

Once ToolServer is ready, you can run XAgent on your tasks.

  • Install requirements (Python >= 3.10 required)
pip install -r requirements.txt
  • Configure XAgent

Before running XAgent, you need to edit the config.yml file to set some parameters. The most important one is the OpenAI key, which allows XAgent to access the OpenAI API. We suggest using gpt-4-32k as the default model for XAgent, gpt-4 is also acceptable for most simple tasks. In any case, you should also provide at least one gpt-3.5-turbo-16k API key as a fallback model. We do not support or recommend using gpt-3.5-turbo as the model for XAgent due to its limited context length, so please avoid using it.

  • Run XAgent
python run.py --task "put your task here" --model "gpt-4"
  1. You can use the --upload_files argument to specify the initial files that you want to upload to XAgent.
    The local workspace for your XAgent is located in

  2. local_workspace, where you can see all the files that XAgent creates during the execution.

  3. After the execution is finished, the complete workspace in ToolServerNode will be copied to running_records for your reference.

  4. In addition, in running_records you can find all the intermediate steps information, such as task statuses, LLM’s input-output pairs, used tools, etc.

  5. You can load from a record to reproduce a previous run, just by setting record_dir in config(default to Null). The record is a system-level recording that matches the code-version of XAgent. All running-config、query、code execution statuses (including errors)、server behavior will be documented.

  6. We have removed all sensitive information (including API keys) from the record, so you can safely share it with others.

  • Run XAgent with GUI
# we ran the web ui docker when build ToolServer network
# run nginx in docker
docker exec XAgent-Server systemctl start nginx

# also, you can start with python
# python3.10+ is required
cd XAgentServer
pip install -r requirements.txt
cd ..
python start_server.py
# you can run web page with following command as well:
cd ../XAgentWeb
npm install
npm run dev

To run XAgent-Server, you need to create and launch a docker image. The server will use the port 8090 to communicate with XAgent. You can access the web interface of XAgent http://localhost:5173.

For more details on how to use the GUI Demo, please check this link.

Alternatives

Mix It Up? Discover More

Join Guidady AI Mail List

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.


Like it? Share with your friends!

0
92 shares

0 Comments

Your email address will not be published. Required fields are marked *

Belmechri

I am an IT engineer, content creator, and proud father with a passion for innovation and excellence. In both my personal and professional life, I strive for excellence and am committed to finding innovative solutions to complex problems.
Choose A Format
Personality quiz
Series of questions that intends to reveal something about the personality
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Poll
Voting to make decisions or determine opinions
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Countdown
The Classic Internet Countdowns
Open List
Submit your own item and vote up for the best submission
Ranked List
Upvote or downvote to decide the best list item
Meme
Upload your own images to make custom memes
Video
Youtube and Vimeo Embeds
Audio
Soundcloud or Mixcloud Embeds
Image
Photo or GIF
Gif
GIF format