agent-squad-swift
यह क्या करती है
यह गाइड AI को Swift ऐप बनाने में मदद करती है, जो AgentSquad फ्रेमवर्क से डिवाइस पर AI एजेंट्स का तालमेल बिठाता है। यह iOS या macOS ऐप पर काम करने वाले Swift डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब मुझे Swift में लिखे iPhone या Mac ऐप में एक AI सहायक जोड़ना हो।
- ✓जब मुझे कई विशेषज्ञ AI एजेंट्स चाहिए, और एक राउटर हर संदेश के लिए सही एजेंट चुने।
- ✓जब मेरे ऐप को AI के ऐसे जवाब चाहिए जो कीमतों या बैलेंस जैसे लाइव डेटा से मेल खाएँ।
Skill का लिंक
https://github.com/2FastLabs/agent-squad/blob/main/swift/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मुझे Swift iPhone ऐप में AgentSquad से एक मल्टी-एजेंट AI सहायक जोड़ना है। शुरुआत कहाँ से करूँ?”
हर हफ़्ते 5 नई skills, 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
- अपडेट की गई
- 8/10/2026
कमेंट
- …
इस repository की और skills
agent-squad-python
7.8kयह आपके एजेंट को Python में agent-squad पैकेज से ऐप बनाने में मदद करती है, जहाँ कई एजेंट मिलकर काम करते हैं।
agent-squad-typescript
7.8kआपके एजेंट को Node.js ऐप बनाने में मदद करती है, जहाँ कई AI एजेंट मिलकर काम करते हैं, डेटा सहेजते हैं और बाहरी टूल्स से जुड़ते हैं।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।