Documentation Index
Fetch the complete documentation index at: https://docs.swarms.world/llms.txt
Use this file to discover all available pages before exploring further.
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:- 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. - Agent Scoring — Each agent is scored using a weighted competence-cost formula against the required skills. This step is pure math — no LLM calls.
- Agent Selection — The top-k agents with the highest scores are selected.
- Execution — Selected agents execute the task. Multiple agents run concurrently via
ThreadPoolExecutor. - 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:competence_iis the agent’s estimated probability of success on skillinormalized_cost_iis1 - (cost - min_cost) / (max_cost - min_cost)(lower cost = higher score)importance_iis how important the skill is for the task
Key Components
Data Models
| Model | Description |
|---|---|
SkillDefinition | A fine-grained skill with name, description, and optional category |
AgentSkillProfile | An agent’s competence (0-1) and cost on a specific skill, with execution statistics |
AgentProfile | Complete skill profile for a single agent |
SkillHandbook | Central data structure mapping all skills to all agent profiles |
TaskSkillInference | LLM output: skills required by a given task with importance weights |
AgentSelectionResult | Result of agent scoring with name, score, and reasoning |
ExecutionFeedback | Post-execution quality assessment for updating skill profiles |
Attributes
Name identifier for the orchestrator.
Description of the orchestrator’s purpose.
List of agents to orchestrate (at least 1 required).
Maximum execution-feedback loops per task.
Output format:
"dict", "str", "json", "final", etc.LLM model for skill inference and evaluation.
LLM temperature for inference calls.
Pre-built skill handbook. If
None, auto-generated from agent descriptions.Whether to auto-generate handbook when none is provided.
Weight for cost component in scoring (0-1).
Weight for competence component in scoring (0-1).
Number of agents to select per task.
Whether to update skill profiles after execution via EMA.
EMA learning rate for profile updates.
Whether to save conversation history and handbook to disk.
Whether to log detailed information.
Whether to print panels to console.
Methods
run()
Run the full pipeline on a single task.task(str): The task to executeimg(Optional[str]): Optional image inputimgs(Optional[List[str]]): Optional list of image inputs
output_type format
__call__()
Callable interface that delegates torun().
task(str): The task to execute
run()
batch_run()
Run multiple tasks sequentially.tasks(List[str]): List of tasks to execute
List[Any] - List of results, one per task
concurrent_batch_run()
Run multiple tasks concurrently.tasks(List[str]): List of tasks to execute
List[Any] - List of results from concurrent execution
get_handbook()
Return the current skill handbook as a dictionary.dict - The skill handbook data
update_handbook()
Replace the skill handbook.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
Enableverbose=True and print_on=True to see detailed routing information: