Docs

Subagents

Split a task into parts and run them in parallel.

For large tasks, AxAgent can split the work and hand parts to subagents. Subagents run in parallel, and the agent combines their results.

Coming Q4 2026

AxAgent launches in Q4 2026. The API below may change before launch.

Set a limit

Use subagents.max to cap how many subagents a run can start.

const run = await axerity.runs.create({
  agent: agent.id,
  input: 'Check these 40 repos for outdated dependencies',
  subagents: { max: 8 },
})

Follow subagents

When you stream a run, you get an event when each subagent starts and when it completes.

subagents.ts
const stream = axerity.runs.stream({
  agent: agent.id,
  input: 'Check these 40 repos for outdated dependencies',
  subagents: { max: 8 },
})

for await (const event of stream) {
  if (event.type === 'subagent.started') {
    console.log('started', event.subagent.id, event.subagent.input)
  }
  if (event.type === 'subagent.completed') {
    console.log('done', event.subagent.id)
  }
}

const run = await stream.finalRun()

On this page