# Agent with subagents

Example OrchaJS parent agent that delegates work to private subagents.

Source: https://orcha.sh/docs/tutorial/subagents
Markdown: https://orcha.sh/docs/tutorial/subagents.mdx

<CodeExplorer {...subagentsAgentExample} className="tutorial-code-explorer" />

## Delegate focused reasoning

This example is a complete research coordinator with one private subagent. The
coordinator decides what to delegate, the researcher handles one focused
question, and the coordinator remains responsible for the final response.

A subagent is an ordinary agent folder with its own model configuration,
instructions, context, and durable session. Registering it inside
`coordinator.subagents` gives the parent internal tools to run, resume, and
inspect that child without exposing the child as a top-level application API.

The parent waits while the child runs, receives the child response as a tool
result, and continues automatically. Parent and child histories remain
separate and linked for inspection.

Select any file in the editor to inspect the complete standalone project.

## Understand each file

<TutorialFileReference files={subagentsAgentFiles} />

Next: [test an agent](/docs/tutorial/tests).
