Concurrency cap
Members run concurrently behind a small cap (default 4) so big rosters
don't fan out unbounded. Each member inherits the orchestrator's
maxIterations / timeoutMs / cost tracking.
// L3 — the new feature
N role-specialized agents run the same task in parallel — each the same Orchestrator unit with a different role-lens. A separate synthesizer merges their answers into one. Diverse perspectives, not N identical runs.
Each member is the same Orchestrator you already run — just given a different role-lens system prompt and, optionally, a different driver. They all execute the identical task in parallel.
A separate synthesizer agent then runs over the members' labeled
answers and returns one merged result. When the council tools are present it calls
tachibot_council / tachibot_jury to adjudicate disagreements —
so the final answer is reconciled, not just concatenated.
Members run concurrently behind a small cap (default 4) so big rosters
don't fan out unbounded. Each member inherits the orchestrator's
maxIterations / timeoutMs / cost tracking.
A member that errors or times out is recorded with an empty answer and excluded
from synthesis. Too few answers — or a missing critical role — surfaces
a non-fatal warning, never a crash.
A dedicated synthesizer runs over the labeled answers and returns one merged result.
If council tools are connected it uses tachibot_council /
tachibot_jury to resolve disagreement.
Each run gets a unique traceId. Members are independent: each writes its
own session swarm:<traceId>:<role> and never reads peers' or
prior runs' memory. The final answer is logged once under swarm:<traceId>.
Default roster: implementer · critic · researcher.
npm run swarm -- "design a rate limiter for the gateway" # default roles: implementer · critic · researcher
# comma-separated: `name` or `name:driver` · empty = defaults export TACHI_SWARM_ROLES="implementer,critic:hermes,security,researcher" npm run swarm -- "review this auth flow"
import { buildSwarmFromEnv } from "tachi-agent"; const swarm = await buildSwarmFromEnv(); try { const { answer, members, warnings } = await swarm.run("design a rate limiter"); console.log(answer); } finally { await swarm.close(); }
Progress streams to stderr — one line per member, any warnings, and the trace id. The final synthesized answer prints to stdout.