본문으로 건너뛰기
Skillpedia
에이전트7.8k · #12831

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/2FastLabs/agent-squad/blob/main/swift/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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 (or GroundedAgent) + an Orchestrator with 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 of Agent) or OpenAIGroundedVoiceAssistant (Brain → Presenter, can't drift from data — analog of GroundedAgent).

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

  • Orchestrator drives a turn. The classifier is optional — omit it for a single agent.
  • Agent is one LLM with an internal tool loop. GroundedAgent is 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; presenterInput picks .questionAndData (default) or .dataOnly.
  • ChatCompletionsClient speaks the OpenAI wire — point its baseURL at OpenAI, Azure, OpenRouter, Groq, or a local Ollama/llama.cpp. Implement LLMClient for anything else.
  • Tools come from a ToolProvider. Built-ins: ToolKit holds native tools — Tool.local (Swift closure) and Tool.http/Tool.get/.post (declarative HTTP, with a ToolParameter DSL 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; and AggregateToolProvider composes any mix behind one seam; DakeraRetriever(namespace:…) is a ToolProvider backed by a self-hosted Dakera memory server — it exposes a search_memory tool for grounding (and a direct retrieve(_:) API), talking to Dakera's REST endpoint over URLSession with no extra dependency. A ToolResult is 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