惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
I
InfoQ
B
Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
C
Check Point Blog
月光博客
月光博客
L
LangChain Blog
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Built a Daily News Newsletter Bot with Hermes Agent — H...
Hemalatha Na · 2026-05-27 · via DEV Community

Submitted for the Hermes Agent Challenge

The Idea

I wanted one simple thing: a daily email that lands in my inbox every morning with the top news from Canada, the world, India, and the AI/tech space — plus a motivational quote and a health tip. One email. Everything in one place. No scrolling through five different apps before my coffee.

Sounds simple. It wasn't.

This is the honest story of building a daily briefing bot using Hermes Agent — including every wall I hit, every config I lost, and every moment where it finally clicked.

The Stack (Zero Cost, Fully Open Source)

Hermes Agent — the brain that fetches news and generates the newsletter
GitHub Codespaces — free cloud dev environment (no touching my personal Mac)
TypeScript + Nodemailer — sends the email via Gmail SMTP
OpenRouter — free LLM API for Hermes to use

No paid services. No cloud bills. Just open source tooling wired together.

Why GitHub Codespaces?

I specifically didn't want this running on my personal Mac. I wanted it isolated — something I could destroy and rebuild without affecting my machine. GitHub Codespaces gave me a free Linux environment in the browser. Perfect.
Or so I thought.

The Problems (The Real Story)

Problem 1: The Typo That Took 30 Minutes
After getting Nodemailer set up and running my send script, the terminal just... hung. No error. No output. Just silence.
I thought it was a firewall issue in Codespaces blocking SMTP port 587. I switched to port 465. Still hanging on some runs. I added verbose logging. I tried verify() calls.

Then I spotted it:
hostname: 'smpt.gmail.com'

smpt instead of smtp. One transposed letter. Thirty minutes of debugging.
Lesson: Always print your env vars before debugging the code.

Problem 2: Rebuilding the Container Deleted Everything
This one hurt. I had Hermes installed, my .env configured, my SMTP secrets set up, everything working. Then I rebuilt my Codespace container to fix an unrelated issue.
Gone. All of it.
Hermes was uninstalled. My environment variables vanished. My .env file disappeared. I had to reinstall everything from scratch and reconfigure all my secrets.
The fix was two things:
First, create a .devcontainer/devcontainer.json so Hermes auto-installs on every rebuild:

{
  "name": "daily-brief-hermes",
  "postCreateCommand": "pip install hermes-agent && npm install"
}

Enter fullscreen mode Exit fullscreen mode

Second, keep secrets in ~/.hermes/.env and your project .env committed to a safe location — not just floating in your shell session.
Lesson: Never trust your shell session. Anything not written to a file is gone the moment the container rebuilds.

Problem 3: ts-node Fighting with "type": "module"
My package.json had "type": "module" in it, which made ts-node throw:
TypeError: Unknown file extension ".ts"
Three different error messages, two config changes, one Stack Overflow rabbit hole. The fix was switching from ts-node to tsx — a drop-in replacement that handles both ESM and CommonJS without any config:

npm install --save-dev tsx
npx tsx send-newsletter.ts briefings/2026-05-26.md

Enter fullscreen mode Exit fullscreen mode

Lesson: Use tsx over ts-node for TypeScript in modern Node projects. It just works.

*Problem 4: * "Newsletter Sent!" But No Email
The most confusing moment. The script printed Newsletter sent! — Nodemailer was happy, no errors thrown. But my inbox was empty.
Three possible culprits I had to rule out one by one:

Spam folder — it was there. Gmail flagged it as spam.
Wrong app password — Gmail requires a 16-character App Password, not your regular login password. Easy to get wrong.
Empty file being sent — the file path resolved correctly but the content hadn't been written yet.

The spam issue was fixed by adding a proper sender name and dynamic subject line:

await transporter.sendMail({
  from: `"Daily Brief 📰" <${SMTP_USER}>`,
  to: RECIPIENTS.join(", "),
  subject: `Daily Brief — ${new Date().toLocaleDateString("en-CA", {
    weekday: "long",
    year: "numeric",
    month: "long",
    day: "numeric"
  })}`,
  text: body,
});

Enter fullscreen mode Exit fullscreen mode

Lesson: Always check spam. Always use Gmail App Passwords, not your account password. Always mark the first email as "Not Spam" to train Gmail.

