|
1 |
| - |
2 |
| -# <p align="center"><img src='./assets/agents-logo.png' width=300> </p> |
3 |
| -## <p align="center" style="display:inline-block;"><font face="Calisto MT"><font size="4">An Open-source Framework for Autonomous Language Agents</font></font></p> |
4 |
| - |
5 |
| -<p align="center"><a href="https://arxiv.org/pdf/2309.07870.pdf">[📄 Paper]</a> <a href="https://agents-readthedocsio.readthedocs.io/en/latest/index.html">[📄 Doc]</a> |
6 |
| -<a href="http://www.aiwaves-agents.com/">[🌐 Website]</a> |
7 |
| -<a href="#web-demos">[🤖️ Demos]</a> <a href="https://discord.gg/DDPBeFt7">[🔥 Discord]</a> <a href='./assets/wechat.jpg'>[🔥 Wechat Group] </a> |
| 1 | +<div align="center"> |
| 2 | +<img src='./assets/agents-logo.png' width=300px> |
| 3 | + |
| 4 | +## <p align="center">Symbolic Learning Enables Self-Evolving Agents</p> |
| 5 | + |
| 6 | +<p align="center"> |
| 7 | +<a href="https://oe-heart.github.io/Agents2.0/">[🤖Project]</a> |
| 8 | +<a href="">[📄Paper]</a> |
| 9 | +<a href="https://agentsv2.readthedocs.io/">[📝Docs]</a> |
| 10 | +<a href="#overview">[🌟Overview]</a> |
| 11 | +<a href="#installation">[🔧Installation]</a> |
| 12 | +<a href="#citation">[🚩Citation]</a> |
8 | 13 | </p>
|
9 |
| - </p> |
10 |
| -<hr> |
11 |
| - |
12 |
| - |
13 |
| -## Overview |
14 |
| - |
15 |
| -**Agents** is an open-source library/framework for building autonomous language agents. The library is carefully engineered to support important features including **long-short term memory**, **tool usage**, **web navigation**, **multi-agent communication**, and brand new features including **human-agent interaction** and **symbolic control**. With **Agents**, one can customize a language agent or a multi-agent system by simply filling in a config file in natural language and deploy the language agents in a terminal, a Gradio interface, or a backend service. |
16 |
| - |
17 |
| -One major difference between **Agents** and other existing frameworks for language agents is that our framework allows users to provide fine-grained control and guidance to language agents via an **SOP (Standard Operation Process)**. An SOP defines subgoals/subtasks for the overall task and allows users to customize a fine-grained workflow for the language agents. |
18 |
| - |
19 |
| -<p align="center"><img src='./assets/agents-cover.png' width=800></p> |
20 |
| - |
21 |
| -## 📢 Updates |
22 |
| - |
23 |
| -[x] 2023.10.7 **Support LLM-based SOP generation**🎉🎉🎉🎉 |
24 |
| - - [SOP Generation for Multi-Agent](https://huggingface.co/spaces/AIWaves/SOP_Generation-multi)[on Huggingface Space] |
25 |
| - - [SOP Generation for Single-Agent](https://huggingface.co/spaces/AIWaves/SOP_Generation-single)[on Huggingface Space] |
26 |
| - - We recommend strongly that you can create your OWN DEMO by clicking the three dots at the top right and selecting **Duplicate this Space** on Huggingface Space. |
27 |
| - |
28 |
| -[x] 2023.9.20 Deploy Demos on Huggingface Space |
29 |
| - |
30 |
| -[x] 2023.9.12 Official Release |
31 |
| - |
32 |
| -## 💡 Highlights |
33 |
| - |
34 |
| -- **Long-short Term Memory**: Language agents in the library are equipped with both long-term memory implemented via VectorDB + Semantic Search and short-term memory (working memory) maintained and updated by an LLM. |
35 |
| -- **Tool Usage**: Language agents in the library can use any external tools via [function-calling](https://platform.openai.com/docs/guides/gpt/function-calling) and developers can add customized tools/APIs [here](https://github.com/aiwaves-cn/agents/blob/master/src/agents/Component/ToolComponent.py). |
36 |
| -- **Web Navigation**: Language agents in the library can use search engines to navigate the web and get useful information. |
37 |
| -- **Multi-agent Communication**: In addition to single language agents, the library supports building multi-agent systems in which language agents can communicate with other language agents and the environment. Different from most existing frameworks for multi-agent systems that use pre-defined rules to control the order for agents' action, **Agents** includes a *controller* function that dynamically decides which agent will perform the next action using an LLM by considering the previous actions, the environment, and the target of the current states. This makes multi-agent communication more flexible. |
38 |
| -- **Human-Agent interaction**: In addition to letting language agents communicate with each other in an environment, our framework seamlessly supports human users to play the role of the agent by himself/herself and input his/her own actions, and interact with other language agents in the environment. |
39 |
| -- **Symbolic Control**: Different from existing frameworks for language agents that only use a simple task description to control the entire multi-agent system over the whole task completion process, **Agents** allows users to use an **SOP (Standard Operation Process)** that defines subgoals/subtasks for the overall task to customize fine-grained workflows for the language agents. |
40 |
| - |
41 |
| - |
42 |
| -## 🛠 Installation |
43 |
| - |
44 |
| -#### Option 1. Build from source |
45 | 14 |
|
46 |
| - |
47 |
| - git clone https://github.com/aiwaves-cn/agents.git |
48 |
| - cd agents |
49 |
| - pip install -e . |
50 |
| - |
| 15 | + |
| 16 | +[](https://opensource.org/license/apache-2-0) |
| 17 | + |
| 18 | + |
51 | 19 |
|
52 |
| -#### Option 2. Install via PyPI |
| 20 | +--- |
53 | 21 |
|
54 |
| - |
55 |
| - pip install ai-agents |
56 |
| - |
| 22 | +</div> |
57 | 23 |
|
58 |
| -## 📦 Usage |
59 |
| -### 🛠️ Generate the config file |
60 | 24 |
|
61 |
| -#### Option 1. Fill in the config template manually |
| 25 | +## 🔔News |
| 26 | +- [2024-06-25] We release new agents2.0, supporting for agent evaluation and optimazation. |
| 27 | +--- |
62 | 28 |
|
63 |
| -Modify `example/{Muti|Single_Agent}/{target_agent}/config.json` |
| 29 | +## 🌟Overview |
64 | 30 |
|
65 |
| -#### Option 2. Try our [WebUI](http://www.aiwaves.cn/create-agent/) for customizing the config file. |
| 31 | +Agent symbolic learning is a systematic framework for training language agents, which is inspired by the connectionist learning procedure used for training neural nets. We make an analogy between language agents and neural nets: the agent pipeline of an agent corresponds to the computational graph of a neural net, a node in the agent pipeline corresponds to a layer in the neural net, and the prompts and tools for a node correspond to the weights of a layer. In this way, we are able to implement the main components of connectionist learning, i.e., backward propagation and gradient-based weight update, in the context of agent training using language-based loss, gradients, and weights. |
66 | 32 |
|
67 |
| -Haven't figured out how to write the JSON file yet? Check out our [documentation](https://agents-readthedocsio.readthedocs.io/en/latest/index.html)! |
| 33 | +<img src='./assets/overview.png'> |
68 | 34 |
|
69 |
| -#### Option 3. Try Huggingface Space for generating the SOP automatically. |
| 35 | +We implement loss function, back-propagation, and weight optimizer in the context of agent training with carefully designed prompt pipelines. For a training example, our framework first conducts the "forward pass" (agent execution) and stores the input, output, prompts, and tool usage in each node in a "trajectory". We then use a prompt-based loss function to evaluate the outcome, resulting in a "language loss". Afterward, we back-propagate the language loss from the last to the first node along the trajectory, resulting in textual analyses and reflections for the symbolic components within each node, we call them language gradients. Finally, we update all symbolic components in each node, as well as the computational graph consisting of the nodes and their connections, according to the language gradients with another carefully designed prompt. Our approach also naturally supports optimizing multi-agent systems by considering nodes as different agents or allowing multiple agents to take actions in one node. |
70 | 36 |
|
71 |
| - - [SOP Generation for Multi-Agent](https://huggingface.co/spaces/AIWaves/SOP_Generation-multi)[on Huggingface Space] |
72 |
| - - [SOP Generation for Single-Agent](https://huggingface.co/spaces/AIWaves/SOP_Generation-single)[on Huggingface Space] |
73 |
| - - We recommend strongly that you can create your OWN DEMO by clicking the three dots at the top right and selecting **Duplicate this Space** on Huggingface Space. |
| 37 | +--- |
74 | 38 |
|
75 |
| -### 🤖️ The Agent Hub |
76 |
| - |
77 |
| -We provide an **AgentHub **, where you can search for interesting Agents shared by us or other developers, try them out or use them as the starting point to customize your own agent. We encourage you to share your customized agents to help others build their own agents more easily! You can share your customized agents by submitting PRs that adds configs and customized codes [here ](https://github.com/aiwaves-cn/agents/tree/master/examples/Community_Agent). You can also send us your own config files and codes for customized agents by [email ](mailto:[email protected]), and we will share your examples and acknowledge your contribution in future updates! |
78 |
| - |
79 |
| - |
80 |
| - |
81 |
| -## 📷 Examples and Demos |
82 |
| - |
83 |
| -We have provided exemplar config files, code, and demos for both single-agent and multi-agent systems [here](https://github.com/aiwaves-cn/agents/tree/master/examples). |
84 |
| - |
85 |
| -### Web demos |
86 |
| -#### Note |
87 |
| -1.Due to massive traffic, our online demos may suffer from long queue time and unstable issues. **Please follow our [quick start guide](https://github.com/aiwaves-cn/agents/blob/master/examples/README.md)) and deploy language agents locally for testing. Or checkout our [website](http://www.aiwaves-agents.com/)**. |
88 |
| -2.Software Company is unable to generate executable code online, **if you wish to generate executable code directly, please run it locally :)** |
89 |
| -- [Customer Service Agent](https://www.aiwaves.cn/customer-service-agent/) |
90 |
| -- [Debate](https://huggingface.co/spaces/AIWaves/Debate)[now on Huggingface Space] |
91 |
| -- [Software Company](https://huggingface.co/spaces/AIWaves/Software_Company)[now on Huggingface Space] |
92 |
| -- [Fiction Studio](https://www.aiwaves.cn/fiction-studio/) |
93 |
| - |
94 |
| - |
95 |
| -## Contributing to Agents |
96 |
| -We appreciate your interest in contributing to our open-source initiative. Please feel free to submit a PR or share your thoughts on how to improve the library in Issues! |
97 |
| - |
98 |
| -## Note: |
99 |
| -1. When running the code, we will download an embedding model, which will cause the code to run slowly. We will adjust it to the API interface later |
100 |
| -2. Currently, the shopping assistant cannot be used. We will replace the API later. Stay tuned |
| 39 | +## 🔧Installation |
101 | 40 |
|
| 41 | +**Installation from git repo branch:** |
| 42 | +``` |
| 43 | +pip install git+https://github.com/aiwaves-cn/agents@master |
| 44 | +``` |
102 | 45 |
|
103 |
| -## 📚 Documentation |
| 46 | +**Installation for local development:** |
| 47 | +``` |
| 48 | +git clone -b master https://github.com/aiwaves-cn/agents |
| 49 | +cd agents |
| 50 | +pip install -e . |
| 51 | +``` |
104 | 52 |
|
105 |
| -Please check our [documentation](https://agents-readthedocsio.readthedocs.io/en/latest/index.html) for detailed documentation of the framework. |
| 53 | +--- |
106 | 54 |
|
107 | 55 | ## ⭐ Star History
|
108 | 56 | [](https://star-history.com/#aiwaves-cn/agents&Date)
|
109 | 57 |
|
110 |
| -## Citation |
111 |
| -If you find our repo useful in your research, please kindly consider cite: |
112 |
| -```angular2 |
113 |
| -@misc{zhou2023agents, |
| 58 | +--- |
| 59 | + |
| 60 | +## 🚩Citation |
| 61 | + |
| 62 | +If you find our repository useful in your research, please kindly consider cite: |
| 63 | +```bibtex |
| 64 | +@article{zhou2023agents, |
114 | 65 | title={Agents: An Open-source Framework for Autonomous Language Agents},
|
115 | 66 | author={Wangchunshu Zhou and Yuchen Eleanor Jiang and Long Li and Jialong Wu and Tiannan Wang and Shi Qiu and Jintian Zhang and Jing Chen and Ruipu Wu and Shuai Wang and Shiding Zhu and Jiyu Chen and Wentao Zhang and Ningyu Zhang and Huajun Chen and Peng Cui and Mrinmaya Sachan},
|
116 | 67 | year={2023},
|
|
0 commit comments