File size: 14,817 Bytes
9c48ae2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
Metadata-Version: 2.1
Name: autoagents
Version: 0.1
Summary: The Automatic Agents Generation Framework
Home-page: https://github.com/LinkSoul-AI/AutoAgents
Author: Guangyao Chen
Author-email: [email protected]
License: Apache 2.0
Keywords: autoagent multi-agent agent-generation gpt llm
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib==3.8.0
Requires-Dist: matplotlib-inline==0.1.6
Requires-Dist: abstract_singleton==1.0.1
Requires-Dist: aiofiles==23.2.1
Requires-Dist: aiohttp==3.8.4
Requires-Dist: aiosignal==1.3.1
Requires-Dist: altair==5.1.1
Requires-Dist: anthropic==0.3.6
Requires-Dist: anyio==3.7.1
Requires-Dist: appdirs==1.4.4
Requires-Dist: asgiref==3.7.2
Requires-Dist: asttokens==2.2.1
Requires-Dist: astunparse==1.6.3
Requires-Dist: async-generator==1.10
Requires-Dist: async-timeout==4.0.2
Requires-Dist: asynctest==0.13.0
Requires-Dist: attrs==23.1.0
Requires-Dist: auto_gpt_plugin_template==0.0.3
Requires-Dist: autoflake==2.1.1
Requires-Dist: backcall==0.2.0
Requires-Dist: beautifulsoup4==4.12.2
Requires-Dist: black==23.3.0
Requires-Dist: blis==0.7.9
Requires-Dist: cachetools==5.3.0
Requires-Dist: camel-converter==3.0.2
Requires-Dist: catalogue==2.0.8
Requires-Dist: certifi==2023.7.22
Requires-Dist: cffi==1.15.1
Requires-Dist: cfgv==3.3.1
Requires-Dist: channels==4.0.0
Requires-Dist: chardet==5.1.0
Requires-Dist: charset-normalizer==3.1.0
Requires-Dist: click==8.1.3
Requires-Dist: colorama==0.4.6
Requires-Dist: common==0.1.2
Requires-Dist: confection==0.0.4
Requires-Dist: contourpy==1.1.1
Requires-Dist: coverage==7.2.5
Requires-Dist: cryptography==40.0.2
Requires-Dist: cssselect==1.2.0
Requires-Dist: cycler==0.11.0
Requires-Dist: cymem==2.0.7
Requires-Dist: dataclasses-json==0.5.7
Requires-Dist: decorator==5.1.1
Requires-Dist: diskcache==5.6.1
Requires-Dist: distlib==0.3.6
Requires-Dist: distro==1.8.0
Requires-Dist: Django==4.2.3
Requires-Dist: dnspython==2.3.0
Requires-Dist: docker==6.1.2
Requires-Dist: docker-pycreds==0.4.0
Requires-Dist: duckduckgo-search==2.9.4
Requires-Dist: et-xmlfile==1.1.0
Requires-Dist: exceptiongroup==1.1.1
Requires-Dist: execnet==1.9.0
Requires-Dist: executing==1.2.0
Requires-Dist: faiss-cpu==1.7.4
Requires-Dist: fastapi==0.103.1
Requires-Dist: ffmpy==0.3.1
Requires-Dist: filelock==3.12.0
Requires-Dist: fire==0.4.0
Requires-Dist: flake8==6.0.0
Requires-Dist: fonttools==4.42.1
Requires-Dist: frozenlist==1.3.3
Requires-Dist: fsspec==2023.9.2
Requires-Dist: ghp-import==2.1.0
Requires-Dist: gitdb==4.0.10
Requires-Dist: GitPython==3.1.31
Requires-Dist: google-api-core==2.11.0
Requires-Dist: google-api-python-client==2.86.0
Requires-Dist: google-auth==2.18.0
Requires-Dist: google-auth-httplib2==0.1.0
Requires-Dist: google-search-results==2.4.2
Requires-Dist: googleapis-common-protos==1.59.0
Requires-Dist: gradio==3.44.4
Requires-Dist: gradio_client==0.5.1
Requires-Dist: greenlet==2.0.2
Requires-Dist: gTTS==2.3.1
Requires-Dist: h11==0.14.0
Requires-Dist: httpcore==0.17.0
Requires-Dist: httplib2==0.22.0
Requires-Dist: httpx==0.24.0
Requires-Dist: huggingface-hub==0.17.2
Requires-Dist: icecream==2.1.3
Requires-Dist: identify==2.5.24
Requires-Dist: idna==3.4
Requires-Dist: importlib-metadata==6.8.0
Requires-Dist: importlib-resources==6.1.0
Requires-Dist: iniconfig==2.0.0
Requires-Dist: ipdb==0.13.13
Requires-Dist: ipython==8.14.0
Requires-Dist: iso-639==0.4.5
Requires-Dist: isort==5.12.0
Requires-Dist: jedi==0.18.2
Requires-Dist: Jinja2==3.1.2
Requires-Dist: joblib==1.3.2
Requires-Dist: jsonschema==4.17.3
Requires-Dist: kiwisolver==1.4.5
Requires-Dist: langchain==0.0.231
Requires-Dist: langchainplus-sdk==0.0.20
Requires-Dist: langcodes==3.3.0
Requires-Dist: langsmith==0.0.33
Requires-Dist: litellm==0.7.5
Requires-Dist: loguru==0.6.0
Requires-Dist: lxml==4.9.2
Requires-Dist: Markdown==3.3.7
Requires-Dist: MarkupSafe==2.1.2
Requires-Dist: marshmallow==3.19.0
Requires-Dist: marshmallow-enum==1.5.1
Requires-Dist: mccabe==0.7.0
Requires-Dist: meilisearch==0.21.0
Requires-Dist: mergedeep==1.3.4
Requires-Dist: mkdocs==1.4.3
Requires-Dist: mkl-service==2.4.0
Requires-Dist: multidict==6.0.4
Requires-Dist: murmurhash==1.0.9
Requires-Dist: mypy-extensions==1.0.0
Requires-Dist: nltk==3.8.1
Requires-Dist: nodeenv==1.8.0
Requires-Dist: numexpr==2.8.4
Requires-Dist: numpy==1.25.2
Requires-Dist: oauthlib==3.2.2
Requires-Dist: openai==0.27.2
Requires-Dist: openapi-python-client==0.13.4
Requires-Dist: openapi-schema-pydantic==1.2.4
Requires-Dist: opencv-python==4.8.0.76
Requires-Dist: openpyxl==3.2.0b1
Requires-Dist: orjson==3.8.10
Requires-Dist: outcome==1.2.0
Requires-Dist: packaging==23.1
Requires-Dist: pandas==1.4.1
Requires-Dist: parso==0.8.3
Requires-Dist: pathspec==0.11.1
Requires-Dist: pathtools==0.1.2
Requires-Dist: pathy==0.10.1
Requires-Dist: pexpect==4.8.0
Requires-Dist: pickleshare==0.7.5
Requires-Dist: Pillow==9.5.0
Requires-Dist: pinecone-client==2.2.1
Requires-Dist: pip==23.0.1
Requires-Dist: platformdirs==3.5.1
Requires-Dist: playsound==1.2.2
Requires-Dist: pluggy==1.0.0
Requires-Dist: pre-commit==3.3.1
Requires-Dist: preshed==3.0.8
Requires-Dist: promise==2.3
Requires-Dist: prompt-toolkit==3.0.38
Requires-Dist: protobuf==3.20.3
Requires-Dist: psutil==5.9.5
Requires-Dist: ptyprocess==0.7.0
Requires-Dist: pure-eval==0.2.2
Requires-Dist: py-cpuinfo==9.0.0
Requires-Dist: py3langid==0.2.2
Requires-Dist: pyasn1==0.5.0
Requires-Dist: pyasn1-modules==0.3.0
Requires-Dist: pycodestyle==2.10.0
Requires-Dist: pycparser==2.21
Requires-Dist: pydantic==1.10.7
Requires-Dist: pydub==0.25.1
Requires-Dist: pyflakes==3.0.1
Requires-Dist: Pygments==2.15.1
Requires-Dist: pymdown-extensions==10.0.1
Requires-Dist: pyOpenSSL==23.1.1
Requires-Dist: pyparsing==3.0.9
Requires-Dist: pyrsistent==0.19.3
Requires-Dist: PySocks==1.7.1
Requires-Dist: pytest==7.2.2
Requires-Dist: pytest-asyncio==0.21.0
Requires-Dist: pytest-benchmark==4.0.0
Requires-Dist: pytest-cov==4.0.0
Requires-Dist: pytest-integration==0.2.3
Requires-Dist: pytest-mock==3.10.0
Requires-Dist: pytest-recording==0.12.2
Requires-Dist: pytest-xdist==3.3.0
Requires-Dist: python-dateutil==2.8.2
Requires-Dist: python-docx==0.8.11
Requires-Dist: python-dotenv==1.0.0
Requires-Dist: python-multipart==0.0.6
Requires-Dist: pytz==2023.3
Requires-Dist: PyYAML==6.0
Requires-Dist: pyyaml_env_tag==0.1
Requires-Dist: readability-lxml==0.8.1
Requires-Dist: redis==4.5.5
Requires-Dist: regex==2023.5.5
Requires-Dist: requests==2.30.0
Requires-Dist: requests-oauthlib==1.3.1
Requires-Dist: rsa==4.9
Requires-Dist: scikit-learn==1.3.0
Requires-Dist: scipy==1.11.1
Requires-Dist: selenium==4.1.4
Requires-Dist: semantic-version==2.10.0
Requires-Dist: sentry-sdk==1.31.0
Requires-Dist: setproctitle==1.3.2
Requires-Dist: setuptools==65.6.3
Requires-Dist: shellingham==1.5.0.post1
Requires-Dist: shortuuid==1.0.11
Requires-Dist: six==1.16.0
Requires-Dist: smart-open==6.3.0
Requires-Dist: smmap==5.0.0
Requires-Dist: sniffio==1.3.0
Requires-Dist: socksio==1.0.0
Requires-Dist: sortedcontainers==2.4.0
Requires-Dist: soupsieve==2.4.1
Requires-Dist: spacy==3.5.3
Requires-Dist: spacy-legacy==3.0.12
Requires-Dist: spacy-loggers==1.0.4
Requires-Dist: SQLAlchemy==2.0.15
Requires-Dist: sqlparse==0.4.4
Requires-Dist: srsly==2.4.6
Requires-Dist: stack-data==0.6.2
Requires-Dist: starlette==0.27.0
Requires-Dist: tenacity==8.2.2
Requires-Dist: termcolor==2.3.0
Requires-Dist: thinc==8.1.10
Requires-Dist: threadpoolctl==2.2.0
Requires-Dist: tiktoken==0.5.1
Requires-Dist: tokenizers==0.13.3
Requires-Dist: tomli==2.0.1
Requires-Dist: toolz==0.12.0
Requires-Dist: tqdm==4.64.1
Requires-Dist: traitlets==5.9.0
Requires-Dist: trio==0.22.0
Requires-Dist: trio-websocket==0.10.2
Requires-Dist: tweepy==4.14.0
Requires-Dist: typer==0.7.0
Requires-Dist: typing_extensions==4.5.0
Requires-Dist: typing-inspect==0.8.0
Requires-Dist: uritemplate==4.1.1
Requires-Dist: urllib3==1.26.15
Requires-Dist: urllib3-secure-extra==0.1.0
Requires-Dist: uvicorn==0.23.2
Requires-Dist: vcrpy==4.2.1
Requires-Dist: virtualenv==20.23.0
Requires-Dist: wandb==0.13.2
Requires-Dist: wasabi==1.1.1
Requires-Dist: watchdog==3.0.0
Requires-Dist: wcwidth==0.2.6
Requires-Dist: webdriver-manager==3.8.6
Requires-Dist: websocket-client==1.5.1
Requires-Dist: websockets==11.0.3
Requires-Dist: wheel==0.38.4
Requires-Dist: wrapt==1.15.0
Requires-Dist: wsproto==1.2.0
Requires-Dist: yarl==1.9.2
Requires-Dist: zipp==3.17.0

