explaingit

fenxer/macos-summarize-internals

Analysis updated 2026-07-25

0PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

A Python reimplementation of macOS's built-in text Summarize feature, which uses an old-school search-engine technique, scoring sentences by similarity to the whole document, to pick the top sentences. It matches Apple's output almost perfectly.

Mindmap

mindmap
  root((repo))
    What it does
      Rebuilds macOS summarize
      Scores sentences vs document
      Picks top sentences
    How it works
      No neural network
      Search index technique
      Logarithmic summary length
    Tech stack
      Python reimplementation
      C probe programs
      Comparison test scripts
    Key findings
      No stopword removal
      Numbers split at decimals
      Ties favor later sentence
    Use cases
      Replicate macOS summarize
      Learn reverse engineering
      Build text summarization

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Recreate macOS's Summarize feature in your own app using the Python script.

USE CASE 2

Learn how Apple's sentence-scoring summarization algorithm works under the hood.

USE CASE 3

Run the included comparison tests to verify the Python version against the real macOS tool.

USE CASE 4

Study the reverse-engineering probes to understand how to probe macOS system frameworks.

What is it built with?

PythonCmacOS SearchKit

How does it compare?

fenxer/macos-summarize-internals0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity3/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a Mac to run the C programs that call the real macOS SearchKit API for ground-truth comparison.

In plain English

When you select text on a Mac and right-click to choose "Summarize," macOS gives you back a shorter version of that text. This repository figures out exactly how that works under the hood. The author reverse-engineered the system component called SKSummary, which lives inside Apple's SearchKit framework, and then rebuilt the same algorithm in Python. The Python version produces output that matches the real macOS tool almost perfectly across a set of 12 test files, with 9 byte-identical matches and 2 others differing only in tiny floating-point noise. The big finding is that macOS summarization is not a neural network or any modern machine learning model. It is an old-school search engine technique. The system splits your text into sentences, builds a search index over them, then treats the entire document as a search query against that index. Each sentence gets a score based on how similar it is to the whole document, and the top-scoring sentences become the summary. The default summary length is based on a logarithmic formula, and the slider in the UI simply switches to a percentage of total sentences. The README documents many specific quirks the author discovered through probing. There is no stopword removal and no stemming. Numbers like "3.5" get split into "3" and "5" at the decimal point. Email addresses split at the @ symbol but the domain stays intact. Sentence segmentation is particular about periods followed by lowercase letters, and Chinese punctuation marks always trigger a break. When sentences tie in score, the later one ranks higher. The repository includes the Python reimplementation, C programs that call the real macOS system API to dump ground-truth data, a comparison script that checks the Python version against the system, and a folder of probes and experiments from the reverse-engineering process. A full write-up in both English and Chinese tells the story from disassembly through verification. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using the algorithm from this repo, write a Python function that summarizes a given text by scoring each sentence's similarity to the entire document and returning the top-scoring sentences.
Prompt 2
Help me add a custom summary length to this repo's Python summarizer. Instead of the default logarithmic formula, let me specify a percentage of total sentences.
Prompt 3
Run the comparison script from this repo against my own text file and explain why the Python output might differ from the macOS Summarize output by floating-point noise.
Prompt 4
Explain how this repo's C programs call the macOS SearchKit API to dump ground-truth summarization data, and how I can compile and run them on my Mac.

Frequently asked questions

What is macos-summarize-internals?

A Python reimplementation of macOS's built-in text Summarize feature, which uses an old-school search-engine technique, scoring sentences by similarity to the whole document, to pick the top sentences. It matches Apple's output almost perfectly.

What language is macos-summarize-internals written in?

Mainly Python. The stack also includes Python, C, macOS SearchKit.

How hard is macos-summarize-internals to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is macos-summarize-internals for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.