A production-ready Telegram chatbot that uses a Retrieval-Augmented Generation (RAG) API for answering user queries.
- Handles /start, /help, and chat messages
- Integrates with a RAG API for intelligent responses
- Supports file uploads and advanced features (see API docs)
- Production-ready: error handling, logging, config via .env
-
Clone the repo and enter the directory:
git clone <repo-url> cd telegram_bot
-
Create and edit your
.envfile:TELEGRAM_BOT_TOKEN=your-telegram-bot-token-here RAG_API_URL=http://localhost:8000/text
-
Install dependencies:
pip install -r requirements.txt
-
Run the bot:
source env/Scripts/activate python -m bot.main
See structure.md for a detailed breakdown.
See api_doc.md for backend API endpoints.
- Make sure your RAG API is running and accessible at the URL specified in
.env. - For production, use a process manager (e.g., systemd, pm2, Docker) and secure your environment variables.