The Unified Intelligence Subsystem
When you take a photo of a dog on your iPhone, and then search for “Dog” in the Photos app on your Mac, macOS instantly finds the picture. When you receive a text message from a friend saying “I moved to 123 Main St,” macOS intelligently offers to update their Contact Card. This seamless, cross-device aggregation of personal data is powered by the CoreKnowledge framework, driven by the knowledge-agent daemon.
The CoreKnowledge daemon sits in the background and acts as a massive graph database. It ingests data from Siri, Photos, Contacts, Safari, and Messages, building complex relationships between entities (e.g., mapping a phone number to a face, and mapping that face to a location). It synchronizes this highly personalized graph database across all your Apple devices via iCloud.
However, if the local SQLite graph database becomes corrupted—which frequently happens if the Mac loses power during an iCloud synchronization, or during a major macOS version upgrade—the symptoms are incredibly frustrating. The Photos app will refuse to identify any faces, searching for text inside images (Live Text) will fail silently, and the knowledge-agent process in Activity Monitor might consume 100% of a CPU core as it endlessly attempts to repair the broken database indices. To fix this, you must forcefully obliterate the CoreKnowledge cache via the Terminal.
Locating the Knowledge Graph
Because CoreKnowledge handles your most intimate personal data, the graph database is heavily encrypted and isolated strictly within your specific user profile. It is located deep inside the CoreData containers.
Purging the Cache via Terminal
While this data lives in your user profile, using elevated (sudo) privileges ensures we can forcefully terminate the locked daemon and bypass any strict Sandbox permissions Apple places on the SQLite files.
- Open the Terminal application.
- First, you must aggressively terminate the CoreKnowledge agent. This instantly stops the runaway CPU usage and releases the file locks on the graph database:
sudo killall knowledge-agent
Press Enter, type your Mac’s administrator password (the characters will remain invisible), and press Enter again.
- Next, navigate into the user Library and completely delete the Knowledge graph database directory. We use the
-rfflag to recursively delete the folder without asking for confirmation:
rm -rf ~/Library/Application\ Support/Knowledge
- Additionally, you must clear the specialized CoreDuet telemetry caches, as they feed raw behavioral data into the CoreKnowledge engine:
rm -rf ~/Library/Application\ Support/com.apple.coreduet/*
The Graph Reconstruction
macOS relies on launchd to ensure background daemons are always running. The moment you executed the killall command, the operating system realized the knowledge-agent had died and immediately respawned a fresh, uncorrupted instance of it.
This new daemon will boot up, look for the ~/Library/Application Support/Knowledge folder, realize the database has been annihilated, and generate a completely fresh, 0-byte SQLite graph.
What happens next? Over the next 24 to 72 hours (only when the Mac is plugged into power and idle), the CoreKnowledge daemon will quietly reach out to iCloud and begin re-downloading your entity relationships. It will re-index your Photos library and rebuild the connections between your Contacts and Messages. During this reconstruction phase, facial recognition in Photos might temporarily disappear, but the underlying system stability will be completely restored without the crippling CPU overhead of a corrupted database.