मुख्य सामग्री पर जाएँ
Skillpedia
एजेंट7.8k · #12831

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/2FastLabs/agent-squad/blob/main/swift/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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 (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
अपडेट की गई
8/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills