Sub-agents
Research is noisy: reading pages, chasing sources, dead ends. A sub-agent
takes the noise into its own context window and returns only the answer.
Children run on their own sessions in your store, linked in the parent
transcript, and their events stream into the parent tagged with an
origin.
A sub-agent is not a second kind of agent. Underneath it is a regular
Agent on a fresh session; SubAgent is the recipe that mints one per
call, plus the packaging that makes it callable as a tool.
A named specialist
Picture a newsroom editor delegating one angle of a story to a reporter:
reporter = Mistri::SubAgent.new( name: "reporter", description: "Researches one angle of a story and files a short brief.", provider: Mistri.provider("claude-haiku-4-5-20251001"), system: "Report the facts for your assigned angle. File findings only.", tools: [fetch_page, search],)
agent = Mistri.agent("claude-opus-4-8", tools: [reporter.tool])The editor sees a single tool named reporter. Several calls in one turn
fan out in parallel, which is the fan-out demo on the front page.
An open spawner
Or hand the model a spawn tool and let it compose its own workers: an
optional name, instructions, a tool subset, and a model per child. The
name is a display label that rides the origin tags and the transcript
link, so a fan-out reads as city-desk#a41f instead of spawn#a41f; leave
it off and workers fall back to the generic label. The models: list is a
host allowlist, so the model picks from it and nothing else.
spawn = Mistri::SubAgent.spawner( provider: provider, tools: [fetch_page, search], models: %w[claude-haiku-4-5-20251001 claude-opus-4-8],)agent = Mistri.agent("claude-opus-4-8", tools: [spawn])Gates compose here too: a sub-agent’s risky tool cannot pause for approval inside a child, so gate the delegation itself and the parent run parks the same way.