Swarms are defined in YAML. A swarm definition specifies the topology, agents,
and budget for a swarm that can be instantiated via the CLI or API.
# A research swarm that investigates a topic and writes a report
swarm_id : research-swarm-v1
Investigates a topic thoroughly and produces a fact-based report.
Uses parallel research + fact-checking + Norwegian report writing.
You are a research manager. Your job:
1. Analyze the research question
2. Break it into 2-4 subtopics
3. Send each to a researcher
4. Collect results and send to fact-checker
5. Send verified findings to writer
6. Return the finished report
You are a thorough researcher. When you receive a subtopic:
1. Search with web_search
3. Structure findings: main points, sources, uncertainties
Write in the target language. Be precise.
Verify every claim. Mark as {CONFIRMED}, {LIKELY}, or {UNCERTAIN}.
Write a well-structured report in the target language.
Field Required Description swarm_idYes Unique identifier, used in API calls nameNo Human-readable name descriptionNo What this swarm does and when to use it topologyYes sequential, parallel, debate, or hierarchicalagentsYes List of agent definitions (see below) cost_budgetNo Spending limits for this swarm
Field Required Default Description idYes — Unique within this swarm roleYes — What the agent does (shown in logs) modelYes — String ("deepseek-v3") or object with primary/fallback instancesNo 1How many copies of this agent to spawn (for parallel work) temperatureNo 0.7LLM creativity (0.0 = deterministic, 1.0 = creative) max_tokensNo 4096Maximum tokens per LLM response system_promptNo ""Core instructions for the agent toolsNo []List of tool names available to this agent
fallback : gpt-4o-mini # Used if primary fails or is overloaded
The fallback is used automatically when the primary model returns an error
(rate limit, overload, timeout). The cost router also considers the fallback
when choosing a model to fit within budget.
Tool Description web_searchSearch the web via Exa, Tavily, or SerpAPI run_pythonExecute Python in an isolated sandbox read_fileRead a file from the workspace write_fileWrite a file to the workspace api_callMake HTTP requests to external APIs delegateSend a subtask to another agent
sverm run --definition research-swarm.yaml " Investigate X "
Content-Type : application/json
"template" : " research-swarm-v1 " ,
"task" : " Investigate Norwegian hydrogen economy " ,
Sverm ships with these templates:
Template Topology Description research-swarm-v1Hierarchical Research any topic and produce a report code-review-swarm-v1Parallel Review code from multiple angles (security, perf, style) writing-swarm-v1Sequential Write → critique → polish creative text debate-swarm-v1Debate Two sides argue, a judge evaluates