Google Books Ngrams
Google Books Ngrams turns millions of scanned books into frequency counts for n-grams, sequences of one to five consecutive words, tracked year by year across several centuries. You can watch how a word rises or falls in use over time, compare spellings, or study shifts in language and culture.
The data covers English and several other languages, and you can explore it through the online viewer or download the full datasets in bulk, which come to around 2.2 TB. Note that this is aggregate statistics rather than the underlying book text, so it suits language analysis and metadata features more than direct passage retrieval.
For RAG, it works well as a signal layer: dating terminology, spotting archaic vocabulary, or weighting how common a phrase is, rather than as a retrieval corpus in its own right.
Related sources
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.
Standardized Project Gutenberg Corpus (SPGC)
A research-ready version of the Project Gutenberg catalogue with consistent formatting, tidy metadata, and token counts for every book. It saves you the cleanup work, so you get uniform full-text literature ready to chunk and embed for RAG.