Swarm
One model call drafts the plan, and nothing else runs until you approve it. Every source is fetched again before the report is written.
What it does
One call, then your approval
The root agent turns your prompt into a tree of tasks with a single model call. You see the plan, and nothing else starts until you approve it.
Four researchers, one verifier
Once you approve the plan, up to four researchers run in parallel to a depth of two. A verifier fetches every cited source again.
A writer with no web access
The writer composes from verified findings only and cannot browse. A reviewer audits the draft against its sources and can fail it.
How a run goes
The orange path is an approved run. Before approval, the only spend is the single planning call.
Core responsibilities
Plan before it spends
The root agent breaks your question into a small tree of tasks with a single call, then waits for your approval.
Research in parallel
Up to four researchers work at once, two levels deep, and every finding streams into the graph as it arrives.
Re-fetch every source
A verifier fetches each cited source again. The writer composes only from verified findings and has no web access.
Review against provenance
A reviewer audits the draft and returns pass, pass with notes or fail. A fabricated or miscited claim is fatal and fails the report.
End as three files
A completed run leaves exactly three files: the graph, the report and the JSON.
Swarm in figures
- 1model call before you confirm the plan; no fan-out until you dothe plan gate in the server
- 4researchers at once, two levels deepthe concurrency cap
- 100%of cited sources re-fetched by the verifierby design, in the verifier
- 18tests in the repositorycounted in the repository
Counted in the repository, read from a run or set in the code. No figure is estimated.
SwarmRunning
Why it is built this way
Rules written into the code, and what each one prevents.
Apply for a seatEvery finding says how sure it is
Each finding is tagged extracted, inferred or ambiguous. The reviewer flags a draft that drops the tag.
Shared sources become links
When two findings cite the same source, the graph draws an edge between them and shows where the research overlaps.
The plan sets the spend
Each role has its own token budget. Every leaf in the plan is another researcher, so the plan you confirm is the bill you agree to.
The code behind Swarm
Three files from the repository, shown in turn. Select one to read it.
01export const SYSTEM = `You are the planning agent for a research swarm.02 03Given a user prompt, output a tree of researcher sub-tasks. Each node is one04focused research question a single agent can answer in a few web queries.05Keep the tree shallow (depth 2: one root, then leaves). Scale leaves to the06question: a single factual lookup needs 1-2 leaves; a comparative or07multi-part question needs 3-5; cap at 6. Do not pad the tree with leaves08that aren't load-bearing — every leaf costs another parallel research call.01Classify each issue:02- FATAL: a claim is fabricated, miscited, or contradicts a finding03- MAJOR: a tag is missing, a section drifts off-prompt, an open question is buried04- MINOR: style, redundancy, weak phrasing01async function autoConfirm(bus: SseBus, run_id: string) {02 await bus.waitFor(e => {03 if (e.type !== 'plan_proposed') return false04 return (e.payload as { run_id: string }).run_id === run_id05 })06 bus.publish({07 type: 'plan_confirmed',08 payload: { run_id, decision: 'confirm' },09 ts: Date.now(),10 })11}Bring the workflow that keeps breaking.
Our engineers work through it with you in a free 45-minute briefing.