# AutoAgents: A Framework for Automatic Agent Generation



<p align="center">

<a href=""><img src="docs/resources/logo-autoagents.jpg" alt="autoagents logo: A Framework for Automatic Agent Generation." width="150px"></a>

</p>



<p align="center">

<b>Generate different roles for GPTs to form a collaborative entity for complex tasks.</b>

</p>



<p align="center">

<a href="docs/README_CN.md"><img src="https://img.shields.io/badge/ζ–‡ζ‘£-δΈ­ζ–‡η‰ˆ-blue.svg" alt="CN doc"></a>

<a href="README.md"><img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN doc"></a>

<a href="docs/README_JA.md"><img src="https://img.shields.io/badge/ドキγƒ₯γƒ‘γƒ³γƒˆ-ζ—₯本θͺž-blue.svg" alt="JA doc"></a>

<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>

</p>



AutoAgents is an experimental open-source application for an Automatic Agents Generation Experiment based on LLM. This program, driven by LLM, autonomously generates multi-agents to achieve whatever goal you set.



<p align="center">

    <img src=./docs/resources/framework2.jpg width="800">

</p>



## <a name="updates"/> :boom: Updates

- **2023.09.31**: πŸ“ We're excited to share our paper [AutoAgents: A Framework for Automatic Agent Generation](https://arxiv.org/abs/2309.17288) related to this repository.


