Skip to main content
Agency in Agency Swarm is a collection of agents that can collaborate with one another.

Benefits of Using an Agency

Utilizing an Agency consisting of multiple agents offers several benefits:

Fewer Hallucinations

Agents within an agency can supervise each other, reducing mistakes and handling unexpected scenarios more effectively.

Complex Tasks

Adding more agents allows for longer sequences of actions, enabling the completion of more complex tasks before delivering results to the user.

Scalability

Agencies allow you to scale your solutions seamlessly by adding more agents, as the complexity of your system grows.
Start with a minimal number of agents. Fine-tune them to ensure they function correctly before adding more. Introducing too many agents initially can make debugging and understanding interactions challenging.
In the latest version, the Agency class orchestrates a collection of Agent instances based on a defined structure. It provides enhanced thread management, persistence hooks, and improved communication patterns between agents.

Agency Parameters

Overview of parameters in the new Agency class:

Example

Quick example of how to create an agency with 3 agents using the new structure:

Next Steps

Make sure to learn more about Communication Flows and Running an Agency.