> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuralfactory.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Subagents

> How an agent hands parts of a task to specialist agents and combines what they return.

An agent is an AI assistant you give tasks to, and a subagent is a specialist agent that another agent can hand part of a task to. You talk to one agent. When your request touches several areas, it asks the right specialists and puts their answers together for you.

## How it works

An agent of type **Agent** can have subagents. When a task comes in, the agent reads it and decides which parts to hand on, choosing each subagent by its name and description. It writes each subagent a description of its part. Each subagent works with its own instructions, knowledge bases and tools, and returns a result. The agent then combines the results into one answer.

```mermaid theme={null}
flowchart LR
  P[You] --> A[Agent]
  A --> H[HR subagent]
  A --> F[Finance subagent]
  H --> A
  F --> A
  A --> R[One answer]
```

You do not pick the subagents; the agent does. A subagent can still be used on its own: **New task** lists it under **Subagents**, and it then answers you directly.

## When it helps

Subagents help when your organization has separate areas of knowledge or tools, and each one deserves a focused agent of its own. Each specialist gets a narrow job, its own knowledge bases and its own tools, and you can test and change it without touching the others.

For a request in one area, one agent is enough.

## An example

A new employee asks the company assistant: "What do I need to do before my first business trip?" The assistant hands the question about the travel policy and per diems to the HR subagent, which searches the HR handbook. It hands the question about booking and expense codes to the Finance subagent, which searches the finance procedures. The assistant answers with one checklist, and each part cites the document it came from.

## Limits

* An agent can have up to 20 subagents.
* Only an agent of type **Agent** can have subagents. A subagent has no subagents of its own, and an agent cannot be its own subagent. An agent's type cannot be changed after it is created.
* The agent tells its subagents apart by name, so give each one a clear, distinct name and description. If two have the same name, the studio warns you.
* The subagents work inside the agent's task. The whole request counts as one task against the limit on tasks running at once, and it shares that task's limits, including about an hour of active work by default.
* By default, up to 10 subagents work at the same time within one task. Extra ones wait their turn. If the platform restarts during a task, subagent work that already finished is not repeated.
* If a subagent is deleted, it is removed from every agent that used it. For a published agent, that change is recorded as a new revision.

## Subagents and workflows

An agent can also run published workflows. A subagent decides its own steps, like any agent. A workflow follows fixed steps and can stop for a person's approval. See [Agents and workflows](https://docs.neuralfactory.ai/user-guide/concepts/agents-and-workflows.md).

## Where you see this in the app

* The agent's **Subagents** section in the studio, and **Agent Type** in its **Identity** section. See [Subagents](https://docs.neuralfactory.ai/user-guide/agents/multi-agent-workflows.md).
* **Workforce** › **Agents**: the type filter shows **Agents** or **Subagents**. See [Agents overview](https://docs.neuralfactory.ai/user-guide/agents/overview.md).
* **New task**: subagents you can use are listed under **Subagents**. See [Selecting an agent](https://docs.neuralfactory.ai/user-guide/chat/selecting-an-agent.md).

## Next

* [Agents and workflows](https://docs.neuralfactory.ai/user-guide/concepts/agents-and-workflows.md)
* [Set up subagents](https://docs.neuralfactory.ai/user-guide/agents/multi-agent-workflows.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.