สร้างบอทสรุปข่าวประจำวัน
Build a Daily Briefing Bot — easy-to-understand guide based on official docs
สร้างบอทสรุปข่าวประจำวัน
ลองนึกภาพว่าทุกเช้าที่ตื่นนอน คุณได้รับสรุปข่าวที่คัดสรรมาอย่างดีเฉพาะเรื่องที่คุณสนใจจริงๆ — ส่งตรงมาถึงโทรศัพท์ของคุณ ไม่ต้องเลื่อนดูฟีด ไม่มีเสียงรบกวน มีแต่เรื่องสำคัญ พร้อมดื่มกาแฟไปด้วย
นี่คือสิ่งที่คุณจะได้สร้างในวันนี้: บอทสรุปข่าวส่วนตัวที่ทำงานเองได้ทั้งหมด มันค้นหาเว็บ สรุปข่าวเด่นๆ แล้วส่งผลลัพธ์ไปยัง Telegram หรือ Discord ของคุณ และที่สำคัญที่สุด ไม่ต้องเขียนโค้ดเลย
สิ่งที่เราจะสร้าง
นี่คือขั้นตอนการทำงาน:
- 8:00 น. — cron scheduler เรียกใช้งาน job ของคุณ
- Hermes เริ่มต้น เซสชัน agent ใหม่พร้อมกับ prompt ของคุณ
- การค้นหาเว็บ ดึงข่าวล่าสุดเกี่ยวกับหัวข้อที่คุณสนใจ
- การสรุป ย่อยข้อมูลให้อยู่ในรูปแบบ briefing ที่อ่านง่าย
- การส่งต่อ ส่ง briefing ไปยัง Telegram หรือ Discord ของคุณ
ทั้งหมดนี้ทำงานแบบอัตโนมัติเต็มรูปแบบ คุณแค่อ่านสรุปข่าวพร้อมกาแฟยามเช้า
สิ่งที่ต้องเตรียม
ก่อนเริ่มต้น ตรวจสอบให้แน่ใจว่าคุณมี:
- ติดตั้ง Hermes Agent แล้ว — ดูคู่มือการติดตั้ง
- Gateway กำลังทำงาน — daemon ของ gateway จัดการเรื่อง cron execution:
hermes gateway install # ติดตั้งเป็น user service
sudo hermes gateway install --system # สำหรับ Linux servers: บริการระบบที่เริ่มเมื่อบูต
# หรือ
hermes gateway # รันแบบ foreground
- Firecrawl API key — ตั้งค่า
FIRECRAWL_API_KEYใน environment ของคุณสำหรับการค้นหาเว็บ - ตั้งค่า Messaging แล้ว (แนะนำแต่ไม่บังคับ) — Telegram หรือ Discord ที่ตั้งค่าพร้อม home channel
ไม่มี messaging? ไม่มีปัญหา คุณยังสามารถทำตามบทช่วยสอนนี้ได้โดยใช้
deliver: "local"โดย briefing จะถูกบันทึกไว้ที่~/.hermes/cron/output/และคุณสามารถอ่านได้ทุกเมื่อ
ขั้นตอนที่ 1: ทดสอบ Workflow ด้วยตนเอง
ก่อนที่จะทำระบบอัตโนมัติ มาทดสอบให้แน่ใจว่า briefing ทำงานได้ก่อน เริ่มเซสชันแชท:
hermes
จากนั้นพิมพ์ prompt นี้:
Search for the latest news about AI agents and open source LLMs.
Summarize the top 3 stories in a concise briefing format with links.
Hermes จะค้นหาเว็บ อ่านผลลัพธ์ และสร้างผลลัพธ์ประมาณนี้:
☀️ Your AI Briefing — March 8, 2026
1. Qwen 3 Released with 235B Parameters
Alibaba's latest open-weight model matches GPT-4.5 on several
benchmarks while remaining fully open source.
→ https://qwenlm.github.io/blog/qwen3/
2. LangChain Launches Agent Protocol Standard
A new open standard for agent-to-agent communication gains
adoption from 15 major frameworks in its first week.
→ https://blog.langchain.dev/agent-protocol/
3. EU AI Act Enforcement Begins for General-Purpose Models
The first compliance deadlines hit, with open source models
receiving exemptions under the 10M parameter threshold.
→ https://artificialintelligenceact.eu/updates/
---
3 stories • Sources searched: 8 • Generated by Hermes Agent
ถ้าทำงานได้ถูกต้อง คุณก็พร้อมที่จะทำระบบอัตโนมัติแล้ว
เคล็ดลับ: ปรับแต่งรูปแบบไปเรื่อยๆ ลองใช้ prompt ต่างๆ จนกว่าจะได้ผลลัพธ์ที่คุณชอบ เพิ่มคำสั่งเช่น “ใช้ emoji เป็นหัวข้อ” หรือ “ให้แต่ละสรุปสั้นกว่า 2 ประโยค” สิ่งที่คุณเลือกใช้จะถูกนำไปใช้ใน cron job
ขั้นตอนที่ 2: สร้าง Cron Job
ตอนนี้เรามากำหนดเวลาให้ทำงานอัตโนมัติทุกเช้ากัน มีสองวิธีให้เลือก
ก่อนสร้าง cron jobs ตรวจสอบให้แน่ใจว่า Hermes มี model และ provider เริ่มต้นที่ตั้งค่าไว้ระดับ global แล้ว ถ้าคุณต้องการให้ job เฉพาะใช้ค่าที่ต่างออกไป ให้ระบุค่า model/provider ที่แตกต่างกันสำหรับ job นั้นตอนสร้าง
ตัวเลือก A: ภาษาธรรมชาติ (ในแชท)
แค่บอก Hermes ว่าคุณต้องการอะไร:
Every morning at 8am, search the web for the latest news about AI agents
and open source LLMs. Summarize the top 3 stories in a concise briefing
with links. Use a friendly, professional tone. Deliver to telegram.
Hermes จะสร้าง cron job ให้คุณโดยใช้เครื่องมือ cronjob แบบรวมศูนย์
ตัวเลือก B: คำสั่ง Slash ผ่าน CLI
ใช้คำสั่ง /cron เพื่อควบคุมได้มากขึ้น:
/cron add "0 8 * * *" "Search the web for the latest news about AI agents and open source LLMs. Find at least 5 recent articles from the past 24 hours. Summarize the top 3 most important stories in a concise daily briefing format. For each story include: a clear headline, a 2-sentence summary, and the source URL. Use a friendly, professional tone. Format with emoji bullet points and end with a total story count."
กฎทอง: Prompt ที่สมบูรณ์ในตัวเอง
แนวคิดสำคัญ: Cron jobs ทำงานใน เซสชันใหม่ทั้งหมด — ไม่มีความทรงจำจากการสนทนาก่อนหน้านี้ ไม่มีบริบทว่าคุณ “ตั้งค่าไว้ก่อนหน้านี้” อะไรบ้าง prompt ของคุณต้องมี ทุกอย่าง ที่ agent จำเป็นต้องใช้ทำงานให้สำเร็จ
Prompt ที่ไม่ดี:
Do my usual morning briefing.
Prompt ที่ดี:
Search the web for the latest news about AI agents and open source LLMs.
Find at least 5 recent articles from the past 24 hours. Summarize the
top 3 most important stories in a concise daily briefing format. For each
story include: a clear headline, a 2-sentence summary, and the source URL.
Use a friendly, professional tone. Format with emoji bullet points.
Prompt ที่ดีจะระบุชัดเจนว่า ค้นหาอะไร กี่บทความ รูปแบบไหน และ โทนแบบใด มันคือทุกอย่างที่ agent ต้องการในครั้งเดียว
ขั้นตอนที่ 3: ปรับแต่ง Briefing
เมื่อ briefing พื้นฐานทำงานได้แล้ว คุณก็สามารถสร้างสรรค์ได้เต็มที่
Briefing หลายหัวข้อ
ครอบคลุมหลายด้านใน briefing เดียว:
/cron add "0 8 * * *" "Create a morning briefing covering three topics. For each topic, search the web for recent news from the past 24 hours and summarize the top 2 stories with links.
Topics:
1. AI and machine learning — focus on open source models and agent frameworks
2. Cryptocurrency — focus on Bitcoin, Ethereum, and regulatory news
3. Space exploration — focus on SpaceX, NASA, and commercial space
Format as a clean briefing with clear section headers for each topic. Use emoji bullet points and end with a total story count."
เปลี่ยนเวลาหรือความถี่
อยากได้สรุปรายสัปดาห์แทนเหรอ? แค่เปลี่ยน cron expression:
/cron add "0 9 * * 1" "Search for the latest AI research papers from the past week. Summarize the 5 most significant findings in a technical briefing format..."
นั่นคือ 9 โมงเช้าทุกวันจันทร์ — เหมาะสำหรับการเจาะลึกรายสัปดาห์
สรุป
ตอนนี้คุณมีบอทสรุปข่าวอัตโนมัติเต็มรูปแบบที่:
- ค้นหาเว็บเพื่อหาข่าวใหม่ๆ
- สรุปให้อยู่ในรูปแบบที่อ่านง่าย
- ส่งไปยังแอป messaging ของคุณ
- ทำงานตามตารางเวลา — ไม่ต้องทำอะไรด้วยมือ
รูปแบบเดียวกันนี้ใช้ได้กับงานวิจัยที่ต้องทำเป็นประจำทุกประเภท: รายงานตลาด การติดตามคู่แข่ง คะแนนกีฬา หรือแม้แต่มุขตลกรายวัน แค่จำกฎทอง: ทำให้ prompt ของคุณสมบูรณ์ในตัวเอง แล้ว Hermes จะจัดการที่เหลือให้เอง
ลงมือเลย — ตั้งค่าบอทสรุปข่าวของคุณและเพลิดเพลินกับกาแฟยามเช้าพร้อมข่าวสารที่สำคัญสำหรับคุณ
📖 เอกสารทางการ
この記事は Hermes Agent のเอกสารทางการに基づいています:เอกสารทางการ › guides/daily-briefing-bot