Overview
The Hybrid Hierarchical-Cluster Swarm (HHCS) is an advanced AI orchestration architecture that combines hierarchical decision-making with parallel processing capabilities. HHCS enables complex task solving by dynamically routing tasks to specialized agent swarms based on their expertise and capabilities.Installation
Purpose
HHCS addresses the challenge of efficiently solving diverse and complex tasks by:- Intelligently routing tasks to the most appropriate specialized swarms
- Enabling parallel processing of multifaceted problems
- Maintaining a clear hierarchy for effective decision-making
- Combining outputs from multiple specialized agents for comprehensive solutions
Architecture Diagram
The HHCS architecture follows a hierarchical structure with the router agent at the top level, specialized swarms at the middle level, and individual agents at the bottom level.Attributes
str
default:"Hybrid Hierarchical-Cluster Swarm"
The name of the swarm instance
str
Brief description of the swarm’s functionality
List[Union[SwarmRouter, Callable]]
default:"[]"
List of available swarm routers (or callables) that the HHCS can route tasks to
int
default:"1"
Maximum number of processing loops
HistoryOutputType
default:"list"
Format for output (e.g., “list”, “json”)
str
default:"gpt-5.4"
LLM model used by the router agent for task analysis and routing decisions
Methods
run()
Processes a single task through the swarm system. The router agent analyzes the task and routes it to the most appropriate specialized swarm.task(str): The task to process
output_type (a list by default)
batched_run()
Processes multiple tasks in parallel through the swarm system.tasks(List[str]): List of task strings to process
find_swarm_by_name()
Retrieves a swarm by its name from the available swarms.swarm_name(str): Name of the swarm to find
route_task()
Routes a task to a specific swarm by name.swarm_name(str): Name of the target swarmtask_description(str): The task to route
get_swarms_info() is not a method on HybridHierarchicalClusterSwarm. It is a standalone helper (from swarms.structs.multi_agent_exec import get_swarms_info) that the constructor calls internally to build the router agent’s system prompt from the swarms list.Usage Examples
Full Legal Practice Example
Features
- Router-based task distribution: Central router agent analyzes incoming tasks and directs them to appropriate specialized swarms
- Hybrid architecture: Combines hierarchical control with clustered specialization
- Parallel processing: Multiple swarms can work simultaneously on different aspects of complex tasks
- Flexible swarm types: Supports both sequential and concurrent workflows within swarms
- Comprehensive result aggregation: Collects and combines outputs from all contributing swarms
How It Works
- Task Input: A task is submitted to the HHCS
- Router Analysis: The router agent analyzes the task requirements
- Swarm Selection: The most appropriate specialized swarm is selected based on the task analysis
- Task Routing: The task is routed to the selected swarm for processing
- Parallel Processing: The selected swarm’s agents process the task (sequentially or concurrently depending on swarm type)
- Result Collection: Outputs from all contributing agents are collected into the conversation history
- Final Output: The aggregated results are returned