Skip to main content

Overview

SkillOrchestra is a skill-aware agent orchestration system based on the paper “SkillOrchestra: Learning to Route Agents via Skill Transfer”. Instead of end-to-end RL routing, it maintains a Skill Handbook that profiles each agent on fine-grained skills, infers which skills a task requires via LLM, and matches agents to tasks via explicit competence-cost scoring.

Installation

How It Works

SkillOrchestra routes tasks through a 5-step pipeline:
  1. Skill Inference — An LLM analyzes the incoming task and identifies which fine-grained skills are required (e.g., python_coding, data_analysis, technical_writing), each with an importance weight.
  2. Agent Scoring — Each agent is scored using a weighted competence-cost formula against the required skills. This step is pure math — no LLM calls.
  3. Agent Selection — The top-k agents with the highest scores are selected.
  4. Execution — Selected agents execute the task. Multiple agents run concurrently via ThreadPoolExecutor.
  5. Learning (optional) — An LLM evaluates the output quality, and agent skill profiles are updated via exponential moving average (EMA).

Scoring Formula

For each agent, the score is computed as:
Where:
  • competence_i is the agent’s estimated probability of success on skill i
  • normalized_cost_i is 1 - (cost - min_cost) / (max_cost - min_cost) (lower cost = higher score)
  • importance_i is how important the skill is for the task

Key Components

Data Models

Attributes

str
default:"SkillOrchestra"
Name identifier for the orchestrator.
str
default:"Skill-aware agent orchestration..."
Description of the orchestrator’s purpose.
List[Union[Agent, Callable]]
required
List of agents to orchestrate (at least 1 required).
int
default:"1"
Maximum execution-feedback loops per task.
OutputType
default:"dict"
Output format: "dict", "str", "json", "final", etc.
str
default:"gpt-5.4"
LLM model for skill inference and evaluation.
float
default:"0.1"
LLM temperature for inference calls.
Optional[SkillHandbook]
default:"None"
Pre-built skill handbook. If None, auto-generated from agent descriptions.
bool
default:"True"
Whether to auto-generate handbook when none is provided.
float
default:"0.3"
Weight for cost component in scoring (0-1).
float
default:"0.7"
Weight for competence component in scoring (0-1).
int
default:"1"
Number of agents to select per task.
bool
default:"True"
Whether to update skill profiles after execution via EMA.
float
default:"0.1"
EMA learning rate for profile updates.
bool
default:"True"
Whether to save conversation history and handbook to disk.
bool
default:"False"
Whether to log detailed information.
bool
default:"True"
Whether to print panels to console.

Methods

run()

Run the full pipeline on a single task.
Parameters:
  • task (str): The task to execute
  • img (Optional[str]): Optional image input
  • imgs (Optional[List[str]]): Optional list of image inputs
Returns: Result in the specified output_type format

__call__()

Callable interface that delegates to run().
Parameters:
  • task (str): The task to execute
Returns: Result from run()

batch_run()

Run multiple tasks sequentially.
Parameters:
  • tasks (List[str]): List of tasks to execute
Returns: List[Any] - List of results, one per task

concurrent_batch_run()

Run multiple tasks concurrently.
Parameters:
  • tasks (List[str]): List of tasks to execute
Returns: List[Any] - List of results from concurrent execution

get_handbook()

Return the current skill handbook as a dictionary.
Returns: dict - The skill handbook data

update_handbook()

Replace the skill handbook.
Parameters:
  • handbook (SkillHandbook): The new skill handbook

Architecture

Pipeline Flow

Scoring and Selection

Execution Modes

Best Practices

Agent Design

  • Write descriptive agent descriptions — The auto-generated skill handbook is only as good as your agent descriptions. Be specific about what each agent can do.
  • Use distinct specializations — Agents with overlapping skills reduce the effectiveness of skill-based routing. Make each agent clearly specialized.
  • Keep system prompts focused — System prompts should reinforce the agent’s specialization, not try to make the agent a generalist.

Tuning Weights

  • Default (0.7 competence / 0.3 cost) — Good for most use cases where quality matters more than cost.
  • High competence weight (0.9 / 0.1) — Use when quality is critical and cost is not a concern.
  • Balanced (0.5 / 0.5) — Use when you want a balance between quality and cost efficiency.
  • High cost weight (0.3 / 0.7) — Use for high-volume, cost-sensitive workloads where “good enough” is acceptable.

Learning Configuration

  • learning_rate=0.1 (default) — Slow adaptation, stable profiles. Good for production.
  • learning_rate=0.3 — Faster adaptation. Good for initial calibration of a new team.
  • max_loops=1 — Single pass, no refinement. Best for simple tasks.
  • max_loops=2-3 — Execute, evaluate, refine. Good for complex tasks that benefit from iterative improvement.

Error Handling

Inspecting Routing Decisions

Enable verbose=True and print_on=True to see detailed routing information:

Saving and Loading Handbooks

SkillHandbook is not exported from the top-level swarms package — import it directly from swarms.structs.skill_orchestra.

Source Code

View the source code on GitHub