A powerful Telegram bot designed to instantly summarize articles, YouTube videos, TikToks, and social media posts, then answer questions about their content using advanced AI. Let artificial intelligence handle long reads and long videos for you!
- 📄 Article Summaries - Send a link to any website and receive a concise summary.
- 📹 Video Insights - Integrated support for YouTube, TikTok, and Instagram Reels (transcripts and metadata).
- 💬 Social Media & Notion - Scrape and summarize Facebook, Instagram, and Notion pages.
- 💬 Post Analysis - Forward any Telegram post to generate a quick summary.
- 📝 Text Processing - Send long texts (>500 characters) to be summarized instantly.
- ❓ Q&A Mode - Ask questions about the content and get accurate answers based on its context.
- 🧠 Contextual Memory - The bot remembers previous questions and answers during the conversation.
- 🌐 Multilingual Interface - Fully supports both English and Ukrainian languages.
- 💾 Persistent Storage - Securely stores user data in a Supabase PostgreSQL database.
- FastAPI - High-performance web framework for webhook handling.
- SQLAlchemy - Robust ORM for database interactions.
- Supabase (PostgreSQL) - Scalable cloud database solution.
- Cerebras AI API - Ultra-fast LLM processing (powered by
llama3.1-8b). - Supadata API - For high-quality YouTube/TikTok/Reels transcripts.
- Apify API - For scraping protected social media and JS-heavy sites (FB, Insta, Notion).
- Jina AI Reader - Intelligent fallback for complex article rendering.
- BeautifulSoup4 - Efficient HTML parsing and text extraction.
fastapi>=0.115.0
sqlalchemy>=2.0.35
psycopg2-binary>=2.9.9
requests>=2.32.3
beautifulsoup4>=4.12.3
lxml>=5.1.0Ensure the following files are present in the root directory:
api/index.py- Core bot logic (Vercel serverless function endpoint)requirements.txt- Python dependenciesvercel.json- Vercel configuration file
Go to Settings > Environment Variables and add the following keys:
TELEGRAM_TOKEN=your_telegram_bot_tokenCEREBRAS_API_KEY=your_cerebras_api_keyDATABASE_URL=postgresql://user:password@host:port/databaseACCESS_CODE=your_secret_access_codeSUPADATA_API_KEY=your_supadata_api_keyAPIFY_API_TOKEN=your_apify_api_token
- Push your code to a GitHub repository.
- Log in to Vercel and import your repository.
- Click Deploy.
Once deployed, run this in your terminal:
curl -X POST "https://api.telegram.org/bot<YOUR_TELEGRAM_TOKEN>/setWebhook" \
-H "Content-Type: application/json" \
-d '{"url": "https://your-project.vercel.app/webhook"}'git clone <repository-url>
cd Sum_AIbot
pip install -r requirements.txtCreate a .env file in the root directory and fill in all variables from step 2 (including Supadata and Apify keys).
uvicorn api.index:app --reload --port 8000The server application will automatically create the required user_data table upon its first database connection. You only need to provide the DATABASE_URL.
/start- Start the bot and select a language./help- View instructions and available actions.
- You share a TikTok or YouTube link.
- Bot: 📄 Processing content...
- Bot: 📄 Summary: [concise summary of video content]
- You ask: "What was the main topic of the video?"
- Bot: 💡 The speaker discussed...
- Keep your
.envtokens private and never commit them. - Use
ACCESS_CODEto restrict bot usage to authorized users only.
This project is licensed under the MIT License - feel free to use and modify it!
Designed and developed by Gearberry — available for custom ecosystem architecture and high-performance web development. Feel free to connect with me:
⭐ Enjoying the project? Please consider starring the repository!