This repository contains a GitHub AI assistant implemented in Python, leveraging Retrieval-Augmented Generation (RAG) and LangChain. This agent is designed to help users interact with GitHub repositories by retrieving and summarizing information such as issues, pull requests, and more.
- Features
- Prerequisites
- Installation
- Usage
- Project Structure
- Example
- Contributing
- License
- Acknowledgments
- Contact
- GitHub Repository Interaction: Select a GitHub repository and retrieve information such as open issues, pull requests, or file contents.
- Issue Summarization: Summarizes issues for better understanding and quicker decision-making.
- Retrieval-Augmented Generation (RAG): Combines information retrieval with generative AI for precise and context-aware responses.
- LangChain and Hugging Face Integration: Uses LangChain for efficient chaining of multiple language model queries and Hugging Face models for generative responses.
- Poetry Dependency Management: Simplifies dependency management and project setup.
Before you begin, ensure you have the following installed on your system:
- Python 3.8 or higher
- Poetry (for dependency management)
- Clone the repository:
git clone https://github.com/sakhileln/GitHub-Agent.git cd GitHub-Agent/
- Install dependencies using Poetry:
poetry install
- Activate the virtual environment:
poetry shell
-
Ensure you have access to the GitHub repository you wish to analyze and have a GitHub personal access token (PAT) with appropriate permissions.
-
Configure your environment by adding the GitHub token:
export GITHUB_TOKEN=your_personal_access_token
-
Run the AI assistant:
python main.py
-
Select a repository and interact with the AI agent to retrieve and summarize data.
Example commands:
- "Summarize the open issues in this repository."
- "List the pull requests and their statuses."
main.py
: The entry point of the application.retriever.py
: Handles interactions with the GitHub API and retrieves repository data.summarizer.py
: Uses LangChain and Hugging Face models to generate summaries from retrieved data.pyproject.toml
: Poetry configuration file for dependencies.README.md
: Documentation for the project.
To get a quick sense of how it works, try the following after running the script:
- Select a GitHub repository.
- Ask the assistant to summarize open issues.
Example Query:
Summarize the open issues in this repository.
Example Response:
There are 5 open issues:
1. Bug in the login flow causing 500 errors (critical).
2. Feature request: Add dark mode support.
...
Contributions are welcome! If you'd like to contribute. See the CONTRIBUTING file for details.
- Fork the repository.
- Create a new branch for your feature/bug fix:
git checkout -b feature/YourFeature
- Make your changes and test thoroughly.
- Submit a pull request explaining your changes.
This project is licensed under the GPL v3.0 License. See the LICENSE file for details.
- LangChain: For providing robust tools to handle language model operations.
- Hugging Face: For providing versatile and high-quality machine learning models.
- GitHub: For offering a robust platform for collaboration and version control.
- Sakhile III
- LinkedIn Profile
- GitHub Profile