# Agent Squad

> Route each turn to the right specialist agent, keep one conversation

- Category: Agents & Automation / Multi-Agent Systems
- Language: Swift
- Licence: Apache-2.0
- Repository: https://github.com/2FastLabs/agent-squad
- Website: https://2fastlabs.github.io/agent-squad/
- Canonical page: https://ai-tldr.dev/tools/agent-squad/

## In short

Agent Squad is a framework for running a team of specialist agents behind a single conversation. It sits in the Multi-Agent Systems category of the Agents & Automation tools and is open-source, written in Swift and licensed Apache-2.0. To get started: install for your runtime.

## Overview

Agent Squad is a framework for running a team of specialist agents behind a single conversation. Rather than building one large agent with every tool attached, you register several narrow agents — a tech agent, a billing agent, a travel agent — and let the framework decide which one should answer each turn.

It is built from three swappable pieces. A **classifier** reads the user's input together with the conversation history and picks the agent best suited to it. **Agents** do the work and call whatever tools they need; pre-built implementations cover Amazon Bedrock, Anthropic and OpenAI, and you can write your own. **Storage** holds the chat history so context carries across turns and across agents, with implementations you can swap for your own persistence layer.

The framework is unusual in shipping three first-class runtimes from one project: Python, TypeScript and Swift. The Swift package targets iOS 16+ and macOS 14+, which makes it a practical choice when the orchestration needs to run on-device rather than in a server process.

## What it does

- Classifier-based routing that picks the right agent per turn using the input and the conversation history
- Shared, swappable storage so context follows the user across agents and sessions
- Pre-built agents for Amazon Bedrock, Anthropic and OpenAI, plus a path for custom implementations
- Streaming responses supported on agents that provide them
- Three runtimes from one codebase: Python 3.11+, TypeScript on Node.js, and Swift for iOS 16+ / macOS 14+
- Optional extras per provider, so you install only the integrations you use

## Getting started

Install the package for your runtime, register a few agents with clear descriptions — the classifier routes on those descriptions — then hand it a request.

1. Install for your runtime

   Python ships provider extras; pick the ones you need, or use [all].

```bash
# TypeScript
npm install agent-squad

# Python (extras: [aws], [anthropic], [openai], [all])
pip install "agent-squad[aws]"
```

2. Add it to a Swift package

   For iOS 16+ / macOS 14+ targets, add the repository to your Package.swift dependencies.

```text
.package(url: "https://github.com/2FastLabs/agent-squad", branch: "main")
```

3. Register agents and route a request

   The description is what the classifier matches against, so write it as the agent's remit. routeRequest takes the query plus a user id and session id, which is how storage keeps history separate per conversation.

```typescript
const orchestrator = new AgentSquad();

orchestrator.addAgent(new BedrockLLMAgent({
  name: "Tech Agent",
  description: "Specializes in technology: software, hardware, AI, cybersecurity, cloud.",
  streaming: true
}));

const response = await orchestrator.routeRequest(
  "What is AWS Lambda?",
  "user123",
  "session456"
);
```

## When to use it

- Reach for it when one assistant has to cover several unrelated domains and a single prompt is getting unwieldy
- Reach for it for customer support, routing billing, technical and account questions to agents with different tools and guardrails
- Reach for it when you want to mix providers — a Bedrock agent for one domain, an Anthropic or OpenAI agent for another — behind one conversation
- Reach for it when the orchestration needs to run natively on iOS or macOS rather than in a backend service