Problem 5: Hermes Had No Model Configured
After getting email working, I opened hermes chat and pasted my newsletter prompt. Hermes responded with:

No inference provider configured. Run 'hermes model' to choose a provider and model,
or set an API key in ~/.hermes/.env

Enter fullscreen mode Exit fullscreen mode

Then after adding the OpenRouter key:

HTTP 400: No models provided

Enter fullscreen mode Exit fullscreen mode

The API key was there but no model was set. The fix was adding HERMES_MODEL to ~/.hermes/.env:

OPENROUTER_API_KEY=sk-or-xxxxxxxxxxxxxxxx
HERMES_MODEL=owlobot/owl-7b

Enter fullscreen mode Exit fullscreen mode

Lesson: Hermes needs both an API key AND a model specified. One without the other gives cryptic errors.

What Actually Worked Beautifully

Once everything was configured, Hermes was genuinely impressive to use. I pasted a plain English prompt:

Today is 2026-05-26. Search the web for today's top 5 headlines for 
Canada news, World news, India news, and AI/tech news. Add one 
motivational quote and one health tip. Format as Markdown and save to 
/workspaces/daily-brief-hermes/briefings/2026-05-26.md

Enter fullscreen mode Exit fullscreen mode

And Hermes:

  • Searched the web for current headlines across all four categories
  • Summarized each story in readable bullet points
  • Added a motivational quote and health tip
  • Formatted everything as clean Markdown
  • Saved it to the exact file path I specified

That's the part that made the whole painful setup worth it. I didn't write a single line of news-fetching code. No RSS parsers, no news APIs, no scraping. Hermes handled all of it through natural language.

The Final Architecture

~/.hermes/.env
  └── OPENROUTER_API_KEY + HERMES_MODEL
  └── SMTP credentials

hermes chat (manual trigger or cron)
  └── Reads skills/daily_brief.md prompt
  └── Searches web for today's news
  └── Generates Markdown newsletter
  └── Saves to briefings/YYYY-MM-DD.md

npx tsx send-newsletter.ts briefings/YYYY-MM-DD.md
  └── Reads ~/.hermes/.env for SMTP credentials
  └── Sends email via Gmail SMTP port 465
  └── Delivers to all recipients in the list

Enter fullscreen mode Exit fullscreen mode

The Hermes Cron Setup (For Fully Automatic Daily Runs)

hermes cron start

Inside hermes chat:

/cron add "0 8 * * *" "Read the skill at /workspaces/daily-brief-hermes/skills/daily_brief.md 
and generate today's newsletter. Save it to /workspaces/daily-brief-hermes/briefings/
$(date +%Y-%m-%d).md then run: npx tsx /workspaces/daily-brief-hermes/send-newsletter.ts 
/workspaces/daily-brief-hermes/briefings/$(date +%Y-%m-%d).md"

Enter fullscreen mode Exit fullscreen mode

Every day at 8am UTC, Hermes generates and sends the newsletter automatically.

Note: Codespaces sleeps when idle, so for a truly always-on setup you'd move this to a small VPS. But for prototyping and learning, Codespaces works perfectly.

What I'd Tell Someone Starting This Today

  1. Create .devcontainer/devcontainer.json on day one. Don't wait until you've lost your setup to a rebuild.
  2. Keep all secrets in files, never just in shell exports. Shell exports vanish. Files don't.
  3. Use tsx instead of ts-node. It handles modern Node module systems without fighting your package.json.
  4. Test the email script completely before touching Hermes cron. Get email working first. Then add the AI layer.
  5. Print your env vars before debugging network issues. echo $SMTP_HOST takes two seconds and would have saved me thirty minutes.
  6. Check spam. Seriously. Check spam first.

Final Thoughts on Hermes Agent

The setup friction is real — especially in a Codespaces environment where rebuilds wipe your state. But once Hermes is configured, the experience of writing plain English instructions and watching it search the web, reason about content, and produce structured output is genuinely different from anything I've built before.

I didn't write a news aggregator. I didn't build a scraper. I wrote a prompt and a TypeScript email script, and I get a daily briefing in my inbox every morning.

That's the part that sticks with me.

Built for the Hermes Agent Challenge | GitHub: daily-brief-hermes