Swift 6.0+
macOS 14+ · iOS 17+
Community
Strands Agents
Swift SDK
Build AI agents in Swift. A community implementation of the AWS Strands Agents framework with native Apple Silicon support.
What is Strands Agents?
Strands Agents is an open-source SDK by AWS for building AI agents. An agent combines a model, tools, and a system prompt inside a reasoning loop. The loop receives user input, calls the model, executes any tools the model requests, and repeats until it produces a final answer.
This Swift SDK supports the same core concepts as the official Python and TypeScript SDKs, with additional support for on-device inference via MLX and native Apple audio I/O for voice agents.
User Input
→
Model
→
Final Response
↕
Tools
(run concurrently, repeat until done)
Quick Example
main.swiftSwift
import StrandsAgents
/// Count the number of words in a block of text.
func wordCount(text: String) -> Int {
text.split(whereSeparator: \.isWhitespace).count
}
let wordCountTool = Tool(wordCount, "Count the number of words in a block of text.")
let agent = Agent(
model: try BedrockProvider(config: BedrockConfig(
modelId: "us.anthropic.claude-sonnet-4-20250514-v1:0"
)),
tools: [wordCountTool]
)
let result = try await agent.run("How many words are in the Gettysburg Address?")
print(result.message.textContent)
Platform Support
| Feature | macOS 14+ | iOS 17+ | tvOS 17+ |
|---|---|---|---|
| Core agent + tools | ✓ | ✓ | ✓ |
| Cloud providers | ✓ | ✓ | ✓ |
| MLX local inference | Apple Silicon | N/A | N/A |
| Voice agents (cloud) Coming Soon | ✓ | ✓ | N/A |
| Voice agents (local) Coming Soon | Apple Silicon | N/A | N/A |