Flexible and powerful framework for managing multiple AI agents and handling complex conversations
7,756
stars
984
commits
Swift
primary language
Sep 6, 2026
updated
Flexible, lightweight open-source framework for orchestrating multiple AI agents — in the cloud with Python and TypeScript, and now on device with Swift.
On-device agent orchestration for iPhone, iPad, and Mac — agents, MCP tools, realtime voice, and tracing, running entirely on device.
See what's included ↓ · Swift README →
Explore the full documentation
New home: previously hosted at
awslabs/agent-squad, the project is now maintained at2fastlabs/agent-squad(and was formerly namedmulti-agent-orchestrator). Please update bookmarks, clone URLs, and dependencies.
Agent Squad routes each user query to the most suitable of your specialized agents and maintains conversation context across them. You get pre-built agents, classifiers, and storage for quick deployment, plus small, well-defined seams to plug in your own.
| Runtime | Requirements |
|---|---|
| Python | Python 3.11+ |
| TypeScript | Node.js |
| Swift — new | iOS 16+ / macOS 14+ |
Python and TypeScript maintain feature parity and run anywhere — AWS Lambda, containers, your laptop. The new Swift runtime brings the same orchestration model to Apple platforms and runs entirely on device: classifier routing, tools (native and MCP), realtime voice, tracing, and local-first chat storage.

npm install agent-squad
import { AgentSquad, BedrockLLMAgent } from "agent-squad";
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");
console.log(`> Agent: ${response.metadata.agentName}\n`);
if (response.streaming) {
for await (const chunk of response.output) {
if (typeof chunk === "string") process.stdout.write(chunk);
}
} else {
console.log(response.output);
}
pip install "agent-squad[aws]" # or [anthropic], [openai], [all] — see the docs
import asyncio
from agent_squad.orchestrator import AgentSquad
from agent_squad.agents import BedrockLLMAgent, BedrockLLMAgentOptions, AgentStreamResponse
orchestrator = AgentSquad()
orchestrator.add_agent(BedrockLLMAgent(BedrockLLMAgentOptions(
name="Tech Agent",
description="Specializes in technology: software, hardware, AI, cybersecurity, cloud.",
streaming=True,
)))
async def main():
response = await orchestrator.route_request("What is AWS Lambda?", "user123", "session456", {}, True)
print(f"> Agent: {response.metadata.agent_name}\n")
if response.streaming:
async for chunk in response.output:
if isinstance(chunk, AgentStreamResponse):
print(chunk.text, end="", flush=True)
else:
print(response.output.content)
asyncio.run(main())
Add the package to your Package.swift (or via Xcode → Add Package Dependencies):
dependencies: [
.package(url: "https://github.com/2FastLabs/agent-squad", branch: "main")
]
import AgentSquad
let agent = Agent(name: "Shop", description: "Shopping assistant",
model: ChatCompletionsClient(model: "gpt-4o-mini", apiKey: apiKey))
let orchestrator = Orchestrator(agents: [agent], store: try DeviceChatStorage(userId: "u1"))
for try await event in orchestrator.route(.text("wireless headphones under €100?"),
userId: "u1", sessionId: "s1") {
if case .textDelta(let token) = event { print(token, terminator: "") }
}
Full walkthrough in the Swift README.
A lead agent coordinates a team of specialized agents in parallel using an agent-as-tools architecture, maintaining shared context and delivering one coherent response.

Learn more about SupervisorAgent →
Available in all three runtimes, GroundedAgent is the framework's anti-hallucination pattern: two LLMs instead of one.

Use it wherever answers must match the data exactly — prices, odds, balances, availability.
Learn more about GroundedAgent →
The orchestration model above, rebuilt for Apple platforms as a protocol-driven Swift 6 package — designed to run the whole loop on device:
Agent, GroundedAgent, or your own AgentProtocol conformance, routed by an optional LLMClassifier.Start with the Swift README and the Swift docs.
Watch the demo app route a conversation across six specialized agents (travel, weather, restaurants, math, tech, health) while preserving context through brief follow-ups:

