An Autonomous LLM Agent for Advanced Problem Solving
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.
🛠️ 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-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"
You can use the
--upload_filesargument to specify the initial files that you want to upload to XAgent.
The local workspace for your XAgent is located in
local_workspace, where you can see all the files that XAgent creates during the execution.
After the execution is finished, the complete
ToolServerNodewill be copied to
running_recordsfor your reference.
In addition, in
running_recordsyou can find all the intermediate steps information, such as task statuses, LLM’s input-output pairs, used tools, etc.
You can load from a record to reproduce a previous run, just by setting
record_dirin 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.
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
Join Guidady AI Mail List
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.