agent-squad-swift
하는 일
이 안내서는 AI가 AgentSquad 프레임워크를 사용해 기기에서 AI 에이전트를 조율하는 Swift 앱을 만들도록 돕습니다. iOS나 macOS 앱을 개발하는 Swift 개발자를 위한 것입니다.
사용하는 경우
- ✓Swift로 쓴 iPhone이나 Mac 앱에 단일 AI 어시스턴트를 추가하고 싶을 때.
- ✓여러 전문 AI 에이전트가 필요하고, 라우터가 각 메시지에 맞는 에이전트를 고르게 하고 싶을 때.
- ✓앱이 가격이나 잔액 같은 실시간 데이터와 맞아야 하는 AI 답변이 필요한 경우.
스킬 링크
https://github.com/2FastLabs/agent-squad/blob/main/swift/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“AgentSquad를 사용해 Swift iPhone 앱에 다중 에이전트 AI 어시스턴트를 추가하고 싶습니다. 어디서부터 시작하면 좋을까요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트, 라우터, 도구 같은 적절한 구성 요소를 AI에게 알려 주고, 주의할 점을 설명합니다. 공식 레퍼런스를 대신하지는 않습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
AgentSquad Swift — assistant guide
Protocol-driven, on-device multi-agent framework (Swift 6.2, iOS 16+ / macOS 14+; persistence via
FileChatStorage on iOS 16+, DeviceChatStorage on iOS 17+). This is guidance and
a map — not an API reference. Read the exact signatures from the source (swift/Sources/AgentSquad/)
and the worked recipes from the docs site sources (docs/src/content/docs/swift/); this file tells
you what to use, when, and what to watch out for.
When to use what
- One assistant → an
Agent(orGroundedAgent) + anOrchestratorwith no classifier. No routing hop. - Several specialists → multiple agents + an
LLMClassifier; the orchestrator routes each turn. - Answers must not drift from data (prices, stock, balances) →
GroundedAgent: a Brain calls tools, an isolated Presenter speaks only from the curated results (it can be a smaller/local model). - Voice → a
VoiceAssistant(a peer of the orchestrator, not an agent):OpenAIVoiceAssistant(single LLM + tools, speaks directly — the spoken analog ofAgent) orOpenAIGroundedVoiceAssistant(Brain → Presenter, can't drift from data — analog ofGroundedAgent).
Every component is a Sendable protocol with one built-in implementation — swap in your own anywhere.
Modules (import only what you use)
| Import | Pulls in | Contents |
|---|---|---|
AgentSquad |
nothing external | protocols, Agent, GroundedAgent, Orchestrator, LLMClassifier, ChatCompletionsClient, DakeraRetriever, FileChatStorage, DeviceChatStorage, InMemoryChatStorage, TransformingChatStorage, SummarizingChatStorage, OSLogTracer, OTLP export |
AgentSquadMCP |
MCP Swift SDK | MCPServer (= MCPToolProvider), SDKMCPClient |
AgentSquadAudio |
AVFoundation | VoiceProcessedAudioIO (capture+playback, one engine, AEC — the recommended wiring), MicCapture (voice-processed/AEC by default), AudioPlayback, VoiceProcessing, AudioSessionPolicy (needs NSMicrophoneUsageDescription) |
SwiftPM: .package(url: "https://github.com/2FastLabs/agent-squad", branch: "main").
How a turn works
Two peer runtimes share contracts but not a control loop: a turn-based Orchestrator
(classify? → run agent → stream → persist) and a long-lived VoiceAssistant for voice. Either
way you consume an AsyncThrowingStream<AgentEvent, any Error> — the one idiom worth memorizing:
for try await event in orchestrator.route(.text("hello"), userId: "u1", sessionId: "s1") {
switch event {
case .textDelta(let token): /* stream tokens */
case .final(let message): /* the message that was persisted */
case .toolCall, .widget, .thinking, .error: break // .error is a user-facing string
}
}
.error carries a user-facing message; real programmer/transport failures throw through the
stream. .final is what the orchestrator persists. Inputs/messages are value types
(AgentInput.text, ConversationMessage, ContentPart, JSONValue) in Sources/AgentSquad/Core/.
The pieces
Orchestratordrives a turn. The classifier is optional — omit it for a single agent.Agentis one LLM with an internal tool loop.GroundedAgentis two LLMs (Brain + isolated Presenter) for answers that must stay grounded in tool results. The Presenter never sees chat history or the Brain's transcript;presenterInputpicks.questionAndData(default) or.dataOnly.ChatCompletionsClientspeaks the OpenAI wire — point itsbaseURLat OpenAI, Azure, OpenRouter, Groq, or a local Ollama/llama.cpp. ImplementLLMClientfor anything else.- Tools come from a
ToolProvider. Built-ins:ToolKitholds native tools —Tool.local(Swift closure) andTool.http/Tool.get/.post(declarative HTTP, with aToolParameterDSL so you don't hand-write JSON Schema);HTTPToolGroup(baseURL:…)declares one API's shared config once, then one line per endpoint;MCPServer(url:)connects an MCP server; andAggregateToolProvidercomposes any mix behind one seam;DakeraRetriever(namespace:…)is aToolProviderbacked by a self-hosted Dakera memory server — it exposes asearch_memorytool for grounding (and a directretrieve(_:)API), talking to Dakera's REST endpoint overURLSessionwith no extra dependency. AToolResultis three-part: text → the model's context,structuredContent→ curator/UI data,
자주 묻는 질문
어떤 Apple 시스템을 지원하나요?
프레임워크는 iOS 16 이상과 macOS 14 이상을 대상으로 합니다.
전문가만을 위한 안내서인가요?
아니요. 이미 Swift 앱을 만들고 있고 이 프레임워크를 쓰고 싶은 개발자를 위한 것입니다.
에이전트가 외부 도구를 쓸 수 있나요?
네. 프레임워크는 기본 도구와 MCP 서버가 제공하는 도구를 모두 지원합니다.
상세 정보
작성자의 원본 설명
Use when building or modifying a Swift app that uses the AgentSquad Swift framework — on-device multi-agent orchestration for iOS 16+ / macOS 14+: orchestrator, agents (Agent, GroundedAgent), classifier routing, LLM clients (OpenAI-compatible), tools (native + MCP), tool UIs/widgets, on-device storage, tracing, and realtime voice — built-in types and custom implementations.
repo: 2FastLabs/agent-squad
인기도
- GitHub 스타
- 7.8k
- 순위
- #12831
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 10. 8.
댓글
- …
이 저장소의 다른 스킬
agent-squad-python
7.8k여러 AI 에이전트를 조율하고 요청을 라우팅하며 도구를 공유하는 agent-squad 패키지로 Python 앱을 만들도록 돕습니다.
agent-squad-typescript
7.8k여러 AI 에이전트가 함께 일하는 Node.js 앱을 만들도록 돕습니다. 라우팅, 데이터 저장, 외부 도구 연결을 포함합니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.