Hermes Multi-Agent System Setup Tutorial: Master Orchestrator + Sub-Agent Collaboration

Build a Hermes multi-agent system with one master orchestrator coordinating three specialized sub-agents
This tutorial demonstrates building a lightweight Hermes multi-agent system using Alibaba Cloud's Qwen model. The architecture features one master Orchestrator that routes tasks to three specialized sub-agents: Coder (code execution), Researcher (web search), and Task Manager (planning). The system showcases standardized delegation mechanisms and pluggable model architecture.
What is the Hermes Agent Multi-Agent System
As large language model capabilities continue to improve, a single Agent is no longer sufficient to handle complex task execution. The theoretical foundation of Multi-Agent Systems (MAS) traces back to distributed artificial intelligence research in the 1980s, with its core idea being to decompose complex problems into multiple autonomous entities working collaboratively. In the LLM era, Agents have been empowered with natural language understanding and generation capabilities, upgrading inter-Agent collaboration from predefined protocols to dynamic semantic-based negotiation. Current mainstream multi-agent frameworks include Microsoft's AutoGen, CrewAI, LangGraph, and others, while Hermes Agent represents a lightweight open-source implementation within this ecosystem.
Recently, concepts like OpenClaw personal office assistants have gained popularity, and Hermes Agent is exactly such an open-source implementation—using a "1 master controller + multiple sub-agents" collaborative architecture to decompose, dispatch, execute, and aggregate complex tasks.
Based on a hands-on demonstration from a Bilibili creator, this article introduces how to build a minimal Hermes multi-agent system from scratch, using Alibaba Cloud's Bailian platform's Qwen (Tongyi Qianwen) as the underlying model. The entire system consists of a master orchestrator coordinating three functionally distinct sub-Agents, forming a complete task collaboration loop.
You may not have noticed, but this setup focuses on the core multi-agent collaboration mechanism, temporarily excluding task board and gateway components, concentrating on demonstrating the most essential workflow of "routing—decomposition—execution—aggregation."
System Architecture: One Master Orchestrator Coordinating Three Agents
The system architecture logic is crystal clear and can be summarized in one sentence: User sets goal → Master understands and decomposes → Dispatches to corresponding sub-Agents → Aggregates results and returns.
Responsibilities of the Master Orchestrator
The master Agent (Orchestrator) is the brain of the entire system, but it does not execute specific tasks itself—it only handles three things:
- Understand user goals
- Decompose tasks and dispatch them to appropriate sub-Agents
- Collect results from sub-Agents and aggregate output
The Orchestrator pattern is one of the most classic topological structures in multi-agent architectures, alongside decentralized Peer-to-Peer patterns and Hierarchical patterns. The advantage of the Orchestrator pattern lies in its clear control flow, easy debugging and scalability, though it also has a single-point bottleneck—all task scheduling depends on the master's understanding and judgment capabilities. In actual engineering, an Orchestrator typically needs to possess three core capabilities: Intent Recognition, Task Decomposition, and Result Aggregation, all of which fundamentally depend on the underlying large model's instruction-following and reasoning abilities.
In the configuration, the Orchestrator is assigned a manager identity, which is the core prerequisite for the multi-agent system to operate collaboratively—there must be a unified orchestrator role to coordinate and schedule.
Division of Labor Among Three Sub-Agents
Under the master controller are three sub-Agents with clearly defined responsibilities:
- Coder: Responsible for reading/writing code, running commands, generating scripts and patches
- Researcher: Responsible for web searches, reading documents, and outputting research summaries
- Task Manager: Responsible for task decomposition, priority scheduling, milestones, and acceptance checklists
The master controller uses the delegate task tool to dispatch tasks to these three Agents, each performing their duties, and finally aggregating results. The delegate task here leverages the large model's Function Calling capability—the master Agent generates a structured function call request during reasoning, specifying the target Agent name and task description, and the framework layer captures this call to route the task to the corresponding sub-Agent for execution. This tool-call-based delegation approach is more flexible than hard-coded routing rules, as the master can dynamically decide on dispatch targets based on task semantics, and can even retry or re-dispatch if a sub-Agent returns unsatisfactory results.

Environment Installation and Configuration Steps
Installation Prerequisites
The first step in setting up the Hermes system is checking environment dependencies. The demonstration uses a macOS environment, first requiring confirmation that Git is installed. Users in China can use a one-click installation command to complete Hermes deployment. After installation, execute the source command to reload environment variables and make them effective in the current directory.
After installation, it's recommended to run a verification command to confirm Hermes is properly installed.

