Create a robust Retrieval-Augmented Generation (RAG) index of large GitHub repositories filtered by topic, and interactively chat with them using OpenAI's file search and a Streamlit interface.
This prototype contains scripts to pull GitHub repositories by topic, render them as HTML, index them using OpenAI's file search (RAG), and interact with them via a Streamlit chat interface.
$ python rendergit-topic.py machine-learning
Rendering repository: tensorflow/tensorflow ...
Rendering repository: pytorch/pytorch ...
$ python openai-file-search.py
Creating RAG index for 2 repositories ...rendergit-topic.py: Takes a GitHub Topic as a CLI argument and callsrendergiton each repo - turning each repo into a potentially large (>100MB) HTML file.openai-file-search.py: Creates a RAG index of all of these files using OpenAI. This can take a substantial amount of time for a large topic.rag-chat-multi.py: A familiar Streamlit chatbot UI. Automatically connects to an OpenAI file search (RAG) ID if available. Supports file uploads, specification of the API key and model selection. Has some quirks.
- Python 3.x
- OpenAI API Key
rendergittool- Required Python libraries:
streamlit,openai(and any other dependencies used in the scripts).
Note
Ensure you have an active OpenAI API key with access to file search (Assistants API).
To use this project, run the scripts in the following order:
- Render repositories by topic:
python rendergit-topic.py <topic>
- Create the RAG index:
python openai-file-search.py
- Start the Streamlit chat UI:
streamlit run rag-chat-multi.py
If you encounter any bugs, have feature requests, or need assistance troubleshooting your RAG setup, please open an issue in this repository.
Contributions are always welcome! Whether it's adding new models, optimizing the Streamlit UI, or improving repository parsing, your help is appreciated.
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project is distributed under the MIT License. See the LICENSE file for more information.