_CoreSpotlight_FoundationModels is a cross-import overlay that lets foundation models search and reason over your app's Spotlight-indexed content. Expose indexed data to a model by configuring a CoreSpotlightSource, FileSource, or SearchSource, and drive queries through a SpotlightSearchTool that returns ScoredSearchableItem and SearchTextResult values. Build a search pipeline from these stages using types such as SearchPipelineData, SearchResultsTable, and SearchStatistic, and resolve entities and content types with protocols like ContactResolver and UTTypeResolutionStrategy. Available on iOS, macOS, and visionOS.
Indexed Content Sources 3
Expose your app's Spotlight-indexed, file-based, and search-derived content to a foundation model.
- StCoreSpotlightSourceA search source that retrieves data from the app’s Spotlight index.
- StFileSourceA search source that retrieves indexed metadata from files and directories visible to Spotlight.
- StSearchSourceA source of data for Spotlight to search.
Searching with the Model 4
Drive model-issued queries over your indexed content and receive scored, text-bearing results.
- StSpotlightSearchToolA tool you use to make your app’s custom data available to Foundation Models.
- StScoredSearchableItemA searchable item paired with a caller-assigned relevance score.
- StSearchTextResultLLM-generated text summary or analysis from a pipeline stage.
- StSearchCountA scalar count result (e.g., "47 emails from John").
Search Pipeline 5
Compose and stage the search pipeline that processes content into result tables and statistics.
- PrCustomStageA custom processing stage in a Spotlight search pipeline.
- StSearchPipelineDataThe value that flows between pipeline stages, carrying a typed payload.
- EnSearchPipelineDataTypeDeclares the kind of data a pipeline stage accepts or produces.
- StSearchResultsTableTabulated result data — rows with typed columns for display or spreadsheet export.
- StSearchStatisticA scalar statistic derived from search results (sum, average, max, min, median, stddev).
Contact Resolution 2
Resolve people referenced in indexed content into concrete contact values.
- PrContactResolverResolves the current user's identity for search queries involving people.
- StResolvedContactContact information used to match person and organization references in search queries.
Uniform Type Resolution 3
Resolve and classify the uniform type identifiers of indexed content.
- PrUTTypeResolutionStrategyProtocol for pluggable UTType resolution strategies
- ClUTTypeHierarchyStrategyStrategy for resolving UTTypes by walking the LaunchServices type hierarchy using BFS traversal
- StUTTypeResolutionResultResult of a UTType resolution operation with confidence metrics and context