# Smart Newsletter Digest

**Runs:** Daily at 8:00 PM (Australia/Perth)  
**Sends to:** Telegram + Gotify  
**Learns from your feedback!**

## How It Works

1. **Fetches** newsletters from past 24 hours via IMAP
2. **Scores** them based on your preferences
3. **Summarizes** key points and highlights
4. **Sends** digest to Telegram
5. **Learns** from your feedback

## Feedback System

After each digest, reply with:

| Reply | Effect |
|-------|--------|
| 👍 | Reinforces current selections |
| 👎 | Adjusts to show less like this |
| `more AI` | Adds "AI" to liked topics |
| `less crypto` | Adds "crypto" to disliked topics |
| `prefer The Rundown` | Boosts this source |

## Preferences File

`newsletter-preferences.json` stores:
- `liked_topics` - Topics to prioritize
- `disliked_topics` - Topics to de-emphasize  
- `preferred_sources` - Senders to boost
- `avoided_sources` - Senders to skip
- `feedback_count` - How many times you've given feedback

## Manual Run

```bash
./smart-digest.sh
```

## Files

- `smart-digest.sh` - Main script
- `newsletter-preferences.json` - Your learned preferences
- `digest-history.json` - Last 7 days of digests (for feedback reference)

---

**Krilly will learn what you like!** 🦀
