Stack Exchange Data Dump
Stack Exchange publishes a full export of its network as `XML` files, hosted on the Internet Archive. The dump covers all sites, from Stack Overflow to smaller communities on topics like maths, cooking, and law, so you can pick just the domains you need.
Each site's export includes posts (questions and answers), comments, votes, tags, badges, and user profiles. The structured voting and acceptance data is particularly useful: it lets you rank answers by how the community rated them, which is a strong quality signal when you are selecting passages to retrieve.
For RAG, this is a go-to source for technical question answering. You can pair a question with its accepted answer to build clean query-and-response pairs, or index whole threads as passages. Everything is licensed CC BY-SA 4.0, so you can reuse it as long as you attribute and share alike.
Related sources
DevDocs
An open-source aggregator that pulls API documentation for major programming languages, frameworks, and tools into one searchable place. A tidy RAG source when you want up-to-date developer reference material without scraping dozens of separate documentation sites yourself.
GitHub Public Repositories (GH Archive / GHTorrent)
Two projects that capture public GitHub activity for analysis. GH Archive records the public GitHub event timeline as downloadable hourly archives, and GHTorrent offers a queryable mirror of GitHub metadata. Together they help you mine code, issues, pull requests, and documentation at scale.
The Stack v1 / v2
A large source code dataset from the BigCode project, built from permissively licensed code on GitHub with duplicate and near-duplicate files removed. Version 2 draws from Software Heritage and covers 600+ programming languages, making it a strong base for training and retrieval in code-aware RAG systems.