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

# Use of Single Agents vs Agent Squad

> When should I use multiple agents and single agents in orkeia AI?

# Single Agents vs Agent Squad

In Orkeia, **AI agents** can operate in two main ways:

1. **Single Agent**
   * A unique agent that performs all steps of the task.
   * Centralizes reasoning and maintains consistency in the flow.
2. **Agent Squad**
   * A set of specialized agents that work collaboratively.
   * Each agent focuses on a part of the task, delivering results that others can consume.

***

## When to Use a Single Agent?

Using a single agent is recommended in scenarios where:

* The task is **simple** and can be solved in one or a few steps.
* It's important to **save tokens** and reduce operational cost.
* There's no need for specialized roles (e.g., doesn't need separate "researcher", "analyst", and "writer").
* The flow should be fast, with **minimal latency**.

**Practical Examples**:

* Answering direct customer questions in a chat.
* Generating quick summaries of short texts.
* Executing direct commands, like "convert this file to PDF".

***

## When to Use an Agent Squad?

The squad is more suitable when:

* The task requires **role division** (research, analysis, decision, writing, validation).
* There's a need for **specialization**, where each agent has distinct instructions and knowledge.
* The problem is **complex or open-ended**, requiring multiple steps to reach a robust answer.
* The flow needs **cross-verification**, increasing consistency and quality.
* **Scalability** is desired: different agents can run in parallel on subtasks.

**Practical Examples**:

* Creating extensive reports with data collection, statistical analysis, and final writing.
* Customer service with agents taking on different roles (triage, resolution, follow-up).
* Research projects with agents specialized in sourcing, validating information, and generating synthesis.
* Long workflows that require **step orchestration**.

***

## Comparative

| Criterion          | Single Agent                          | Agent Squad                                        |
| ------------------ | ------------------------------------- | -------------------------------------------------- |
| **Complexity**     | Low, direct tasks                     | High, open-ended and multi-phase tasks             |
| **Speed**          | Faster, low latency                   | May be slower, due to coordination                 |
| **Cost (tokens)**  | More economical                       | Higher cost, multiple agents processing            |
| **Consistency**    | Linear flow, no multiple views        | Possibility of divergence, but with cross-checking |
| **Specialization** | Single profile                        | Each agent can be specialized                      |
| **Scalability**    | Limited to the reasoning of one model | Scalable with division of parallel subtasks        |
| **Use Example**    | Answering simple FAQ questions        | Producing detailed analytical reports              |

***

## Best Practices

* **Assess complexity before deciding**: if the task can be solved by a single agent, prefer simplicity.
* **Use squads only when necessary**: the overhead of coordination and cost only pays off in complex scenarios.
* **Define clear roles**: each agent in the squad should have well-defined responsibilities, avoiding redundancy.
* **Monitor costs**: distribute token usage among agents in a controlled manner.
* **Keep interaction logs**: for squads, the history helps debug coordination failures.

***

## Final Summary

* **Single Agent** is ideal for **quick, direct, and economical tasks**.
* **Agent Squad** is the right choice for **complex problems that require collaboration, specialization, and orchestration**.

In Orkeia, both formats are supported, allowing flexibility between **simplicity** and **advanced collaboration**.
