React
AutoGen is a multi-language (Python and .NET) framework for building, orchestrating, and deploying multi-agent AI systems where LLM-powered agents collaborate through messaging, group chat patterns, and tool use. It includes AutoGen Studio, a full-stack web application with a visual team builder and chat playground for designing and testing agent teams without writing code.
Tech Stack
Key Features
- Python Agent Runtime & Messaging
- AgentChat High-Level API
- Multi-Provider LLM Model Clients
- Specialized Browser/File/Video Surfer Agents
- Sandboxed Code Execution
- MCP Tool Integration
- AutoGen Studio Visual Team Builder
- AutoGen Studio Chat Playground
- .NET Agent Framework with Middleware Pipeline
- C# Function Call Source Generator
- Task-Centric Memory with Teachability
- Distributed gRPC Agent Runtime
Coding Conventions
Standards and patterns used in this codebase
Python packages follow a monorepo structure using UV workspaces with separate packages for core, agentchat, extensions, and studio. Each package has its own pyproject.toml and source layout under python/packages/.
python/packages/autogen-core/src/autogen_core, python/packages/autogen-ext/src/autogen_extPython projects use Poe the Poet (poethepoet) as a task runner. Tasks are defined in pyproject.toml and a shared script discovers all workspace projects and runs a specified task across them if it exists.
The run_task_in_pkgs_if_exist.py script iterates UV workspace members and invokes `poe <task>` in each project directory that defines the task.Python code blocks embedded in Markdown documentation are validated using pyright for syntax correctness. A dedicated script extracts code blocks and runs type checking on them.
check_md_code_blocks.py extracts ```python blocks from .md files, writes them to temp files, and runs pyright --level basic on each.Configuration classes in .NET use simple POCO/record-style classes implementing shared interfaces (e.g., ILLMConfig) with properties for API keys, endpoints, and model names. They also provide factory methods to create client instances.
AzureOpenAIConfig stores Endpoint, DeploymentName, and ApiKey, and provides a CreateChatClient() method returning an Azure OpenAI ChatClient.Agent implementations follow the IStreamingAgent interface pattern with GenerateReplyAsync methods that accept IEnumerable<IMessage> and GenerateReplyOptions. Agents support both streaming and non-streaming responses.
GeminiChatAgent implements IStreamingAgent with GenerateStreamingReplyAsync yielding IMessage items and GenerateReplyAsync for single responses.External API clients are abstracted behind interfaces (e.g., IGeminiClient) to allow multiple implementations (REST, Vertex AI) and facilitate testing. Concrete clients handle HTTP communication, serialization, and streaming.
IGeminiClient defines GenerateContentAsync and GenerateContentStreamAsync. GoogleGeminiClient implements it with HttpClient-based REST calls.Streaming API responses use IAsyncEnumerable<T> for yielding incremental results. HTTP streaming reads line-by-line from response streams and deserializes JSON chunks.
AnthropicClient.StreamingChatAsync reads SSE lines from HttpResponseMessage.Content.ReadAsStreamAsync(), parses 'data:' prefixed lines into typed events.Sample applications use top-level statements with a consistent pattern: create a host/app builder, register agents, start the runtime, publish an initial message, and await completion via TaskCompletionSource or similar mechanism.
Program.cs creates agents via AgentsApp.PublishMessageAsync, registers agent types, and uses await app.WaitForShutdownAsync().Python packages use hyphenated names for distribution (autogen-core, autogen-ext) but underscore-based module names for imports (autogen_core, autogen_ext). Extensions are organized by capability type (models, agents, tools, code_executors).
Package autogen-ext installs as autogen_ext with submodules like autogen_ext.models, autogen_ext.agents, autogen_ext.tools.mcp.NET API clients use System.Text.Json for JSON serialization/deserialization with JsonSerializer.Serialize and JsonSerializer.Deserialize<T>, using JsonPropertyName attributes for mapping.
AnthropicClient serializes request bodies with JsonSerializer.Serialize and deserializes streaming chunks with JsonSerializer.Deserialize<ChatCompletionResponse>.AutoGen Studio frontend uses React with Gatsby as the framework, organized into view-based components (teambuilder, playground, gallery) with visual team building via drag-and-drop node editors.
Components are organized under frontend/src/components/views/ with separate directories for teambuilder, playground, and gallery.