Every draft in one row
Twenty megabytes of a document's edit history squeezed into 80 kilobytes inside a single database row, in a prototype an AI model built unattended from a one-sentence prompt.
Simon Willison had the idea on a dog walk. Keep a document's current text in a normal database column, and pack every earlier version into one compressed block in the same row, so the whole edit history rides along with the document itself. He typed a single sentence to OpenAI's GPT-5.6 Sol Pro asking it to build prototypes around the idea, and left it running. Thirty-eight minutes later it returned working code for SQLite, the small database that ships inside phones, browsers and most desktop apps, along with a benchmark harness, seven passing tests and a written report. A thousand successive revisions of a 20,000-character document, 20.4 MB of raw history, sat in 80.3 KB.
An unattended run that only reports its win is a demo. This one reported where the win disappears.
It packs down that far because consecutive saves are nearly identical, so the compressor spends almost all its output on the handful of characters that actually changed. The benchmark also makes the cost plain: every save rewrites the entire compressed block, so a single save takes about 50 milliseconds against 0.06 for the plain one-record-per-version approach. The fix in the report is a bookbinder's move. Seal the history into a finished block every 128 revisions and start a fresh one. Storage rises by roughly a third, to 109.9 KB, and a save drops to 2.2 milliseconds.
The number worth keeping is further down, where the same code runs on edits that are not incremental. Replace a tenth of the document on every save and the store swells to 1.6 MB. Make every save an unrelated document and it reaches 16 MB, no saving at all. Storage here tracks how much genuinely new text each save introduces, not how many saves there are. All of it is the model's own synthetic benchmark, not yet re-run by anyone else, and the code is exploratory. But the shape of the bet is now legible: this design is a wager that your users type rather than paste, and the benchmark says what that wager is worth.
The report sitting next to the code is the fastest way in; skip to the sensitivity table, where the 250-fold saving thins out row by row as the edits get less incremental.
Open the repo at github.com →The lenses
The facts
Concepts
How this connects
Tap a node to open it