Contact: @Konstantin_vanov
A Telegram bot for Q&A about articles using Retrieval-Augmented Generation. Indexes web content and PDF files, then provides accurate answers with sources.
- Features
- Quick Start
- Docker Deployment
- Traditional Installation
- Usage Examples
- Troubleshooting
- Contributing
- Web Article Processing - Index content from URLs β
- YouTube Video Processing - Download and transcribe YouTube videos β
- Multilingual Support - English/Russian interfaces β
- Q&A System - Ask questions about indexed content β
- Text Summarization - Generate key points summaries β
- PDF File Support - Upload and process PDF documents β
- TXT File Support - Process text files directly β
- No Request Limits - Unlimited questions and processing β
- Custom Prompts - Adjust AI behavior and responses β
- Python 3.9+ or Docker
- Telegram Bot Token
- OpenAI API Key
The easiest way to deploy with all dependencies included:
# Clone the repository
git clone https://github.com/Konstantin-vanov-hub/Article-Assistant--RAG-Telegram-Bot.git
cd Article-Assistant--RAG-Telegram-Bot
# Configure environment variables
cp .env.example .env
# Edit .env with your Telegram Bot Token and OpenAI API Key
nano .env
# Build and start the containers
docker-compose up -d --build
# View logs to verify everything is working
docker-compose logs -f telegram-bot| Command | Description |
|---|---|
docker-compose up -d --build |
Build and start in background |
docker-compose down |
Stop and remove containers |
docker-compose logs -f telegram-bot |
Follow bot logs |
docker-compose restart telegram-bot |
Restart only the bot |
git clone https://github.com/Konstantin-vanov-hub/Article-Assistant--RAG-Telegram-Bot
cd Article-Assistant--RAG-Telegram-Bot
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
pip install -r requirements.txtcp .env.example .envCreate a .env file with:
TELEGRAM_TOKEN=your_telegram_bot_token_here
OPENAI_API_KEY=your_openai_api_key_herepython RAG_bot/bot_main.py- Upload a PDF: Send a PDF file to the bot
- Process YouTube Videos: Enter a YouTube URL to download and transcribe
- Ask questions: Type your question after indexing
- Get summaries: Use the "Summary" button for key points
- Change language: Use the language button to switch between English/Russian
The bot can now process YouTube videos! Here's how:
- Click "πΉ Process YouTube Video" in the main menu
- Paste a YouTube video URL
- The bot will:
- Download the video audio
- Transcribe it using OpenAI Whisper
- Index the transcript for Q&A
- Ask questions about the video content
- Get summaries of the video
Supported formats: YouTube URLs (youtube.com, youtu.be) Limitations: Videos up to 2 hours maximum
- Bot not responding: Check if all environment variables are set correctly
- Indexing fails: Ensure OpenAI API key is valid and has sufficient credits
- File upload issues: Check file size limits (max 10MB for files)
- Vector store errors: Delete
faiss_indexfolder and re-index your content - YouTube processing fails:
- Ensure video is not longer than 2 hours
- Check if the YouTube URL is valid and accessible
- Verify Whisper model is properly installed
- Check available disk space for temporary files
- Check the logs:
docker-compose logs -f telegram-bot - Verify environment variables are loaded
- Ensure OpenAI API key has sufficient credits
We love contributions! Please read our Contributing Guide to learn how you can help improve this project.
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/improvement) - Open a Pull Request
MIT License Β© 2025 Konstantin. See LICENSE file for details.
For assistance, please:
- Search existing issues
- Open a new issue with detailed information
- Contact @Konstantin_vanov on Telegram




