I often rely on daily and weekly financial and economic newsletters for news updates, subscribing to multiple different sources. However, I found it challenging to stay on top of them due to the volume of emails and overlapping content. To address this, I developed an AI-based solution that automatically processes my newsletters every two days. The bot scans the emails, summarizes the key stories, and sends a digestible summary to my inbox. This allows me to quickly access important updates without missing any important information.
Pulling emails: Using the imaplib python library, emails from the past 48 hours are retrieved by connecting to the IMAP server. The script filters and extracts the text, preparing it for processing.
GPT API summarization: Each email is passed individually to an OpenAI model. The model summarizes the content and categorizes each story into relevant topics. The summarized outputs are combined into a structured format.
HTML conversion: The summarized content is formatted into a clean and readable HTML structure. This ensures the final email is well-organized and easy to read.
Sending emails: Using the smtplib python library, the html content is sent to my personal inbox as a concise news digest.
Docker: All scripts are containerized in a remote Docker instance and scheduled to run every two days, automating the entire workflow.
Tools/Frameworks I used: Python, Docker