Google Books Ngrams
Google Books Ngrams takes one of the largest digitised book collections ever scanned and reduces it to something far smaller and more focused: frequency counts. For every n-gram, a run of one to five consecutive words, it records how many times that string appeared in print in a given year, going back several centuries across English and a number of other languages. The full set of tab-separated (`TSV`) files comes to roughly 2.2 TB.
There are two practical ways in. The viewer at books.google.com/ngrams is ideal for quick exploration and the familiar frequency-over-time curves. For real work you download the bulk files, which are split by n-gram length and opening letters, so you can take only the slices you need instead of the whole 2.2 TB. Every row carries the n-gram, the year, a match count, and a volume count, which loads neatly into a columnar engine like DuckDB or a plain database.
The key thing to grasp is that this is aggregate statistics, not book text. You cannot pull a passage out of it, so it is a signal layer rather than a retrieval corpus. Use it to date when a term entered common use, flag anachronistic or archaic vocabulary, weight how common a phrase is, or add time-aware features to a system answering questions about how language and ideas have shifted.
Licensing is friendly: the data is released under CC BY 3.0, so commercial use is fine as long as you credit Google Books Ngrams. Keep the well-known caveats in view, though. Optical character recognition mistakes inflate counts in older scans, the mix of books changes across decades (scientific titles surge through the twentieth century), and pre-1800 coverage is thin and noisy.
If you need the actual text of old books to retrieve and quote, reach for Project Gutenberg or HathiTrust; keep Ngrams for the quantitative, linguistic side of a project.
Related sources
Institutional Books 1.0
A 242 billion token dataset of roughly 983,000 public-domain volumes digitised from Harvard Library's collections, spanning more than 250 languages, with both raw and post-processed OCR text plus rich bibliographic metadata.
LibriVox
A volunteer project providing free public domain audiobooks. Volunteers record themselves reading works whose copyright has expired, which makes it a handy source of speech data for training speech-to-text models and building multimodal RAG.
Open Library
An Internet Archive project building a web page for every book ever published. It holds more than 20 million catalogue records and lends many titles digitally, making it a rich source of book metadata for RAG systems.
Project Gutenberg
A volunteer effort to digitise and archive public domain books, with more than 70,000 free ebooks. Mostly English, but it covers many languages. One of the oldest digital library projects, so it is a clean, permissively licensed source of full-text literature for RAG.