Skip to main content

Rollup

static let String
The SDK’s version, such as "0.2.0".
@MainActor static func
Registers the background processing task that keeps the index up to date (<bundle ID>.rollup.update). Call it before your app finishes launching, as iOS requires. It does nothing if your Info.plist does not permit that identifier.
@MainActor static func throws
Sets up the SDK with your app’s publishable key and what to index. Calling it again changes the options; the index follows them. Until the person grants Photos access, it contacts no server and downloads nothing. Once access is granted, the first index starts: it registers the device, checks the key and downloads the models.Throws simulatorUnsupported in the Simulator, notConfigured for a key that is not rk_live_ and 32 letters and digits (surrounding whitespace is trimmed), and missingRequirement naming each missing Info.plist entry. It cannot check for the App Attest capability: a missing capability shows when the device first registers, as appAttestFailed.
@MainActor static let RollupClient
The client for every other call.
static var JSONEncoder
Encodes SDK results with ISO 8601 dates and sorted keys.
static var JSONDecoder
Decodes SDK results with ISO 8601 dates.

RollupClient

Use it through Rollup.shared. Every method except requestPhotoAccess throws notConfigured before configure, and accessRevoked while your app’s access is stopped. search, query and profile throw photoAccessDenied while Photos access is denied or restricted.
Indexing
Indexing’s state and control. See Indexing.
async -> PhotoAccess
Shows iOS’s Photos prompt, once. If the person grants access, the first index starts at once and continues in the background. Returns the person’s answer, including denied and restricted; it does not throw.
async throws -> SearchResults
Searches the index on the iPhone: dates, places, media, and what photos show or say. Most relevant first. Returns limit results from offset: 500 from the first by default; nil returns all of them. totalCount counts every match. Throws noIndex when nothing is indexed yet. See Search.
async throws -> SearchResults
search, keeping only photos with every one of people in them (Person.id), then applying limit and offset.
async throws -> [Person]
The people whose faces are in the person’s photos, most photos first. People in only one photo are left out unless includeAll. Empty with people off. Photos with sensitive content are left out. See Person.
async throws -> [SearchResult]
Every photo with that person’s face in it, newest first, without sensitive photos.
async throws -> [Interest]
What the person does, from their camera roll, scored against a typical adult. window .now (the default) returns active and emerging interests; .lifetime adds lapsed ones. includeAll returns every activity, typical ones too. See Interest.
[ActivityNode]
Rollup’s activity taxonomy: every activity that SearchResult.activities and interests use. See ActivityNode.
async throws -> Answer
Answers a question about the person’s life from the index. The model runs on Rollup’s server; its tools run on the iPhone, and only their text results leave it. See Query.
AsyncThrowingStream<QueryUpdate, Error>
query, as it happens: what the agent is looking at, the answer as it is written, then the answer, which ends the updates. Throws what query throws; ending the iteration cancels the question. See QueryUpdate.
async throws -> Profile
Fills a JSON Schema about the person from the index: the schema’s shape exactly, null where their life does not say, with the photos behind each filled field. Takes the schema as JSON Data or as a JSONValue. See Profile.
async throws -> [Facet]
The index’s largest groups (labels, kinds of place, cuisines and food), largest first, each with its count and a few photos. One call stands for a search per group. limit defaults to 16 (up to 64), samples to 4 (up to 32). Sensitive photos and screenshots are not counted. It can trail the latest batch by a moment. Throws noIndex when nothing is indexed yet. See Facet.
async throws
Deletes the index and everything derived from the library. Keeps the downloaded models and place data, the device registration, the options and a pause. Indexing under way stops first. No new index starts until indexing.start(), indexing.resume() or the next launch.
async throws
Deletes everything the SDK keeps: the index, downloaded models and place data, queued run reports, the device credential, and the device’s record on Rollup’s server. No new index starts until indexing.start(), indexing.resume() or the next launch. To index again without downloading the models again, use deleteIndex().

Indexing

Use it through Rollup.shared.indexing.
IndexingState
Where indexing is now. See IndexingState.
AsyncStream<IndexingState>
The current state, then every change after it.
AsyncStream<IndexedBatch>
The photos each part of a run makes searchable, as it does, from now on. See IndexedBatch.
func
Starts indexing now, or brings the index up to date, and lets it continue in the background with the system progress UI. Call it from a person’s action, such as a tap. A run that is already under way gains background continuation.
func
Pauses indexing until resume(). A run under way stops, and what it finished stays searchable. Nothing is indexed, on screen or in the background, not even new photos. The pause lasts across launches, and reset() ends it. While paused, start() does nothing.
func
Ends a pause and starts indexing as start() does. Call it from a person’s action, such as a tap.
Bool
Whether indexing is paused.
IndexOptions
What to index. Setting it changes the index in place on the next run, which starts shortly. See Index options.

PhotoAccess

The person’s answer to the Photos prompt. With limited, the SDK indexes only the photos the person selected.