Set up and run a personal AI newsletter intelligence system called Briefed. Fetches Gmail newsletters daily, uses Claude Haiku to extract article summaries,...
name: briefed
description: Set up and run a personal AI newsletter intelligence system called Briefed. Fetches Gmail newsletters daily, uses Claude Haiku to extract article summaries, and serves a polished local web reader app with voting, notes, and interest tracking. Use when a user asks to set up a newsletter reader, daily digest, inbox intelligence tool, or newsletter summariser with OpenClaw.
metadata:
openclaw:
requires:
env:
- BRIEFED_GMAIL_CLIENT_SECRET
optionalEnv:
- BRIEFED_GMAIL_TOKEN_FILE
- NEWSLETTER_ACCOUNT
files:
- ~/.openclaw/workspace/newsletter-inbox.json
- ~/.openclaw/workspace/newsletter-today.json
- ~/.openclaw/workspace/newsletter-interests.json
- ~/.openclaw/workspace/newsletter-notes.json
- ~/.openclaw/workspace/reading-list.md
Briefed
A daily newsletter digest pipeline + local web reader. Gmail β Haiku summaries β web app β notification ping.
Architecture
[Gmail]
β pre-fetch.py (fetches, filters, extracts compact metadata)
[newsletter-inbox.json]
β Haiku cron agent (reads compact JSON, writes AI summaries)
[newsletter-today.json]
β fetch-bodies.py (adds full HTML email bodies)
[newsletter-today.json + bodies]
β Express web reader (default port 3001)
[Notification ping β user opens reader]
Why split fetch/summarise? Raw Gmail API JSON overflows Haiku's context. Python handles data wrangling; Haiku handles cognition.
Security & Scope
Gmail access is read-only (gmail.readonly).
OAuth token is stored locally at ~/.openclaw/workspace/briefed-gmail-token.json (or BRIEFED_GMAIL_TOKEN_FILE).
The workflow should only read/write the following workspace files:
Step 3 β Write newsletter-today.json with AI summaries
For each newsletter, write to only this file: ~/.openclaw/workspace/newsletter-today.json.
Do not modify any other files in this step.
Use the snippet field to write real summaries β do NOT just repeat the subject line.
Score by interest: (adjust topics and weights to match your interests)
ai/ml=0.9, startups=0.85, design=0.8, finance=0.75, general=0.6
| Endpoint | Method | Purpose |
|----------|--------|---------|
| /api/today | GET | All stories (bodies stripped) |
| /api/story/:id | GET | Single story with full HTML body |
| /api/vote | POST | { storyId, vote: "up"\|"down"\|"open" } |
| /api/save | POST | { storyId } β adds to reading-list.md |
| /api/note | POST | { storyId, note } |
| /api/notes | GET | All notes |
Filtering Transactional Email
scripts/pre-fetch.py has two tunable lists near the top:
SKIP_SUBJECT_PATTERNS β subject substrings that flag an email as transactional
SKIP_SENDERS β sender names that are always transactional (e.g. banks, shops)
Tune these when transactional emails slip through.
Branding
The reader shows "Briefed" with a blue "B" logo by default. To customise, edit public/index.html and public/icon.svg.
βοΈ Configuration
1. Install Python dependencies
cd ~/.openclaw/workspace/briefed
python3 -m pip install -r scripts/requirements.txt
2. Configure Gmail OAuth
Create a Google Cloud OAuth Desktop app and download the client JSON, then set: