Skip to content

reginanka/AI-Universal-Summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📝 AI Universal Media Summarizer Bot

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!

✨ Features

  • 📄 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.

🚀 Tech Stack

  • 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.

📋 Requirements

fastapi>=0.115.0
sqlalchemy>=2.0.35
psycopg2-binary>=2.9.9
requests>=2.32.3
beautifulsoup4>=4.12.3
lxml>=5.1.0

🌐 Deploying on Vercel

1. Project Preparation

Ensure the following files are present in the root directory:

  • api/index.py - Core bot logic (Vercel serverless function endpoint)
  • requirements.txt - Python dependencies
  • vercel.json - Vercel configuration file

2. Configure Environment Variables

Go to Settings > Environment Variables and add the following keys:

  • TELEGRAM_TOKEN = your_telegram_bot_token
  • CEREBRAS_API_KEY = your_cerebras_api_key
  • DATABASE_URL = postgresql://user:password@host:port/database
  • ACCESS_CODE = your_secret_access_code
  • SUPADATA_API_KEY = your_supadata_api_key
  • APIFY_API_TOKEN = your_apify_api_token

3. Vercel Deployment Steps

  1. Push your code to a GitHub repository.
  2. Log in to Vercel and import your repository.
  3. Click Deploy.

4. Setup Telegram Webhook

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"}'

⚙️ Local Development

1. Clone & Install

git clone <repository-url>
cd Sum_AIbot
pip install -r requirements.txt

2. Configure .env

Create a .env file in the root directory and fill in all variables from step 2 (including Supadata and Apify keys).

3. Run Locally

uvicorn api.index:app --reload --port 8000

🗄️ Supabase Setup

The server application will automatically create the required user_data table upon its first database connection. You only need to provide the DATABASE_URL.

📱 Bot Usage

Commands

  • /start - Start the bot and select a language.
  • /help - View instructions and available actions.

Workflow Example

  1. You share a TikTok or YouTube link.
    • Bot: 📄 Processing content...
    • Bot: 📄 Summary: [concise summary of video content]
  2. You ask: "What was the main topic of the video?"
    • Bot: 💡 The speaker discussed...

🔒 Security Practices

  • Keep your .env tokens private and never commit them.
  • Use ACCESS_CODE to restrict bot usage to authorized users only.

📄 License

This project is licensed under the MIT License - feel free to use and modify it!


👤 Developer & Socials

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!

Rehina Nanaka profile views

About

High-speed Telegram bot powered by FastAPI & Cerebras AI. Instantly summarizes YouTube, TikTok, articles, and social media posts with a built-in context-aware Q&A mode. ⚡️

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages