6e8331b754
* white spaces * add llamaindex agent wrapper for autogen * formatting * formatting fixes * add support for llamaindex agents * fix style * fix style * delete file * re-add file * fixes pre-commit errors * feat: Add agentchat_group_chat_with_llamaindex_agents notebook This commit adds the notebook "agentchat_group_chat_with_llamaindex_agents.ipynb" which demonstrates how to integrate Llamaindex agents into Autogen. The notebook includes code for setting up the API endpoint, creating Llamaindex agents, and setting up a group chat. * Refactor code * feat: Add test for LLamaIndexConversableAgent This commit adds a new test file `test_llamaindex_conversable_agent.py` that contains a test case for the `LLamaIndexConversableAgent` class. The test verifies the functionality of group chat with two MultimodalConversable Agents, limiting the chat by the `max_round` parameter. It also checks if the number of rounds does not exceed the maximum specified rounds. The purpose of this change is to ensure that the `LLamaIndexConversableAgent` behaves as expected and correctly handles group chats with limited rounds. Note: This commit includes import statements and setup code necessary for running the test case. * fix formatting * feat: Add LlamaIndexAgent job to GitHub Actions workflow This commit adds a new job called "LlamaIndexAgent" to the GitHub Actions workflow. The job runs on multiple operating systems (ubuntu-latest, macos-latest, windows-2019) and uses Python version 3.11. It sets up the Python environment, installs necessary packages and dependencies for LMM, performs coverage testing using pytest, and uploads the coverage report to Codecov. The commit also includes changes to the test_llamaindex_conversable_agent.py file. It imports os and sys modules, appends a path to sys.path, and adds skip conditions for tests based on certain conditions. These changes improve the CI/CD pipeline by adding a new job for LlamaIndexAgent and enhancing test conditions in test_llamaindex_conversable_agent.py. * fix test yaml * cleanup tests * fix test run * formatting * add test * fix yaml * pr feedback * add documentation to website * fixed style * edit to document page * newline * make skip reason easier to see * compose skip reasons * fix env variable name * refactor: Update package installation in contrib workflows - Replaced specific package installations with more general ones - Updated the installation of llama-index packages and dependencies - Added new packages for llama-index and Wikipedia tools * Update dependencies and add new agents for group chat - Update dependencies to specific versions - Add new agent `entertainent_specialist` for discovering entertainment opportunities in a location - Modify the `test_group_chat_with_llama_index_conversable_agent` function to include the new agent in the group chat * Update pydantic version requirement in setup.py - Update pydantic version requirement from "pydantic>=1.10,<3,!=2.6.0" to "pydantic>=1.10,<3" - Remove comment about issue with pydantic 2.6.0 * Refactor ChatMessage instantiation in _extract_message_and_history() - Refactored the instantiation of ChatMessage in the _extract_message_and_history() function. - Added an empty dictionary as additional_kwargs to the ChatMessage constructor. * Refactor test_llamaindex_conversable_agent.py - Removed unused import and variable - Updated OpenAI model to gpt-4 - Reduced max_iterations for location_specialist and entertainment_specialist from 30 to 5 - Changed human_input_mode for user_proxy to "NEVER" - Added assertion for max_rounds in entertainent_assistant These changes improve code efficiency and ensure proper functionality. * Remove entertainment_specialist agent and update user_proxy settings in test_llamaindex_conversable_agent.py - Remove the creation of entertainent_specialist agent - Update the max_consecutive_auto_reply setting for user_proxy to 10 - Update the default_auto_reply setting for user_proxy to "Thank you. TERMINATE" * Refactor installation of LlamaIndex packages and dependencies - Simplify installation commands for LlamaIndex packages - Remove specific version numbers from pip install commands * Update test_llamaindex_conversable_agent.py to include verbose output during pytest. - Add the -v flag to the pytest command in contrib-openai.yml. - Print a message when skipping the test due to missing dependencies or key. * Refactor OpenAI workflow, remove LlamaIndexAgent This commit removes the LlamaIndexAgent from the OpenAI workflow in order to streamline and simplify the code. The LlamaIndexAgent was no longer necessary and its removal improves overall code organization and maintainability. * feat: Add test for group chat functionality with LLamaIndexConversableAgent use mock reactagent in test * Update Dockerfile for devcontainer - Updated the Dockerfile for the devcontainer environment. - Added installation of build-essential, npm, git-lfs, and other packages. - Upgraded pip and installed pydoc-markdown, pyyaml, and colored libraries. * Update devcontainer.json with new VS Code extensions and terminal settings - Updated the list of VS Code extensions in devcontainer.json to include "GitHub.copilot" - Added a new terminal profile for Linux with the path set to "/bin/bash" - Set the default Linux terminal profile to "bash" * removeall * feat: Add Dockerfiles and devcontainer configurations This commit adds Dockerfiles and devcontainer configurations for different use cases in the `.devcontainer` directory. The following changes were made: - Added `Dockerfile` for basic setups (`base`) - Added `Dockerfile` for advanced features (`full`) - Added `Dockerfile` for AutoGen project developers (`dev`) - Added `Dockerfile` for AutoGen project developers using Studio (`studio`) - Updated existing files with necessary dependencies and configurations - Modified README.md to provide instructions on customizing Dockerfiles and managing the Docker environment These changes allow users to easily set up their AutoGen development environment using Docker containers. * delete * Add authors.yml file with author information This commit adds the authors.yml file, which contains information about various authors contributing to the project. Each author entry includes their name, title, URL, and image URL. This file will be used to display author information on the website. * delete * Add test cases for agent chat functionality This commit adds new test cases for the agent chat functionality. The test cases include scenarios such as auto feedback from code execution, function calls, currency calculator, async function calls, group chat finite state machine, cost token tracking, and group chat state flow. These test cases cover different versions of Python (3.10, 3.11, and 3.12) and are skipped if OpenAI is not installed or the Python version does not match. * delete * feat: Add LLM configuration documentation This commit adds documentation for configuring an agent's access to LLMs. It includes information on the `llm_config` argument, `config_list`, and other configuration parameters. The commit also provides examples of filtering the `config_list` based on model names and tags. Additionally, it demonstrates how to add an HTTP client in `llm_config` for proxy usage. Finally, it mentions helper functions for loading a config list from API keys, environment variables, files, or `.env` files. Closes #1234 * delete * feat: Add LLM configuration documentation This commit adds documentation for configuring an agent's access to LLMs. It includes information on the `llm_config` argument, `config_list`, and other configuration parameters. The commit also provides examples of filtering the `config_list` based on model names and tags. Additionally, it demonstrates how to add an HTTP client in `llm_config` for proxy usage. Finally, it mentions helper functions for loading a config list from various sources. Closes #1234 * delete * adding back notebooks * reset * feat: Add setup.py for package installation This commit adds a new file, `setup.py`, which is used for installing the package. The `setup.py` file includes information such as the author, description, and dependencies of the package. This allows users to easily install and use the package in their projects. The `setup.py` file also includes different extra requirements for specific functionalities, such as retrieving chat data or running Jupyter notebooks. These extra requirements are installed when specified during installation. Overall, this addition improves the usability and installation process of the package. |
||
---|---|---|
.devcontainer | ||
.github | ||
autogen | ||
dotnet | ||
notebook | ||
samples | ||
scripts | ||
test | ||
website | ||
.coveragerc | ||
.gitattributes | ||
.gitignore | ||
.pre-commit-config.yaml | ||
CITATION.cff | ||
CODE_OF_CONDUCT.md | ||
LICENSE | ||
LICENSE-CODE | ||
OAI_CONFIG_LIST_sample | ||
README.md | ||
SECURITY.md | ||
TRANSPARENCY_FAQS.md | ||
azure-pipelines.yml | ||
pyproject.toml | ||
setup.py |
README.md
AutoGen
🔥 May 29, 2024: DeepLearning.ai launched a new short course AI Agentic Design Patterns with AutoGen, made in collaboration with Microsoft and Penn State University, and taught by AutoGen creators Chi Wang and Qingyun Wu.
🔥 May 24, 2024: Foundation Capital published an article on Forbes: The Promise of Multi-Agent AI and a video AI in the Real World Episode 2: Exploring Multi-Agent AI and AutoGen with Chi Wang.
🔥 May 13, 2024: The Economist published an article about multi-agent systems (MAS) following a January 2024 interview with Chi Wang.
🔥 May 11, 2024: AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation received the best paper award at the ICLR 2024 LLM Agents Workshop.
🔥 Apr 26, 2024: AutoGen.NET is available for .NET developers!
🔥 Apr 17, 2024: Andrew Ng cited AutoGen in The Batch newsletter and What's next for AI agentic workflows at Sequoia Capital's AI Ascent (Mar 26).
🔥 Mar 3, 2024: What's new in AutoGen? 📰Blog; 📺Youtube.
🔥 Mar 1, 2024: the first AutoGen multi-agent experiment on the challenging GAIA benchmark achieved the No. 1 accuracy in all the three levels.
🎉 Dec 31, 2023: AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework is selected by TheSequence: My Five Favorite AI Papers of 2023.
🎉 Nov 8, 2023: AutoGen is selected into Open100: Top 100 Open Source achievements 35 days after spinoff from FLAML.
🎉 Mar 29, 2023: AutoGen is first created in FLAML.
What is AutoGen
AutoGen is a framework that enables the development of LLM applications using multiple agents that can converse with each other to solve tasks. AutoGen agents are customizable, conversable, and seamlessly allow human participation. They can operate in various modes that employ combinations of LLMs, human inputs, and tools.
- AutoGen enables building next-gen LLM applications based on multi-agent conversations with minimal effort. It simplifies the orchestration, automation, and optimization of a complex LLM workflow. It maximizes the performance of LLM models and overcomes their weaknesses.
- It supports diverse conversation patterns for complex workflows. With customizable and conversable agents, developers can use AutoGen to build a wide range of conversation patterns concerning conversation autonomy, the number of agents, and agent conversation topology.
- It provides a collection of working systems with different complexities. These systems span a wide range of applications from various domains and complexities. This demonstrates how AutoGen can easily support diverse conversation patterns.
- AutoGen provides enhanced LLM inference. It offers utilities like API unification and caching, and advanced usage patterns, such as error handling, multi-config inference, context programming, etc.
AutoGen is created out of collaborative research from Microsoft, Penn State University, and the University of Washington.
Roadmaps
To see what we are working on and what we plan to work on, please check our Roadmap Issues.
Quickstart
The easiest way to start playing is
-
Click below to use the GitHub Codespace
-
Copy OAI_CONFIG_LIST_sample to ./notebook folder, name to OAI_CONFIG_LIST, and set the correct configuration.
-
Start playing with the notebooks!
NOTE: OAI_CONFIG_LIST_sample lists GPT-4 as the default model, as this represents our current recommendation, and is known to work well with AutoGen. If you use a model other than GPT-4, you may need to revise various system prompts (especially if using weaker models like GPT-3.5-turbo). Moreover, if you use models other than those hosted by OpenAI or Azure, you may incur additional risks related to alignment and safety. Proceed with caution if updating this default.
Installation
Option 1. Install and Run AutoGen in Docker
Find detailed instructions for users here, and for developers here.
Option 2. Install AutoGen Locally
AutoGen requires Python version >= 3.8, < 3.13. It can be installed from pip:
pip install pyautogen
Minimal dependencies are installed without extra options. You can install extra options based on the feature you need.
Find more options in Installation.
Even if you are installing and running AutoGen locally outside of docker, the recommendation and default behavior of agents is to perform code execution in docker. Find more instructions and how to change the default behaviour here.
For LLM inference configurations, check the FAQs.
Multi-Agent Conversation Framework
Autogen enables the next-gen LLM applications with a generic multi-agent conversation framework. It offers customizable and conversable agents that integrate LLMs, tools, and humans. By automating chat among multiple capable agents, one can easily make them collectively perform tasks autonomously or with human feedback, including tasks that require using tools via code.
Features of this use case include:
- Multi-agent conversations: AutoGen agents can communicate with each other to solve tasks. This allows for more complex and sophisticated applications than would be possible with a single LLM.
- Customization: AutoGen agents can be customized to meet the specific needs of an application. This includes the ability to choose the LLMs to use, the types of human input to allow, and the tools to employ.
- Human participation: AutoGen seamlessly allows human participation. This means that humans can provide input and feedback to the agents as needed.
For example,
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json
# Load LLM inference endpoints from an env variable or a file
# See https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints
# and OAI_CONFIG_LIST_sample
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
# You can also set config_list directly as a list, for example, config_list = [{'model': 'gpt-4', 'api_key': '<your OpenAI API key here>'},]
assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False}) # IMPORTANT: set to True to run code in docker, recommended
user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")
# This initiates an automated chat between the two agents to solve the task
This example can be run with
python test/twoagent.py
After the repo is cloned. The figure below shows an example conversation flow with AutoGen.
Alternatively, the sample code here allows a user to chat with an AutoGen agent in ChatGPT style. Please find more code examples for this feature.
Enhanced LLM Inferences
Autogen also helps maximize the utility out of the expensive LLMs such as ChatGPT and GPT-4. It offers enhanced LLM inference with powerful functionalities like caching, error handling, multi-config inference and templating.
Documentation
You can find detailed documentation about AutoGen here.
In addition, you can find:
-
Research, blogposts around AutoGen, and Transparency FAQs
Related Papers
@inproceedings{wu2023autogen,
title={AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework},
author={Qingyun Wu and Gagan Bansal and Jieyu Zhang and Yiran Wu and Beibin Li and Erkang Zhu and Li Jiang and Xiaoyun Zhang and Shaokun Zhang and Jiale Liu and Ahmed Hassan Awadallah and Ryen W White and Doug Burger and Chi Wang},
year={2023},
eprint={2308.08155},
archivePrefix={arXiv},
primaryClass={cs.AI}
}
@inproceedings{wang2023EcoOptiGen,
title={Cost-Effective Hyperparameter Optimization for Large Language Model Generation Inference},
author={Chi Wang and Susan Xueqing Liu and Ahmed H. Awadallah},
year={2023},
booktitle={AutoML'23},
}
@inproceedings{wu2023empirical,
title={An Empirical Study on Challenging Math Problem Solving with GPT-4},
author={Yiran Wu and Feiran Jia and Shaokun Zhang and Hangyu Li and Erkang Zhu and Yue Wang and Yin Tat Lee and Richard Peng and Qingyun Wu and Chi Wang},
year={2023},
booktitle={ArXiv preprint arXiv:2306.01337},
}
@article{zhang2024training,
title={Training Language Model Agents without Modifying Language Models},
author={Zhang, Shaokun and Zhang, Jieyu and Liu, Jiale and Song, Linxin and Wang, Chi and Krishna, Ranjay and Wu, Qingyun},
journal={ICML'24},
year={2024}
}
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
If you are new to GitHub, here is a detailed help source on getting involved with development on GitHub.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Contributors Wall
Legal Notices
Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.
Microsoft, Windows, Microsoft Azure, and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.
Privacy information can be found at https://privacy.microsoft.com/en-us/
Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel, or otherwise.