A LINE chatbot that uses Retrieval-Augmented Generation (RAG) to answer questions based on documentation stored in GitHub repositories.
Users can ask questions through LINE, and the bot retrieves relevant documentation from GitHub before generating a response with Google Gemini.
- GitHub Integration: Loads documentation from GitHub repositories.
- Document Retrieval: Retrieves relevant content based on user questions.
- Question Answering: Uses Google Gemini to generate answers from retrieved documentation.
- LINE Integration: Allows users to interact with the bot through LINE.
- Conversation History: Keeps track of previous messages for follow-up questions.
- Language: Python
- Backend: FastAPI
- Chat Platform: LINE Messaging API
- LLM: Google Gemini
- Architecture: Retrieval-Augmented Generation (RAG)
- Document Source: GitHub
github-docs-linebot/
├── app.py # FastAPI application and LINE webhook
├── rag_engine.py # RAG pipeline and LLM integration
├── github_loader.py # Loads documentation from GitHub
├── requirements.txt # Python dependencies
└── README.md
- Python 3.10 or later
- A LINE Messaging API channel
- A Google Gemini API key
- A GitHub account and access token
git clone https://github.com/p0tat0ba11/github-docs-linebot.git
cd github-docs-linebotpython -m venv venvActivate the environment:
Windows
venv\Scripts\activateLinux / macOS
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
LINE_CHANNEL_ACCESS_TOKEN=your_line_channel_access_token
LINE_CHANNEL_SECRET=your_line_channel_secret
GOOGLE_API_KEY=your_google_api_key
GITHUB_OWNER=your_github_username
GITHUB_REPO=your_repository_name
GITHUB_TOKEN=your_github_token
GITHUB_DIR_PATH=your_documentation_directoryReplace the placeholder values with your own credentials and repository information.
Note: Do not commit your .env file or expose your API keys and access tokens.
uvicorn app:app --host 0.0.0.0 --port 8000The application runs at:
http://localhost:8000
Set your LINE Messaging API webhook URL to:
https://your-domain.com/callback
Replace the domain with your application's public HTTPS URL.
Enable Use webhook in the LINE Developers Console and verify the connection.
For local development, use an HTTPS tunneling service to expose your local application.
- Deploy the bot to a public cloud hosting service.
- Improve document retrieval and indexing.
- Store conversation history persistently.
- Improve webhook processing and message handling.
- Add monitoring and usage statistics.
If you use, modify, or redistribute this project, please acknowledge the original project:
- Project: GitHub Docs LINE Bot
- Author: p0tat0ba11
- Repository: github-docs-linebot
Please retain the original copyright and license notice when redistributing this project.
If you build upon this project, a link to the original repository and credit to the original author are appreciated.
This project is licensed under the MIT License.