Skip to content
RAG Repo

LibreTexts is among the largest open textbook libraries anywhere, built and looked after by a community of educators. It holds complete, interlinked textbooks and reference material across chemistry, biology, physics, mathematics, statistics, engineering, the humanities, and the social sciences, aimed chiefly at higher education with a layer of K-12 material. Content is arranged into "libraries" of linked pages, so a concept, its worked examples, and related ideas cross-reference one another instead of sitting in isolation.

Getting it into a RAG pipeline takes a little effort. Pages are served as HTML, many books download as PDF, and there is a batch export route for whole texts. The page-level structure is a real gift for chunking: each concept page is already a self-contained explanation, so you can usually split along existing page and section boundaries rather than chopping blindly by token count. Keep an eye on the maths, though, since many pages carry equations rendered in MathML or LaTeX that you will want to preserve or convert cleanly rather than lose.

This suits any teaching or tutoring assistant: a study companion that explains undergraduate science and maths, a homework helper, or a domain RAG system that needs clear, pedagogically written explanations rather than terse reference entries. The prose is written to teach, which tends to retrieve and summarise well.

The licence is the thing to weigh. Most content is Creative Commons Attribution-NonCommercial-ShareAlike, so you may use and adapt it for non-commercial purposes if you credit the source and release your derivatives under the same terms. The NonCommercial clause rules it out for commercial products, and ShareAlike may reach into whatever you build on top, a question that is genuinely unsettled for embeddings and derived databases. Terms also vary page to page, so check the specific book you draw from rather than assuming.

For comparison, OpenStax offers a smaller but highly polished set of CC BY textbooks that are far friendlier for commercial use, while MIT OpenCourseWare and OpenLearn add course material under their own, often non-commercial, terms. Reach for LibreTexts when sheer breadth and depth of subject coverage matter most.

educationopen-textbookscc-by-nc-sahigher-educationscience

Related sources