chat-demo-app — web chat interface with multiple specialized agents (guide).ecommerce-support-simulator — AI-powered customer support with human-in-the-loop (guide).chat-chainlit-app — chat application built with Chainlit.fast-api-streaming — FastAPI with streaming.text-2-structured-output — natural language to structured data.bedrock-inline-agents · bedrock-prompt-routing — Bedrock samples.Each runtime ships a skill — a single, assistant-agnostic guide that gives an AI assistant the mental model, real API signatures, task recipes, and gotchas it needs to write correct code with the framework:
| Runtime | Skill file |
|---|---|
| Python | python/SKILL.md |
| TypeScript | typescript/SKILL.md |
| Swift | swift/SKILL.md |
These files are not auto-installed — point your assistant at the relevant one. For example:
Read
python/SKILL.mdbefore writing any agent-squad Python code.
Works with any assistant (Claude, Cursor, Copilot, …).
Questions, ideas, or something to show off? Join the discussions: Show & Tell · General · Ideas.
Contributions are welcome. This repository follows an issue-first policy: every pull request must be linked to an issue (Fixes #123 in the PR body, or GitHub's "Link an issue"); a required CI check enforces it. Open an issue to discuss your proposal, then see the Contributing Guide for build and test instructions per runtime.
Star the repository to be notified about new features and releases.
Big shout out to our awesome contributors! Thank you for making this project better!
If Agent Squad has helped you or your organization build AI applications faster, consider sponsoring its development. Your sponsorship funds maintenance, documentation, and new features — keeping the project healthy for the entire community.
This project is licensed under the Apache 2.0 license — see the LICENSE file for details.
This project uses the JetBrainsMono NF font, licensed under the SIL Open Font License 1.1.
Swift
38.8%
Python
38.5%
TypeScript
22.6%
Flexible and powerful framework for managing multiple AI agents and handling complex conversations
7,756
stars
984
commits
Swift
primary language
Sep 6, 2026
updated
Flexible, lightweight open-source framework for orchestrating multiple AI agents — in the cloud with Python and TypeScript, and now on device with Swift.
On-device agent orchestration for iPhone, iPad, and Mac — agents, MCP tools, realtime voice, and tracing, running entirely on device.
See what's included ↓ · Swift README →
Explore the full documentation
New home: previously hosted at
awslabs/agent-squad, the project is now maintained at2fastlabs/agent-squad(and was formerly namedmulti-agent-orchestrator). Please update bookmarks, clone URLs, and dependencies.
Agent Squad routes each user query to the most suitable of your specialized agents and maintains conversation context across them. You get pre-built agents, classifiers, and storage for quick deployment, plus small, well-defined seams to plug in your own.
| Runtime | Requirements |
|---|---|
| Python | Python 3.11+ |
| TypeScript | Node.js |
| Swift — new | iOS 16+ / macOS 14+ |
Python and TypeScript maintain feature parity and run anywhere — AWS Lambda, containers, your laptop. The new Swift runtime brings the same orchestration model to Apple platforms and runs entirely on device: classifier routing, tools (native and MCP), realtime voice, tracing, and local-first chat storage.

npm install agent-squad
import { AgentSquad, BedrockLLMAgent } from "agent-squad";
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");
console.log(`> Agent: ${response.metadata.agentName}\n`);
if (response.streaming) {
for await (const chunk of response.output) {
if (typeof chunk === "string") process.stdout.write(chunk);
}
} else {
console.log(response.output);
}
pip install "agent-squad[aws]" # or [anthropic], [openai], [all] — see the docs
import asyncio
from agent_squad.orchestrator import AgentSquad
from agent_squad.agents import BedrockLLMAgent, BedrockLLMAgentOptions, AgentStreamResponse
orchestrator = AgentSquad()
orchestrator.add_agent(BedrockLLMAgent(BedrockLLMAgentOptions(
name="Tech Agent",
description="Specializes in technology: software, hardware, AI, cybersecurity, cloud.",
streaming=True,
)))
async def main():
response = await orchestrator.route_request("What is AWS Lambda?", "user123", "session456", {}, True)
print(f"> Agent: {response.metadata.agent_name}\n")
if response.streaming:
async for chunk in response.output:
if isinstance(chunk, AgentStreamResponse):
print(chunk.text, end="", flush=True)
else:
print(response.output.content)
asyncio.run(main())
Add the package to your Package.swift (or via Xcode → Add Package Dependencies):
dependencies: [
.package(url: "https://github.com/2FastLabs/agent-squad", branch: "main")
]
import AgentSquad
let agent = Agent(name: "Shop", description: "Shopping assistant",
model: ChatCompletionsClient(model: "gpt-4o-mini", apiKey: apiKey))
let orchestrator = Orchestrator(agents: [agent], store: try DeviceChatStorage(userId: "u1"))
for try await event in orchestrator.route(.text("wireless headphones under €100?"),
userId: "u1", sessionId: "s1") {
if case .textDelta(let token) = event { print(token, terminator: "") }
}
Full walkthrough in the Swift README.
A lead agent coordinates a team of specialized agents in parallel using an agent-as-tools architecture, maintaining shared context and delivering one coherent response.

Learn more about SupervisorAgent →
Available in all three runtimes, GroundedAgent is the framework's anti-hallucination pattern: two LLMs instead of one.

Use it wherever answers must match the data exactly — prices, odds, balances, availability.
Learn more about GroundedAgent →
The orchestration model above, rebuilt for Apple platforms as a protocol-driven Swift 6 package — designed to run the whole loop on device:
Agent, GroundedAgent, or your own AgentProtocol conformance, routed by an optional LLMClassifier.Start with the Swift README and the Swift docs.
Watch the demo app route a conversation across six specialized agents (travel, weather, restaurants, math, tech, health) while preserving context through brief follow-ups:

chat-demo-app — web chat interface with multiple specialized agents (guide).ecommerce-support-simulator — AI-powered customer support with human-in-the-loop (guide).chat-chainlit-app — chat application built with Chainlit.fast-api-streaming — FastAPI with streaming.text-2-structured-output — natural language to structured data.bedrock-inline-agents · bedrock-prompt-routing — Bedrock samples.Each runtime ships a skill — a single, assistant-agnostic guide that gives an AI assistant the mental model, real API signatures, task recipes, and gotchas it needs to write correct code with the framework:
| Runtime | Skill file |
|---|---|
| Python | python/SKILL.md |
| TypeScript | typescript/SKILL.md |
| Swift | swift/SKILL.md |
These files are not auto-installed — point your assistant at the relevant one. For example:
Read
python/SKILL.mdbefore writing any agent-squad Python code.
Works with any assistant (Claude, Cursor, Copilot, …).
Questions, ideas, or something to show off? Join the discussions: Show & Tell · General · Ideas.
Contributions are welcome. This repository follows an issue-first policy: every pull request must be linked to an issue (Fixes #123 in the PR body, or GitHub's "Link an issue"); a required CI check enforces it. Open an issue to discuss your proposal, then see the Contributing Guide for build and test instructions per runtime.
Star the repository to be notified about new features and releases.
Big shout out to our awesome contributors! Thank you for making this project better!
If Agent Squad has helped you or your organization build AI applications faster, consider sponsoring its development. Your sponsorship funds maintenance, documentation, and new features — keeping the project healthy for the entire community.
This project is licensed under the Apache 2.0 license — see the LICENSE file for details.
This project uses the JetBrainsMono NF font, licensed under the SIL Open Font License 1.1.
Swift
38.8%
Python
38.5%
TypeScript
22.6%