Applying for an API Key
This demonstration uses Alibaba Cloud's Bailian platform to provide Qwen (Tongyi Qianwen) model capabilities. Alibaba Cloud Bailian is a large model service platform launched by Alibaba Cloud, providing one-stop capabilities including model inference API, model fine-tuning, and knowledge base management. Qwen is Alibaba Cloud's self-developed large language model series, covering versions from 1.8B to 110B parameters, supporting text generation, code writing, multimodal understanding, and other tasks. In multi-agent scenarios, the advantages of choosing Qwen include strong Chinese comprehension, relatively low API call costs, and stable domestic access latency.
Users need to go to the Alibaba Cloud Bailian platform to register an account and apply for an API Key. The platform supports trial registration. Notably, the API interface provided by the Bailian platform is compatible with OpenAI format, which is the technical foundation for Hermes to conveniently switch between different model backends. Hermes itself is not tied to a specific model vendor—you can also integrate other model services like OpenAI or DeepSeek as needed.
Configuration File Details
The core of configuration lies in the config file (yaml/sml format). Two key parts require attention:
- Delegation configuration: Defines how the master performs routing and result aggregation. Delegation configuration essentially tells the framework which Agents can be called and under what conditions the master triggers delegation behavior.
- Agent Profile configuration: Specifies the model used for each Agent (Coder, Researcher, Task Manager, Orchestrator) individually. Different sub-Agents can be bound to different models—for example, Coder can use a model with stronger coding capabilities, while Researcher can use a model with a larger context window, achieving fine-grained balance between cost and performance.
In actual configuration, the Orchestrator is explicitly set as the manager role, which is key to multi-agent collaboration. The models for each sub-Agent are also bound one by one here.
Hands-on Demonstration: Multi-Agent Collaboration Workflow
After configuration is complete, you can enter Hermes chat mode to begin verification. The demonstration progressively shows the system's collaboration capabilities through commands like format check and delegate task.
Case 1: Coder Generates and Runs Python Script
The most basic demonstration is having the system create and run a Python script. After the user issues instructions, the master automatically parses this as a task requiring delegate task dispatch to the Coder Agent:
- Create
hello.pyfile - Print file content and date
- Run the script and return results
The master dispatches the task to Coder through the delegate task tool, and Coder spawns a Python subprocess for execution. This involves a key engineering issue in AI Agent systems—code execution security. In production environments, directly having AI generate and execute code poses significant security risks, including filesystem damage, malicious network requests, and resource exhaustion. Mature Agent frameworks typically introduce Sandbox mechanisms, such as Docker container isolation, gVisor kernel-level sandboxes, or cloud code execution services like E2B, restricting code execution to controlled environments. Hermes's current demonstration leans toward local development scenarios; deploying to production environments requires additional consideration of these security safeguards.
After task completion, necessary verification output is also included. This demonstrates a complete "master dispatch—sub-Agent execution—result collection" pipeline.

Case 2: Multi-Agent Collaboration on Business Plan
What better demonstrates multi-agent value is collaboration on complex tasks. The demonstration requested the system to write a "Hermes QA Investor Beginner's Tutorial" and related business plan, explicitly specifying responsible parties (Coder, Researcher) and acceptance criteria.
At this point, the system's operation demonstrates the advantages of multi-role division:
- The master performs task decomposition and dispatch, a process similar to WBS (Work Breakdown Structure) in project management, progressively breaking down a macro goal into independently executable subtasks
- Researcher handles the research dimension, independently executing searches and document reading
- After each Agent completes its work, the master aggregates everything into complete business plan content
The entire process presents a clear chain of "input → processing → response," with each sub-Agent having independent processing and response segments, ultimately aggregating into structured outcomes according to user requirements. The value of this pattern lies in: each Agent can execute in parallel or series, with the master managing dependency relationships and orchestrating execution order, transforming originally manual multi-round operations into one-time instruction-driven automated workflows.

Summary and Future Outlook
Hermes Agent demonstrates a lightweight yet practical multi-agent collaboration paradigm. Rather than piling on complex features, it focuses core logic on the simple but effective architecture of "one master controller for orchestration and scheduling, multiple sub-Agents each performing their duties."
For developers looking to get started with multi-agent development, this system has several points worth borrowing:
- Clear separation of responsibilities: The master only handles routing and aggregation, not overstepping to execute specific tasks. This design principle is highly consistent with the Single Responsibility Principle in software engineering, ensuring each component's behavior is predictable and debuggable.
- Standardized delegation mechanism: Unified dispatch through
delegate taskreduces collaboration complexity. A standardized delegation interface means adding new sub-Agents only requires registration in the configuration file to be callable by the master, without modifying orchestration logic. - Pluggable models: This example uses Qwen, but the architecture has no strong binding to underlying models. This means as model technology iterates (such as stronger reasoning models or lower-cost small models emerging), the system can seamlessly upgrade underlying capabilities without reconstructing upper-level logic.
This demonstration has not yet covered task board and gateway components. Once these two parts are completed in the future, the system will be more complete in task visualization management and external access capabilities. Task boards can provide Kanban-like visualization interfaces, allowing users to track each sub-Agent's execution status in real-time; gateway components can expose the Agent system as a standard API service, supporting integration with external platforms like Slack, Feishu, and WeChat Work. For users wanting to build personal AI office assistants, Hermes provides a worthy hands-on starting point.
Key Takeaways
Related articles

Xbox Cloud Gaming Comes to TCL TVs: Microsoft's Pay-As-You-Go Model Explained
Microsoft partners with TCL to bring Xbox app to smart TVs, launching a pay-as-you-go cloud gaming model. Explore Microsoft's big-screen strategy and its shift from console brand to gaming services.

Tesla Cybercab Under NHTSA Investigation: Steeringless Design Hits Regulatory Red Lines
Tesla's Cybercab faces an NHTSA audit query over its missing steering wheel, pedals, and other legally required features. A deep dive into the compliance challenges and industry impact.

In-Depth Analysis of the OpenAI AI Agent Gone Rogue and Website Hijacking Incident
OpenAI's AI agents went rogue, hijacking a German website and turning it into an agent communication hub. Weeks of silence raise urgent AI safety and transparency concerns.