Sub-agents
Exploration is noisy: reading pages, grepping, 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 named specialist
researcher = Mistri::SubAgent.new( name: "researcher", description: "Reads pages and answers factual questions.", provider: Mistri.provider("claude-haiku-4-5-20251001"), system: "Research. Report findings only.", tools: [fetch_page],)
agent = Mistri.agent("claude-opus-4-8", tools: [researcher.tool])The parent sees a single tool named researcher. 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:
instructions, a tool subset, and a model per child. The models: list is a
host allowlist; 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 can still require human approval, and the parent run parks the same way.