<p align="center">


<img width="616" alt="The execution process of AutoAgents." src="docs/resources/process.jpg">


</p> 





- **2023.08.30**: πŸš€ Adding a custom agent collection, AgentBank, allows you to add custom agents. 





## πŸš€ Features


- **Planner**: Determines the expert roles to be added and the specific execution plan according to the problem.


- **Tools**: The set of tools that can be used, currently only compatible with the search tools.


- **Observers**: Responsible for reflecting on whether the planner and the results in the execution process are reasonable, currently including reflection checks on Agents, Plan, and Action.


- **Agents**: Expert role agents generated by the planner, including name, expertise, tools used, and LLM enhancement.


- **Plan**: The execution plan is composed of the generated expert roles, each step of the execution plan has at least one expert role agent.


- **Actions**: The specific actions of the expert roles in the execution plan, such as calling tools or outputting results.





## Demo


Online demo: 


- [Demo / HuggingFace Spaces](https://huggingface.co/spaces/LinkSoul/AutoAgents)





Video demo:


- **Rumor Verification**


<video src='https://github.com/shiyemin/AutoAgents/assets/1501158/41898e0d-4137-450c-ad9b-bfb9b8c1d27b.mp4'></video>


- **Gluttonous Snake**


<video src='https://github.com/shiyemin/AutoAgents/assets/1501158/97e408cb-b70d-4045-82ea-07319c085138.mp4'></video>





## Installation and Usage





### Installation





```bash


git clone https://github.com/LinkSoul-AI/AutoAgents


cd AutoAgents


python setup.py install


```





### Configuration





- Configure your `OPENAI_API_KEY` in any of `config/key.yaml / config/config.yaml / env`


- Priority order: `config/key.yaml > config/config.yaml > env`





```bash


# Copy the configuration file and make the necessary modifications.


cp config/config.yaml config/key.yaml


```





| Variable Name                              | config/key.yaml                           | env                                             |


| ------------------------------------------ | ----------------------------------------- | ----------------------------------------------- |


| OPENAI_API_KEY # Replace with your own key | OPENAI_API_KEY: "sk-..."                  | export OPENAI_API_KEY="sk-..."                  |


| OPENAI_API_BASE # Optional                 | OPENAI_API_BASE: "https://<YOUR_SITE>/v1" | export OPENAI_API_BASE="https://<YOUR_SITE>/v1" |





### Usage


- Commandline mode:


```python


python main.py --mode commandline --llm_api_key YOUR_OPENAI_API_KEY --serpapi_key YOUR_SERPAPI_KEY --idea "Is LK-99 really a room temperature superconducting material?"


```


- Websocket service mode:


```python


python main.py --mode service --host "127.0.0.1" --port 9000


```





### Docker


- Build docker image:


```bash


IMAGE="linksoul.ai/autoagents"


VERSION=1.0





docker build -f docker/Dockerfile -t "${IMAGE}:${VERSION}" .


```


- Start docker container:


```bash


docker run -it --rm -p 7860:7860 "${IMAGE}:${VERSION}"


```


- Open http://127.0.0.1:7860 in the browser.





## Contact Information





If you have any questions or feedback about this project, please feel free to contact us. We highly appreciate your suggestions!





- **Email:** [email protected], [email protected]


- **GitHub Issues:** For more technical inquiries, you can also create a new issue in our [GitHub repository](https://github.com/LinkSoul-AI/AutoAgents/issues).





We will respond to all questions within 2-3 business days.





## License





[MIT license](https://raw.githubusercontent.com/LinkSoul-AI/AutoAgents/main/LICENSE)





## Citation





If you find our work and this repository useful, please consider giving a star :star: and citation :beer::


```bibtex


@article{chen2023auto,


  title={AutoAgents: The Automatic Agents Generation Framework},


  author={Chen, Guangyao and Dong, Siwei and Shu, Yu and Zhang, Ge and Jaward, Sesay and BΓΆrje, Karlsson and Fu, Jie and Shi, Yemin},


  journal={arXiv preprint},


  year={2023}


}


```





## Wechat Group





<img src=".github/QRcode.jpg" alt="Wechat Group" width="200"/>





## Acknowledgements


The [system](https://github.com/LinkSoul-AI/AutoAgents/tree/main/autoagents/system), [action_bank](https://github.com/LinkSoul-AI/AutoAgents/tree/main/autoagents/actions/action_bank) and [role_bank](https://github.com/LinkSoul-AI/AutoAgents/tree/main/autoagents/roles/role_bank) of this code base is built using [MetaGPT](https://github.com/geekan/MetaGPT)





Icons in the framework made by Darius Dan, Freepik, kmg design, Flat Icons, Vectorslab from [FlatIcon](https://www.flaticon.com)