Magentic-One is now fully integrated into
autogen-agentchat, providing a modular and easy-to-use interface. The original implementation based on autogen-core is deprecated but available here.Overview
Magentic-One uses a multi-agent architecture where a lead Orchestrator agent manages high-level planning, directs other agents, and tracks task progress. The system autonomously adapts to dynamic web and file-system environments to solve complex tasks.Multi-Agent Architecture
Orchestrator coordinates specialized agents for different capabilities
Web & File Tasks
Handles open-ended tasks involving web browsing and file manipulation
Autonomous Adaptation
Dynamically adjusts plans based on task progress and obstacles
Competitive Performance
Achieves strong results on benchmarks like GAIA and HumanEval
Installation
1
Install required packages
2
Install Playwright (for MultimodalWebSurfer)
If you plan to use the web browsing agent:
Quick Start
Get started with Magentic-One in just a few lines of code:Architecture
Magentic-One consists of five specialized agents working together:
Orchestrator
The lead agent responsible for:- Task decomposition and planning
- Directing other agents in executing subtasks
- Tracking overall progress
- Taking corrective actions when needed
- Task Ledger: High-level plan, facts, and educated guesses
- Progress Ledger: Self-reflection on task progress at each step
WebSurfer
An LLM-based agent proficient in commanding a Chromium-based web browser:- Navigation: Visit URLs, perform web searches
- Web Actions: Click elements, type text, fill forms
- Reading: Summarize content, answer questions about pages
FileSurfer
An LLM-based agent for file system operations:- Read local files of most types (via markdown preview)
- List directory contents
- Navigate folder structures
- Extract information from documents
Coder
Specialized through its system prompt for:- Writing code to solve problems
- Analyzing information from other agents
- Creating new artifacts and tools
- Implementing complex algorithms
ComputerTerminal
Provides access to a console shell:- Execute code written by the Coder
- Install programming libraries
- Run system commands
- Interact with the file system
Usage Examples
Basic Usage with MagenticOne Helper
The simplest way to use Magentic-One with all agents:Human-in-the-Loop Mode
Add human oversight for safety-critical tasks:Code Approval Without Full HIL Mode
Approve only code execution while keeping the system autonomous:Using MagenticOneGroupChat
For more control, useMagenticOneGroupChat directly:
Using Individual Magentic-One Agents
Combine specific agents in a custom team:Safety Precautions
1. Use Containers
1. Use Containers
Run all tasks in Docker containers to isolate the agents and prevent direct system attacks.
2. Virtual Environment
2. Virtual Environment
Use a virtual environment to prevent agents from accessing sensitive data or system files.
3. Monitor Logs
3. Monitor Logs
Closely monitor logs during and after execution to detect and mitigate risky behavior.
4. Human Oversight
4. Human Oversight
Run examples with a human in the loop to supervise agents and prevent unintended consequences.
5. Limit Access
5. Limit Access
Restrict agents’ access to the internet and other resources to prevent unauthorized actions.
6. Safeguard Data
6. Safeguard Data
Ensure agents do not have access to sensitive data or resources. Never share sensitive information with the agents.
Be aware that agents may occasionally attempt risky actions, such as:
- Recruiting humans for help
- Accepting cookie agreements without human involvement
- Following instructions from compromised web pages (prompt injection)
Model Recommendations
Magentic-One is model-agnostic and can work with various LLMs:GPT-4o (Recommended)
Default multimodal LLM for all agents. Strong reasoning and vision capabilities.
GPT-4o for Orchestrator
Use a strong reasoning model for the Orchestrator agent.
OpenAI o1-preview
For advanced reasoning in Orchestrator outer loop and Coder agent.
Heterogeneous Models
Mix different models for different agents to balance cost and capabilities.
Azure OpenAI Example
Performance
Magentic-One achieves competitive results on multiple benchmarks:- GAIA: Strong performance on general AI assistant tasks
- HumanEval: Effective code generation capabilities
- AssistantBench: Competitive across diverse assistant scenarios
Orchestrator Workflow
The Orchestrator uses a two-loop architecture:Outer Loop (Task Ledger)
- Create initial plan for the task
- Gather facts and educated guesses
- Update plan if progress stalls
Inner Loop (Progress Ledger)
- Self-reflect on current progress
- Check if task is completed
- Assign subtask to appropriate agent
- Update progress after agent completes subtask
- Repeat until task is complete or replanning is needed
- Dynamically adapt to obstacles
- Recover from failures
- Optimize agent selection based on subtask requirements
API Reference
MagenticOne
ChatCompletionClient
required
The client used for model interactions (e.g., OpenAIChatCompletionClient)
bool
default:"false"
If True, adds UserProxyAgent to enable human-in-the-loop interactions
InputFuncType
default:"None"
Function to use for user input in human-in-the-loop mode
CodeExecutor
default:"None"
Code executor to use. If None, will use Docker if available, otherwise local executor.
ApprovalFuncType
default:"None"
Function to approve code execution before running. If None, code executes without approval.
Resources
Blog Post
Read the official Magentic-One announcement
Technical Report
Full academic paper with detailed methodology
GitHub Repository
View source code and contribute
API Reference
Complete API documentation