Biome isn’t about biometrics, but suggestions

One of the quiet revolutions in macOS (as well as in iOS and iPadOS) over the last few years has been the way that it appears to ‘understand’ the content of unstructured data. When someone sends you a message containing a phone number or email address, that’s recognised and macOS offers it where it’s relevant to context. When you use Spotlight, macOS offers suggestions in addition to simple hits. Although these may sometimes appear irrelevant and irritating, they can also be insightful and valuable.

The sub-systems and services involved in this appear under various names, including Siri Suggestions, CSSuggestion in Core Spotlight, the suggestd daemon, and a relatively new addition Biome, which seems to have emerged as a discrete entity around macOS Catalina, and is now quite active in Monterey. This article explains what I have discovered so far about Biome, and what it isn’t.

As with many internal sub-systems not intended to be seen by the user, its name has caused confusion. When any of its processes are seen to run away in Activity Monitor, it has been assumed to be part of system biometrics. Its folder Biome in the Home library has been thought to be related to Machine Learning. It’s one of a relatively limited number of sub-systems which is fired up whenever you open an app, and its log entries there, with their references to metrics, are readily confused with the likes of RunningBoard and its life-cycle management functions.

Components

Biome consists of several executables, of which the most readily visible is /usr/libexec/biomesyncd. Others are tucked away in no less than seven PrivateFrameworks, which encompass DSL, FlexibleStorage, Foundation, PubSub, Storage, Streams and Sync, some of which correspond to entries made by Biome in the log. There are also related CoreSuggestions, SiriSuggestions and Suggestions private frameworks, all in /System/Library/PrivateFrameworks. There don’t appear to be any public frameworks devoted to these features.

Also involved is suggestd, described by its man page as the “daemon that processes user content in order to detect contacts, events, named entities, etc.” “The suggestd daemon receives content from Spotlight, Mail, Messages and various other apps in order to power various features. Those features include Found in Apps, Proactive QuickType, and Keyboard/Siri/News Personalization.”

Services are controlled by two property lists in /System/Library/LaunchAgents:

  • com.apple.BiomeAgent.plist which launches two XPC services and three Mach services for BiomeAgent;
  • com.apple.biomesyncd.plist which seems mainly concerned with sync events.

The end result are two processes, biomesyncd and BiomeAgent, normally seen in Activity Monitor.

Biome folder

Storage is most prominent in ~/Library/Biome, which contains three sub-folders:

  • DSL, with two folders, persistent and sessions, which are generally empty;
  • streams, containing public and restricted folders, each with further folders for services and features within Biome’s scope. Files stored within the restricted folder appear to be encrypted;
  • sync, containing an SQLite database named sync.

The typical total size of the Biome folder is around 150 MB, although that’s likely to rise with extensive use of Siri and related features.

Among services and features represented by folders in the Biome/streams folder are: AppLaunch, AskToBuy, ContextualActions, GameController, Notification, NowPlaying, POICategory, ReadMessage, ScreenRecording, ScreenSharing, SemanticLocation, SleepMode, UserStatusChange, and WebUsage. Restricted folders include feedbackSocialHighlights, MailContent, MessagesContent, NotesContent, PhotosPhotoView, RemindersContent, SafariPageView, SiriQuery, and ThirdPartyAppContent. Those give a good idea of the pervasive nature of Biome, and perhaps of the origin of its name.

Within each of those feature folders there can be a warren of folders and files, arranged in:

  • a local folder, containing one or more binary files, each named with its Biome serial number, together with a folder named tombstone containing expired files
  • a remote folder, containing folders named by the UUID of the device, each with an internal structure similar to the local folder
  • a lock file
  • a metadata file, a keyed archive property list.

Expired files in tombstone folders are periodically weeded.

API

The main documented interface accessible to third parties appears to be CSSuggestion, which is available in macOS 10.13 but has been extended in the Ventura beta. This has little documentation, although that explains: “Your app uses CSSuggestion objects to populate a contextual menu of suggestions.”

Activity

Watching Biome at work though its entries in the log is straightforward: use the predicate subsystem == "com.apple.Biome" to view only entries in the sub-system com.apple.Biome. Once you have identified a period of interest, you’ll probably want to view all entries over that time. Other relevant sub-systems include com.apple.proactive.ProactiveHarvesting and com.apple.suggestions, and the suggestd process. If there’s sufficient interest, I can add these as a new log extract to my utility Mints.

Launching an app triggers an event for Biome, but unless that app is intended to work with the sub-system, little happens as a result. Normally, a StreamIdentifier of AppLaunch is sent, and BiomeFoundation responds that neither the com.apple.biome.public.appLaunchEvent or com.apple.biome.streamWrites metric is in use, and a null event is written to Biome’s streams.

Biome becomes more active, and loquacious in the log, when you add content suitable for inclusion in suggestions to a supported app like Notes. Initially, this is extracted by ProactiveHarvesting through suggestd. This leads to a series of log entries from Biome of the form
0.852032 BiomeSource suggestd BiomeStreams StreamIdentifier=NotesContent
0.852121 BiomeMetrics suggestd BiomeFoundation Metric not in use: com.apple.biome.streamWrites
0.852259 BiomeCompute BiomeAgent BiomeStreams Processing new event write for stream <private> subscription count: 0, event: (null)
0.852261 BiomeSource BiomeAgent BiomeStreams StreamIdentifier=<private>
0.852430 BiomeStorage suggestd BiomeStorage Successfully mapped file: 657726758893521
0.852758 BiomePubSub suggestd BiomePubSub <private> - completion
0.852765 BiomeStream suggestd BiomeStreams <private> - get new store bookmark for stream: NotesContent

At the end that, the extracted content is saved in the file named 657726758893521, its Biome ID, in the path ~/Library/Biome/streams/restricted/NotesContent/local. As that’s within the restricted folder, its contents appear to be encrypted to preserve privacy.

Troubleshooting

Biome and its related systems appear robust and seldom seem to cause problems. There have been sporadic reports of those running away with high CPU % values shown in Activity Monitor, and of ~/Library/Biome becoming very large. Restarting should cure the former, but even starting up in Safe mode may not address the latter, as the tombstone and other folders aren’t treated as a cache, but maintained by Biome itself. As a last-ditch measure, deleting the contents of the Biome folder shouldn’t result in any data loss.

Summary

  • Biome has nothing to do with biometrics, but is a sub-system responsible for compiling contextual suggestions.
  • It’s almost completely hidden from the user, and only now starting to become accessible to third-party developers.
  • It extracts recognise content from supported apps for use elsewhere, including in suggestions.
  • Content extracted from sources containing potentially private material appears to be encrypted to preserve privacy.
  • Its activity can be traced in the log by the sub-system com.apple.Biome.
  • Problems appear unusual, and most should be rectified by restarting.

I welcome the correction of any errors that I have made, please.