GitHub Public Repositories (GH Archive / GHTorrent)
GH Archive records every public event on GitHub, such as pushes, forks, issues, and pull requests, and packages them into hourly archives you can download as JSON. It goes back to 2011 and is often loaded into BigQuery for large queries across the whole timeline.
GHTorrent (https://ghtorrent.org) takes a different angle, providing a relational mirror of GitHub's metadata: users, repositories, commits, issues, and the links between them. It is handy when you want to query relationships rather than replay a stream of events.
For RAG, these are less about raw code and more about the conversation around it. Issue threads, pull request discussions, and commit messages give you natural language context that pairs well with a code corpus. Note the content sits under each repository's own licence, and use is subject to GitHub's terms of service.
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.
Stack Exchange Data Dump
Periodic XML dumps of every site in the Stack Exchange network, including Stack Overflow. Each dump holds questions, answers, comments, votes, and user profiles. One of the richest question-and-answer datasets you can freely download, and a natural fit for building technical support and developer RAG systems.
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.