A programming framework for agentic AI
Update README to be ready for merging (#666)
Eric Zhu601913148018
diff --git a/README.md b/README.mdindex 0e70fa99d..67e1e301f 100644--- a/README.md+++ b/README.md@@ -3,84 +3,88 @@<div align="center"><img src="https://microsoft.github.io/autogen/img/ag.svg" alt="AutoGen Logo" width="100">-[](https://badge.fury.io/py/autogen-agentchat)-[](https://badge.fury.io/nu/AutoGen.Core)[](https://twitter.com/pyautogen)</div># AutoGen+> [!IMPORTANT]+> AutoGen 0.4 is a from-the-ground-up rewrite of AutoGen. Learn more about the history, goals and future at [this blog post](https://microsoft.github.io/autogen/blog). Weβre excited to work with the community to gather feedback, refine, and improve the project before we officially release 0.4. This is a big change, so AutoGen 0.2 is still available, maintained, and developed in the [0.2 branch](https://github.com/microsoft/autogen/tree/0.2).+AutoGen is an open-source framework for building AI agent systems.-It simplifies the creation of event-driven, distributed, scalable, and resilient AI applications.-Using AutoGen, you can quickly build systems where AI agents collaborate-and perform tasks autonomously or with human oversight.+It simplifies the creation of event-driven, distributed, scalable, and resilient agentic applications.+It allows you to quickly build systems where AI agents collaborate and perform tasks autonomously+or with human oversight.-* [Installation](#install)+* [Key Features](#key-features)+* [API Layering](#api-layering)* [Quickstart](#quickstart)-* [Using AutoGen](#using-autogen)* [Roadmap](#roadmap)* [FAQs](#faqs)-AutoGen streamlines AI development and research, enabling the use of multiple large language models (LLMs), integrated tools, and advanced multi-agent design patterns.-You can develop and test your agent systems locally, then seamlessly deploy to a distributed cloud environment as your needs grow.+AutoGen streamlines AI development and research, enabling the use of multiple large language models (LLMs), integrated tools, and advanced multi-agent design patterns. You can develop and test your agent systems locally, then deploy to a distributed cloud environment as your needs grow.-:fire: **September 18, 2024**: AutoGen 0.5 is a new architecture for AutoGen! This new version is in preview release and being developed in the open over the next several weeks as we refine the documentation, samples, and work with our users on evolving this new version. π+## Key Features-- AutoGen 0.5 represents a rearchitecutre of the system to make it more scalable, resilient, and interoperable across multiple programming languages.-- It is designed to be more modular and extensible, with a focus on enabling a wide range of applications and use cases.-- This redesign features full .NET and Python libraries, with more languages to come. Agents may be written in different languages and interoperate with one another over a common messaging protocol using the CloudEvents standard.+AutoGen offers the following key features:-## Install+- **Asynchronous Messaging**: Agents communicate via asynchronous messages, supporting both event-driven and request/response interaction patterns.+- **Full type support**: use types in all interfaces and enforced type check on build, with a focus on quality and cohesiveness+- **Scalable & Distributed**: Design complex, distributed agent networks that can operate across organizational boundaries.+- **Modular & Extensible**: Customize your system with pluggable components: custom agents, tools, memory, and models.+- **Cross-Language Support**: Interoperate agents across different programming languages. Currently supports Python and .NET, with more languages coming soon.+- **Observability & Debugging**: Built-in features and tools for tracking, tracing, and debugging agent interactions and workflows, including support for industry standard observability with OpenTelemetry-### Python+<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">+ <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">+ β Back to Top β+ </a>+</p>-AutoGen requires Python 3.10+. It has multiple packages.+# API Layering-```bash-pip install autogen-agentchat autogen-core autogen-ext-```+AutoGen has several packages and is built upon a layered architecture.+Currently, there are three main APIs your application can target:-See [packages](https://microsoft.github.io/agnext/packages) for more information about available packages.+- [Core](https://microsoft.github.io/autogen/dev/core-user-guide/index.html)+- [AgentChat](https://microsoft.github.io/autogen/dev/agentchat-user-guide/index.html)+- [Extensions](https://microsoft.github.io/autogen/dev/reference/python/autogen_ext/autogen_ext.html)-### .NET+## Core-(Add .NET installation instruction here)+- [Installation](https://microsoft.github.io/autogen/dev/packages/index.html#pkg-info-autogen-core)+- [Quickstart](https://microsoft.github.io/autogen/dev/core-user-guide/guides/quickstart.html)-<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">- <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">- β Back to Top β- </a>-</p>+The core API of AutoGen, `autogen-core`, is built following the+[actor model](https://en.wikipedia.org/wiki/Actor_model).+It supports asynchronous message passing between agents and event-based workflows.+Agents in the core layer handle and produce typed messages, using either direct messaging,+which functions like RPC, or via broadcasting to topics, which is pub-sub.+Agents can be distributed and implemented in different programming languages,+while still communicating with one another.+**Start here if you are building scalable, event-driven agentic systems.**-## Quickstart+## AgentChat-### Python+- [Installation](https://microsoft.github.io/autogen/dev/packages/index.html#pkg-info-autogen-agentchat)+- [Quickstart](https://microsoft.github.io/autogen/dev/agentchat-user-guide/guides/quickstart.html)-```python-import asyncio-import os-from autogen_core.components.models import chat_completion_client_from_json as client_from_json-from autogen_agentchat import CodingAssistant, CodeExecutorAgent, RoundRobinTeam, console_output-from autogen_ext.code_executors import DockerCommandLineCodeExecutor--async def main():- chat_completion_client = client_from_json(os.environ["MODEL_CLIENT_JSON"])- async with DockerCommandLineCodeExecutor(work_dir="coding") as executor:- assistant = CodingAssistant("assistant", chat_completion_client=chat_completion_client)- executor_agent = CodeExecutorAgent(- "code_executor", executor=executor,- )- team = RoundRobinTeam(agents=[assistant, executor_agent])- result = await team.run("Plot a chart of NVDA and TESLA stock price change YTD. Save the plot to a file called plot.png", output=console_output)--if __name__ == "__main__":- asyncio.run(main())-```+The AgentChat API, `autogen-agentchat`, is task driven and at a high level like AutoGen 0.2.+It allows you to define conversational agents, compose them into teams and then+use them to solve tasks.+AgentChat itself is built on the core layer, but it abstracts away much of its+low-level system concepts.+If your workflows don't fit into the AgentChat API, target core instead.+**Start here if you just want to focus on quickly getting started with multi-agents workflows.**-### C#+## Extensions-(Add .NET quickstart here)+The extension package `autogen-ext` contains implementations of the core interfaces using 3rd party systems,+such as OpenAI model client and Azure code executors.+Besides the built-in extensions, the package accommodates community-contributed+extensions through namespace sub-packages.+We look forward to your contributions!<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;"><a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">@@ -88,24 +92,107 @@ if __name__ == "__main__":</a></p>-## Using AutoGen+## Quickstart-The version you are looking at is AutoGen 0.5, which introduces a new architecture.-The best place to start is the [documentation](https://microsoft.github.io/agnext).+### Python (AgentChat)-The new architecture provides the following features:+First install the packages:-- **Asynchronous Messaging**: Agents communicate via asynchronous messages, supporting both event-driven and request/response interaction patterns.-- **Scalable & Distributed**: Design complex, distributed agent networks that can operate across organizational boundaries.-- **Modular & Extensible**: Customize your system with pluggable components, including custom agents, memory services, tool registries, and model libraries.-- **Cross-Language Support**: Interoperate agents across different programming languages. Currently supports Python and .NET, with more languages coming soon.-- **Observability & Debugging**: Built-in tools for tracking, tracing, and debugging agent interactions and workflows.+```bash+pip install autogen-agentchat==0.4.0dev0 autogen-ext==0.4.0dev0+```-We are actively developing this new architecture, but we are excited to share our progress with you.-We are looking for your feedbacks and contributions to help shape the future of AutoGen.+The following code uses code execution, you need to have [Docker installed](https://docs.docker.com/engine/install/)+and running on your machine.-The current stable release is AutoGen 0.2.-You can find the documentation [here](https://microsoft.github.io/autogen).+```python+from autogen_agentchat.agents import CodeExecutorAgent, CodingAssistantAgent+from autogen_agentchat.teams.group_chat import RoundRobinGroupChat+from autogen_core.components.code_executor import DockerCommandLineCodeExecutor+from autogen_core.components.models import OpenAIChatCompletionClient++async with DockerCommandLineCodeExecutor(work_dir="coding") as code_executor:+ code_executor_agent = CodeExecutorAgent("code_executor", code_executor=code_executor)+ coding_assistant_agent = CodingAssistantAgent(+ "coding_assistant", model_client=OpenAIChatCompletionClient(model="gpt-4o")+ )+ group_chat = RoundRobinGroupChat([coding_assistant_agent, code_executor_agent])+ result = await group_chat.run(+ task="Create a plot of NVDIA and TSLA stock returns YTD from 2024-01-01 and save it to 'nvidia_tesla_2024_ytd.png'."+ )+ print(result)+```++### C#+The .NET SDK does not yet support all of the interfaces that the python SDK offers but we are working on bringing them to parity.+To use the .NET SDK, you need to add a package reference to the src in your project.+We will release nuget packages soon and will update these instructions when that happens.++```+git clone https://github.com/microsoft/autogen.git+cd autogen+# Switch to the branch that has this code+git switch staging-dev+# Build the project+cd dotnet && dotnet build AutoGen.sln+# In your source code, add AutoGen to your project+dotnet add <your.csproj> reference <path to your checkout of autogen>/dotnet/src/Microsoft.AutoGen.Agents.Client/Microsoft.AutoGen.Agents.Client.csproj+```++Then, define your first agent:++```csharp+using Microsoft.AutoGen.Agents.Abstractions;+using Microsoft.AutoGen.Agents.Client;++namespace HelloAgents.Agents;++[TopicSubscription("HelloAgents")]+public class HelloAgent(+ IAgentContext context,+ Kernel kernel,+ ISemanticTextMemory memory,+ [FromKeyedServices("EventTypes")] EventTypes typeRegistry,+ ILogger<HelloAgent> logger) : AiAgent<HelloAgentState>(+ context,+ memory,+ kernel,+ typeRegistry),+ ISayHello,+ IHandle<NewMessageReceived>,+ IHandle<ConversationClosed>+{+ public async Task Handle(NewMessageReceived item)+ {+ var response = await SayHello(item.Message);+ var evt = new ResponseGenerated+ {+ Response = response+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(evt);+ }++ public async Task Handle(ConversationClosed item)+ {+ var goodbye = "";+ var evt = new GoodBye+ {+ Message = goodbye+ }.ToCloudEvent(this.AgentId.Key);+ await PublishEvent(evt);+ }++ public async Task<string> SayHello(string ask)+ {+ var response = $"Hello {ask}";+ return response;+ }+}+public interface ISayHello+{+ public Task<string> SayHello(string ask);+}+```<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;"><a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">@@ -115,12 +202,14 @@ You can find the documentation [here](https://microsoft.github.io/autogen).## Roadmap-- [AutoGen 0.2] - This is the current stable release of AutoGen. We will continue to accept bug fixes and minor enhancements to this version.-- [AutoGen 0.5] - This is the first release of the new event-driven architecture. This release is still in preview. We will be focusing on stability of the interfaces, documentation, tutorials, samples, and a collection of base agents from which you can inherit. We are also working on compatibility interfaces for those familiar with prior versions of AutoGen.-- [future] - We are excited to work with our community to define the future of AutoGen. We are looking for feedback and contributions to help shape the future of this project.Here are some major planned items:- - [ ] Add support for more languages- - [ ] Add support for more base agents and patterns- - [ ] Add compatibility with Bot Framework Activity Protocol+- AutoGen 0.2 - This is the current stable release of AutoGen. We will continue to accept bug fixes and minor enhancements to this version.+- AutoGen 0.4 - This is the first release of the new architecture. This release is still in _preview_. We will be focusing on the stability of the interfaces, documentation, tutorials, samples, and a collection of built-in agents which you can use. We are excited to work with our community to define the future of AutoGen. We are looking for feedback and contributions to help shape the future of this project. Here are some major planned items:+ - More programming languages (e.g., TypeScript)+ - More built-in agents and multi-agent workflows+ - Deployment of distributed agents+ - Re-implementation/migration of AutoGen Studio+ - Integration with other agent frameworks and data sources+ - Advanced RAG techniques and memory services<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;"><a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">@@ -130,44 +219,64 @@ You can find the documentation [here](https://microsoft.github.io/autogen).## FAQs-Q: What is AutoGen 0.5?+### What is AutoGen 0.4?-AutoGen 0.5 is a rewrite of AutoGen from the ground up to create a more robust, scalable, easier to use, cross-language library for building AI Agents.+AutoGen v0.4 is a rewrite of AutoGen from the ground up to create a more robust,+scalable, easier to use, cross-language library for building AI Agents.+Some key features include asynchronous messaging, support for scalable distributed agents,+modular extensible design (bring your own agents, implement behaviors however you like),+cross-language support, improved observability, and full typing integration.+It is a breaking change.-Q: Why these changes?+### Why these changes?-We listened to our AutoGen users, learned from what was working, and adapted to fix what wasn't. We brought together wide ranging teams working on many different types of AI Agents and collaborated to design an improved framework with a more flexible programming model and better scalability.+We listened to our AutoGen users, learned from what was working,+and adapted to fix what wasn't.+We brought together wide-ranging teams working on many different types of AI Agents+and collaborated to design an improved framework with a more flexible+programming model and better scalability.-Q: Who should use it?+### Who should use it 0.4?-This code is still experimental. We encourage adventurous early adopters to please try it out, give us feedback, and contribute.+This code is still experimental. We encourage adventurous early adopters to+please try it out, give us feedback, and contribute.-Q: I'm using AutoGen 0.2, should I upgrade?+### I'm using AutoGen 0.2, should I upgrade?-If you consider yourself an early adopter, you are comfortable making some changes to your code, and are willing to try it out, then yes.+If you consider yourself an early adopter, you are comfortable making some+changes to your code, and are willing to try it out, then yes.-Q: How do I still use AutoGen 0.2?+### How do I still use AutoGen 0.2?Just keep doing what you were doing before.-Q: How do I migrate?+### Will AutoGen Studio be supported in 0.4?++Yes, this is on the roadmap.+Our current plan is to enable an implementation of AutoGen Studio+on the AgentChat high level API which implements a set of agent functionalities+(agents, teams, etc).-We are working on a migration guide. Until then, see the [documentation](http://microsoft.github.io/agnext).+### How do I migrate?-Q: What is happening next? When will this release be ready?+For users familiar with AutoGen, the AgentChat library in 0.4 provides similar concepts.+We are working on a migration guide.-We are still working on improving the documentation, samples, and enhancing the code. We will prepare a release announcement when these things are completed in the next few weeks.+### What is happening next? When will this release be ready?-Q: What is the history of this project?+We are still working on improving the documentation, samples, and enhancing the code.+We will prepare a release announcement when these things are completed in the next few weeks.-The rearchitecture of AutoGen came from multiple Microsoft teams coming together to build the next generation of AI agent framework - merging ideas from several predecessor projects.+### What is the history of this project?++The rearchitecture of AutoGen started with multiple Microsoft teams coming together+to build the next generation of AI agent framework - merging ideas from several predecessor projects.The team decided to bring this work to OSS as an evolution of AutoGen in September 2024.-Prior to that, AutoGen has been developed and maintained by [a community of contributors](CONTRIBUTORS.md).-Q: What is the official channel for support?+### What is the official channel for support?-Use GitHub [Issues](https://github.com/microsoft/agnext/issues) for bug reports and feature requests.-Use GitHub [Discussions](https://github.com/microsoft/agnext/discussions) for general questions and discussions.+Use GitHub [Issues](https://github.com/microsoft/autogen/issues) for bug reports and feature requests.+Use GitHub [Discussions](https://github.com/microsoft/autogen/discussions) for general questions and discussions.<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;"><a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">@@ -196,4 +305,4 @@ or trademarks, whether by implication, estoppel, or otherwise.<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">β Back to Top β</a>-</p>\ No newline at end of file+</p>