Swift SDK
Official Swift SDK for MemoryKit. iOS, macOS, watchOS, tvOS.
Built on Foundation/URLSession. No SPM dependencies.
Every method is async throws. Native Swift concurrency.
iOS 15+, macOS 12+, watchOS 8+, tvOS 15+.
Installation
Add via Swift Package Manager in Package.swift:
Or in Xcode: File → Add Package Dependencies → paste the URL above.
Quick start
Configuration options
Memories
Create and manage
Upload files
Supports PDF, DOCX, XLSX, PPTX, TXT, CSV, Markdown, HTML, and JSON.
Batch ingest
Up to 100 memories in a single request.
Reprocess
Triggers re-chunking and re-embedding for an existing memory.
Search
Hybrid search
Combines vector similarity, full-text search, and reranking.
RAG query
Coming Soon — memories.query() is not available in the current SDK release. Use memories.search() for retrieval. LLM-powered query with answer generation will be available in a future release.
Streaming
Coming Soon — memories.stream() is not available in the current SDK release. Use memories.search() for retrieval. Streaming responses will be available in a future release.
Chats
Coming Soon — Chat methods (chats.create(), chats.sendMessage(), chats.streamMessage(), chats.getHistory()) are not available in the current SDK release. Conversational RAG with chat sessions will be available in a future release.
Users
Webhooks
Error handling
All errors are MemoryKitError with convenience properties for common checks:
Retryable errors (429, 5xx) are automatically retried with exponential backoff up to maxRetries times. You don't need to implement retry logic yourself.
Never embed API keys directly in your app binary. Use a backend proxy or fetch keys from a secure keychain. See Authentication for best practices.