A Discord bot that processes URLs, extracts content, generates AI-powered summaries, and provides personalized research assistance with comprehensive search functionality.
- URL Processing: Automatically process URLs from ArXiv, GitHub, YouTube, Hugging Face, Reddit, and general web pages
- AI-Powered Summaries: Generate intelligent summaries using GPT-4o with keyword extraction
- Personalized Research: Store user research interests for personalized arXiv paper recommendations
- Dual Storage System: Both SQLite database and legacy CSV indexing for reliability
- Multi-User Support: Complete user isolation with personalized document libraries
- Rich Discord Integration: Beautiful embeds with progress indicators and error handling
- ArXiv Papers: Enhanced processing with personalized "Why You Should Read This" sections
- PDF Documents: Direct PDF text extraction and processing from any URL
- GitHub Repositories: README and code analysis
- YouTube Videos: Transcript extraction and summarization
- Hugging Face Models: Model card analysis
- Reddit Threads: Thread summarization
- General Web Pages: Content extraction and analysis
# Clone the repository
git clone https://github.com/phunterlau/dont-read-gpt
cd dont-read-gpt
# Install dependencies
pip install -r requirements.txt
# Set environment variables
export OPENAI_KEY=your_openai_api_key
export DISCORD_TOKEN=your_discord_bot_token
export REDDIT_APP_ID=your_reddit_app_id # Optional
export REDDIT_APP_SECRET=your_reddit_app_secret # Optional
# Run the bot
python my_bot.py# Process a URL (automatic detection)
https://arxiv.org/abs/2304.14979
# Or use explicit command
!wget https://arxiv.org/abs/2304.14979
# Force refresh a document (bypasses cache, reprocesses content)
!wget --force https://arxiv.org/abs/2304.14979
# Search arXiv for papers and auto-process the top result
!find transformer architectures
!find machine learning optimization
# Set your research interests for personalized arXiv summaries
!mem I'm interested in transformer architectures and attention mechanisms
# Search your documents
!grep machine learning
!egrep "neural networks"
# View statistics
!stats
# See recent additions
!tail
!grep <query>- Search all content and summaries (case-insensitive)!egrep <keyword>- Search by keyword (case-insensitive)!related <id>- Find documents related to a specific document!find <keywords>- Search arXiv for papers matching keywords, auto-process the top result
!wget <url>- Process a URL explicitly!wget --force <url>- Force refresh and reprocess a URL (bypasses cache)- Direct URL posting - Just paste a URL for automatic processing
!mem <interests>- Set your research interests for personalized arXiv summaries!mem --show- View your current research profile!mem --clear- Clear your research profile
!stats- Show system statistics (documents, keywords, usage)!tail- Show 3 most recently processed documents!whoami- Show your Discord user information!index- Reindex documents (admin)!migrate- Database migration utilities (admin)
my_bot.py # Main Discord bot entry point
database_manager.py # SQLite database operations
indexer.py # Legacy CSV indexing system
ai_func.py # GPT integration and AI functions
content_processor.py # Content processing pipeline
url_processor.py # URL routing and reader selection
commands/
βββ mem_handler.py # Personalized memory system
βββ wget_handler.py # URL processing
βββ find_handler.py # arXiv search and processing
βββ search_handler.py # Text search (!grep)
βββ keyword_search_handler.py # Keyword search (!egrep)
βββ stats_handler.py # Statistics
βββ tail_handler.py # Recent documents
βββ related_handler.py # Related documents
βββ index_handler.py # Indexing
βββ migrate_handler.py # Migration
βββ whoami_handler.py # User info
readers/
βββ base_reader.py # Abstract base class
βββ arxiv_reader.py # ArXiv paper processing
βββ pdf_reader.py # Direct PDF document processing
βββ github_reader.py # GitHub repository analysis
βββ youtube_reader.py # YouTube transcript extraction
βββ huggingface_reader.py # Hugging Face model cards
βββ reddit_reader.py # Reddit thread processing
βββ webpage_reader.py # General web page content
utils/
βββ embed_builder.py # Discord embed generation
tools/
βββ migrate_to_database.py # CSV to SQLite migration
βββ db_helper.py # Database maintenance utilities
documents (
id INTEGER PRIMARY KEY,
url TEXT UNIQUE NOT NULL,
type TEXT, -- 'arxiv', 'github', 'youtube', etc.
timestamp REAL,
summary TEXT, -- AI-generated summary
file_path TEXT, -- Path to JSON file
content_preview TEXT, -- First 500 chars of content
user_id TEXT, -- User isolation
updated_at REAL -- Last update timestamp
)keywords (
id INTEGER PRIMARY KEY,
keyword TEXT NOT NULL,
document_id INTEGER,
user_id TEXT, -- User isolation
FOREIGN KEY (document_id) REFERENCES documents (id)
)user_profiles (
user_id TEXT PRIMARY KEY,
current_memory_profile TEXT NOT NULL, -- AI-processed research interests
raw_memories TEXT, -- JSON array of raw inputs
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL
)embeddings (
document_id INTEGER PRIMARY KEY,
embedding BLOB, -- Vector embeddings for similarity search
FOREIGN KEY (document_id) REFERENCES documents (id)
)- User Research Profiles: Store and synthesize research interests using GPT-4o-mini
- Personalized Summaries: Generate "Why You Should Read This" sections for arXiv papers
- Context-Aware Processing: Different summarization strategies for different content types
- ArXiv Papers: Enhanced academic summaries with technical depth
- Code Repositories: Focus on functionality and technical implementation
- General Content: Balanced summaries with key insights
OPENAI_KEY=sk-... # Required: OpenAI API key
DISCORD_TOKEN=your_discord_token # Required: Discord bot token
REDDIT_APP_ID=your_reddit_id # Optional: Reddit API access
REDDIT_APP_SECRET=your_reddit_secret # Optional: Reddit API access# In my_bot.py
AUTO_MIGRATE_EXISTING_DATA = False # Set to True for automatic CSV migrationThe !find command provides intelligent arXiv paper discovery:
- Natural Language Search:
!find transformer architectures- No quotes needed - Relevance Ranking: Uses arXiv API to find the most relevant paper based on abstracts
- Automatic Processing: Downloads and processes the top result through the full pipeline
- Robust URL Handling: Handles all arXiv URL formats including versioned URLs (v1, v2, etc.)
- Duplicate Prevention: Checks if paper already exists in your library
- Full Integration: Leverages existing wget pipeline, AI summarization, and personalization
Example Usage:
!find transformer architectures
!find machine learning optimization
!find neural network pruning techniques
!find deep reinforcement learning survey
The bot automatically detects and processes PDF documents from direct URLs:
- Automatic Detection: Any URL ending in
.pdfor serving PDF content - Text Extraction: Uses pdfplumber to extract readable text from PDF files
- Full Pipeline Integration: PDFs get the same AI summarization and keyword extraction
- File Storage: Saves both the extracted text (JSON) and original PDF file
- Content Cleaning: Removes PDF artifacts and formats text for better readability
Example Usage:
# Direct PDF URL processing
https://example.com/document.pdf
!wget https://dennyzhou.github.io/LLM-Reasoning-Stanford-CS-25.pdf
# Works with academic papers, reports, presentations, etc.
Supported PDF Sources:
- Academic papers from university websites
- Research reports and whitepapers
- Technical documentation
- Conference presentations
- Any publicly accessible PDF document
The !mem command creates a personalized research experience:
- Store Interests:
!mem I study transformer architectures and attention mechanisms - Get Recommendations: ArXiv papers automatically include personalized relevance explanations
- Privacy: Each user's profile is completely isolated
- SQLite Database: Primary storage with full relational capabilities
- Legacy CSV System: Backup storage ensuring no data loss during transitions
- Automatic Sync: Both systems stay synchronized for reliability
- Complete Isolation: Users only see their own documents and searches
- User-Specific Stats: Personal document counts and keyword analytics
- Shared Knowledge: Option to discover public documents (future feature)
The project includes comprehensive test suites:
# Core functionality tests
python tests/test_phase1.py
python tests/test_phase2.py
python tests/test_phase3.py
# Memory system tests
python test_mem_phase1.py
python test_mem_phase2.py
python test_mem_phase3.py
python test_mem_integration.py- Vector Search: Semantic similarity using embeddings
- Advanced Analytics: Research trend analysis and insights
- Export Functions: Save collections to files or Obsidian vaults
- Collaboration Features: Share documents and create team collections
The modular architecture makes it easy to:
- Add new content sources
- Implement additional AI features
- Create web interfaces
- Build mobile applications
how-to-en.md- Comprehensive English user guidehow-to-zh-cn.md- Chinese user documentationIMPLEMENTATION_SUMMARY.md- Technical implementation detailsUPDATED_COMMANDS_REFERENCE.md- Complete command reference
The bot is designed for easy extension:
- New Content Sources: Inherit from
BaseReaderclass - New Commands: Add handler to
commands/directory - Database Changes: Update
database_manager.pyschema - AI Features: Extend
ai_func.pywith new capabilities
Built with Python, Discord.py, SQLite, and OpenAI GPT-4o for intelligent research assistance.