Personal script to run a triage on new emails and a Powershell script to add to Windows Task Scheduler to make it automatic.
Uses a local Ollama model to determine whether the email is important, and if it's not important, marks it as read in your stead.
Experimented with Openclaw with local Ollama models and it was horrible for my device's specs. Had already made up a task to use it for so just ended up making it a python script.
- Clone this repository.
- Install Python 3.9+.
- Install dependencies:
uv pip install -r requirements.txt
- Download your Gmail API credentials as
credentials.jsonfrom Google Cloud Console. - Run the script once to complete authentication:
python main.py
- (Optional) Use
run_triage.ps1with Windows Task Scheduler for automation. Note to change the global file paths.
PS C:\Users\arche\Development\email-triager> uv run .\main.py
Found 50 emails to read.
=== Reading email 19d33d2264338245 ===
Email 19d33d2264338245 classified as IMPORTANT because The email is from a self-proclaimed unicorn, indicating a significant level of personalization and potentially, importance..
=== Reading email 19d2fef27e54999f ===
Email 19d2fef27e54999f classified as NOT important.
Email 19d2fef27e54999f marked as read (not important).
=== Reading email 19d2fc14d0ceab42 ===
Email 19d2fc14d0ceab42 classified as IMPORTANT because The email is from a self-proclaimed unicorn (@AI Startup) and is related to a LinkedIn Pulse article on the opportunity of building a future for everyone. Therefore, it is an important email..