{"id":13441540,"url":"https://github.com/OpenBMB/XAgent","last_synced_at":"2025-03-20T12:31:24.915Z","repository":{"id":200453236,"uuid":"705460972","full_name":"OpenBMB/XAgent","owner":"OpenBMB","description":"An Autonomous LLM Agent for Complex Task Solving","archived":false,"fork":false,"pushed_at":"2024-08-12T06:41:38.000Z","size":139111,"stargazers_count":8079,"open_issues_count":50,"forks_count":830,"subscribers_count":75,"default_branch":"main","last_synced_at":"2024-10-10T13:24:51.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://blog.x-agent.net/blog/xagent/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenBMB.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-16T03:44:57.000Z","updated_at":"2024-10-10T09:54:24.000Z","dependencies_parsed_at":"2024-06-19T03:10:57.638Z","dependency_job_id":null,"html_url":"https://github.com/OpenBMB/XAgent","commit_stats":null,"previous_names":["openbmb/xagent"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBMB%2FXAgent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBMB%2FXAgent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBMB%2FXAgent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenBMB%2FXAgent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenBMB","download_url":"https://codeload.github.com/OpenBMB/XAgent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221760027,"owners_count":16876338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:35.239Z","updated_at":"2025-03-20T12:31:24.910Z","avatar_url":"https://github.com/OpenBMB.png","language":"Python","readme":"\u003cdiv align= \"center\"\u003e\n    \u003ch1\u003e \u003cimg src=\"assets/readme/xagent_logo.png\" height=40 align=\"texttop\"\u003eXAgent\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![Twitter](https://img.shields.io/twitter/follow/XAgent?style=social)](https://twitter.com/XAgentTeam) [![Discord](https://img.shields.io/badge/XAgent-Discord-purple?style=flat)](https://discord.gg/zncs5aQkWZ) [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://opensource.org/license/apache-2-0/) ![Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca\u003eEnglish\u003c/a\u003e •\n    \u003ca href=\"README_ZH.md\"\u003e中文\u003c/a\u003e •\n    \u003ca href=\"README_JA.md\"\u003e日本語\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#quickstart\"\u003eTutorial\u003c/a\u003e •\n  \u003ca href=\"https://www.youtube.com/watch?v=QGkpd-tsFPA\"\u003eDemo\u003c/a\u003e •\n  \u003ca href=\"https://blog.x-agent.net/blog/xagent/\"\u003eBlog\u003c/a\u003e •\n  \u003ca href=\"https://xagent-doc.readthedocs.io/en/latest/\"\u003eDocumentation\u003c/a\u003e •\n  \u003ca href=\"#Citation\"\u003eCitation\u003c/a\u003e\n\u003c/p\u003e\n\n\n## 📖 Introduction\n\nXAgent is an open-source experimental Large Language Model (LLM) driven autonomous agent that can automatically solve various tasks. \nIt is designed to be a general-purpose agent that can be applied to a wide range of tasks. XAgent is still in its early stages, and we are working hard to improve it.\n\n🏆 Our goal is to create a super-intelligent agent that can solve any given task!\n\nWe welcome diverse forms of collaborations, including full-time and part-time roles and more. If you are interested in the frontiers of agents and want to join us in realizing true autonomous agents, please contact us at xagentteam@gmail.com.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"assets/readme/overview.png\" alt=\"Overview of Xagent\" width=\"700\"/\u003e\n    \u003cbr/\u003e\n    \u003cfigcaption\u003eOverview of XAgent.\u003c/figcaption\u003e\n\u003c/div\u003e\n\n### \u003cimg src=\"assets/readme/xagent_logo.png\" height=30 align=\"texttop\"\u003e XAgent\n\nXAgent is designed with the following features:\n- **Autonomy**: XAgent can automatically solve various tasks without human participation.\n- **Safety**: XAgent is designed to run safely. All actions are constrained inside a docker container. Run it anyway!\n- **Extensibility**: XAgent is designed to be extensible. You can easily add new tools to enhance agent's abilities and even new agents！\n- **GUI**: XAgent provides a friendly GUI for users to interact with the agent. You can also use the command line interface to interact with the agent.\n- **Cooperation with Human**: XAgent can collaborate with you to tackle tasks. It not only has the capability to follow your guidance in solving complex tasks on the go but it can also seek your assistance when it encounters challenges.\n\nXAgent is composed of three parts:\n- **🤖 Dispatcher** is responsible for dynamically instantiating and dispatching tasks to different agents. It allows us to add new agents and improve the agents' abilities.\n- **🧐 Planner** is responsible for generating and rectifying plans for tasks. It divides tasks into subtasks and generates milestones for them, allowing agents to solve tasks step by step.\n- **🦾 Actor** is responsible for conducting actions to achieve goals and finish subtasks. The actor utilizes various tools to solve subtasks, and it can also collaborate with humans to solve tasks.\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"assets/readme/workflow.png\" alt=\"Workflow of Xagent\" width=\"700\"/\u003e\n    \u003cbr/\u003e\n    \u003cfigcaption\u003eWorkflow of XAgent.\u003c/figcaption\u003e\n\u003c/div\u003e\n\n### 🧰 ToolServer\n\nToolServer is the server that provides XAgent with powerful and safe tools to solve tasks. It is a docker container that provides a safe environment for XAgent to run.\nCurrently, ToolServer provides the following tools:\n- **📝 File Editor** provides a text editing tool to write, read, and modify files.\n- **📘 Python Notebook** provides an interactive Python notebook that can run Python code to validate ideas, draw figures, etc.\n- **🌏 Web Browser** provides a web browser to search and visit webpages.\n- **🖥️ Shell** provides a bash shell tool that can execute any shell commands, even install programs and host services.\n- **🧩 Rapid API** provides a tool to retrieve APIs from Rapid API and call them, which offers a wide range of APIs for XAgent to use. See [ToolBench](https://github.com/OpenBMB/ToolBench) to get more information about the Rapid API collections.\nYou can also easily add new tools to ToolServer to enhance XAgent's abilities.\n\n\u003cdiv\u003e\u003ca id=\"Quickstart\"\u003e\u003c/a\u003e\u003c/div\u003e\n\n## ✨ Quickstart\n\n### 🛠️ Build and Setup ToolServer\n\nToolServer is where XAgent's action takes place. It is a docker container that provides a safe environment for XAgent to run.\nSo you should install `docker` and `docker-compose` first. \nThen, you need to build the ToolServer image. Construct referring to any one of the following methods:\n\n#### Pull the image from docker hub by running the following command:\n\n```bash\ndocker compose up\n```\n\n#### Build an image from local sources by running the following command:\n\n```bash\ndocker compose build\ndocker compose up\n```\nThis will build the image for the ToolServer and start the ToolServer's container. \nIf you want to run the container in the background, please use `docker compose up -d`.\nRefer [here](ToolServer/README.md) for detailed information about our ToolServer.\n\nIf the ToolServer is updated, you have to repull/rebuild the images:\n```bash\ndocker compose pull\n```\nOr\n```bash\ndocker compose build\n```\n\n### 🎮 Setup and Run XAgent\n\nAfter setting up ToolServer, you can start to run XAgent.\n- Install requirements (Require Python \u003e= 3.10)\n```bash\npip install -r requirements.txt\n```\n\n- Configure XAgent\n\n1. You should configure XAgent in `assets/config.yml` before running it. \n2. At least one OpenAI key is provided in `assets/config.yml`, which is used to access OpenAI API.\nWe highly recommend using `gpt-4-32k` to run XAgent; `gpt-4` is also OK for most simple tasks.\nIn any case, at least one `gpt-3.5-turbo-16k` API key should be provided as a backup model.\nWe do not test or recommend using `gpt-3.5-turbo` to run XAgent due to minimal context length; you should not try to run XAgent on that.\n3. If you want to change the config_file path for `XAgentServer`, you should modify the `CONFIG_FILE` value in `.env` file and restart the docker container.\n\n\n- Run XAgent\n```bash\npython run.py --task \"put your task here\" --config-file \"assets/config.yml\"\n```\n1. You can use the argument `--upload-files` to select the initial files you want to submit to XAgent.\n\n2. The local workspace for your XAgent is in `local_workspace`, where you can find all the files generated by XAgent throughout the running process. \n\n3. After execution, the entire `workspace` in `ToolServerNode` will be copied to `running_records` for your convenience.\n\n4. Besides, in `running_records`, you can find all the intermediate steps information, e.g., task statuses, LLM's input-output pairs, used tools, etc.\n\n5. You can load from a record to reproduce a former run, just by setting `record_dir` in config(default to `Null`). The record is a system-level recording tied to the code version of XAgent. All running-config、query、code execution statuses (including errors)、server behavior will be documented.\n\n6. We have removed all sensitive information (including API keys) from the record so you can safely share it with others. In the near future, we will introduce more granular sharing options highlighting the contributions of humans during execution.\n\n   \n\n- Run XAgent with GUI\nThe container `XAgent-Server` is started with nginx and a web server listening on port `5173`.\nYou could visit `http://localhost:5173` to interact with XAgent by using web UI.\nThe default username and password are `guest` and `xagent`, respectively.\nRefer [here](XAgentServer/README.md) for the detailed information about our GUI Demo.\n\n\u003cdiv\u003e\u003ca id=\"Demo\"\u003e\u003c/a\u003e\u003c/div\u003e\n\n## 🎬 Demo\n\nHere, we also show some cases of solving tasks by XAgent:\nYou can check our live demo on [XAgent Official Website](https://www.x-agent.net/). We also provide a video demo and showcases of using XAgent here:\n![Demo](assets/readme/demo.gif)\n\n### Case 1. Data Analysis: Demonstrating the Effectiveness of Dual-Loop Mechanism\n\nWe start with a case of aiding users in intricate data analysis. Here, our user submitted an `iris.zip` file to XAgent, seeking assistance in data analysis. XAgent swiftly broke down the task into four sub-tasks: (1) data inspection and comprehension, (2) verification of the system's Python environment for relevant data analysis libraries, (3) crafting data analysis code for data processing and analysis, and (4) compiling an analytical report based on the Python code's execution results.\nHere is a figure drawn by XAgent.\n![Data Statics by XAgent](assets/readme/statistics.png)\n\n\n### Case 2. Recommendation: A New Paradigm of Human-Agent Interaction\n\nEmpowered with the unique capability to actively seek human assistance and collaborate in problem-solving, XAgent continues to redefine the boundaries of human-agent cooperation. As depicted in the screenshot below, a user sought XAgent's aid in recommending some great restaurants for a friendly gathering yet failed to provide specific details. Recognizing the insufficiency of the provided information, XAgent employed the AskForHumanHelp tool, prompting human intervention to elicit the user's preferred location, budget constraints, culinary preferences, and dietary restrictions. Armed with this valuable feedback, XAgent seamlessly generated tailored restaurant recommendations, ensuring a personalized and satisfying experience for the user and their friends.\n\n![Illustration of Ask for Human Help of XAgent](assets/readme/ask_for_human_help.png)\n\n### Case 3. Training Model: A Sophisticated Tool User\n\nXAgent not only tackles mundane tasks but also serves as an invaluable aid in complex tasks such as model training. Here, we show a scenario where a user desires to analyze movie reviews and evaluate the public sentiment surrounding particular films. In response, XAgent promptly initiates the process by downloading the IMDB dataset to train a cutting-edge BERT model (see screenshot below), harnessing the power of deep learning. Armed with this trained BERT model, XAgent seamlessly navigates the intricate nuances of movie reviews, offering insightful predictions regarding the public's perception of various films.\n\n![bert_1](assets/readme/bert_1.png)\n![bert_2](assets/readme/bert_2.png)\n![bert_3](assets/readme/bert_3.png)\n\n### 📊 Evaluation\n\nWe conduct human preference evaluation to evaluate XAgent's performance. We prepare [over 50 real-world complex tasks](assets/tasks.yml) for assessment, which can be categorized into 5 classes: Search and Report, Coding and Developing, Data Analysis, Math, and Life Assistant.\nWe compare the results of XAgent with [AutoGPT](https://github.com/Significant-Gravitas/AutoGPT), which shows a total win of XAgent over AutoGPT. \nAll running records can refer to [here](https://drive.google.com/drive/folders/1I-j6FZDyMRrLTpZ64jeN89emA77AbNfc?usp=drive_link).\n\n![HumanPrefer](assets/readme/agent_comparison.png)\n\nWe report a significant improvement of XAgent over AutoGPT in terms of human preference.\n\nWe also evaluate XAgent on the following benchmarks:\n![Benchmarks](assets/readme/eval_on_dataset.png)\n\n\n\u003cdiv\u003e\u003ca id=\"Blog\"\u003e\u003c/a\u003e\u003c/div\u003e\n\n## 🖌️ Blog\n\nOur blog is available at [here](https://blog.x-agent.net/)!\n\n\u003cdiv\u003e\u003ca id=\"Citation\"\u003e\u003c/a\u003e\u003c/div\u003e\n\n## 🌟 Our Contributors\n\nA heartfelt thank you to all our contributors. Your efforts make this project grow and thrive. Every contribution, big or small, is invaluable.\n\n![Contributors](https://contrib.rocks/image?repo=OpenBMB/XAgent)\n\n## 🌟 Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=openbmb/xagent\u0026type=Date)](https://star-history.com/##openbmb/xagent\u0026Date)\n\n## Citation\n\nIf you find our repo useful, please kindly consider citing:\n```angular2\n@misc{xagent2023,\n      title={XAgent: An Autonomous Agent for Complex Task Solving}, \n      author={XAgent Team},\n      year={2023},\n}\n```\n","funding_links":[],"categories":["🤖 Deep Research Systems","Python","[XAgent](https://github.com/OpenBMB/XAgent)","\u003cspan id=\"game\"\u003eGame (World Model \u0026 Agent)\u003c/span\u003e","Automation","Task Automation \u0026 Workflow Orchestration","Standalone Systems","Projects","A01_文本生成_文本对话","📦 Legacy \u0026 Inactive Projects","Agent","Applications","智能体 Agents","Agents","Learning","Repos","开源项目","Open Source Projects","Agent Frameworks (fully local) (25)","Autonomous Agents","Agent Categories","Frameworks"],"sub_categories":["🌐 Open-Source Deep Research Implementations","Links","\u003cspan id=\"tool\"\u003eLLM (LLM \u0026 Tool)\u003c/span\u003e","AI Platform Configurators","Applications","大语言对话模型及数据","Autonomous Agent Task Solver Projects","Repositories","其他聊天机器人","Other / Chatbots","\u003ca name=\"Unclassified\"\u003e\u003c/a\u003eUnclassified"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenBMB%2FXAgent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenBMB%2FXAgent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenBMB%2FXAgent/lists"}