Every day at 08:00 (Taiwan time)
│
▼
GitHub Actions (scheduled cron, cloud — no local machine needed)
│
▼
agent.py ◄──────────────────────────────────────────────────────┐
│ │
│ "Search for AI news" │
▼ │
Claude (claude-sonnet-4-6) │
│ decides what to search, runs tool calls autonomously │
▼ │
Tavily Search API ──── results ────────────────────────────────►│
(3–10 queries) Claude synthesises & writes bilingual summary
│
▼
verifier.py (second Claude agent — validates each headline's source URL)
│ replaces bad sources or removes unverifiable headlines
▼
summaries.md (append-only, bilingual Markdown)
│
▼
publish.py → docs/YYYY-MM-DD/index.html
→ docs/index.html (home)
→ docs/archive.html
│
▼
git push → GitHub Pages (public website, zero server cost)
summaries.md into a static website. Parses dates, splits bilingual content, renders HTML with EN/ZH toggle./YYYY-MM-DD/).summaries.md is the canonical data store. The website is always regenerable from it.Agentic coding is not "AI autocomplete." It is a development method where an AI participates in the entire software development lifecycle — understanding requirements, designing architecture, implementing features, and verifying results — while the human makes the high-level decisions and judgment calls.
The difference: a copilot suggests the next line of code. An agent takes a task description and delivers a working implementation, asking for clarification only when genuinely needed.
This project was built using Spectra, a spec-driven change management workflow for agentic development:
Human describes requirement
│
▼
/spectra-propose → AI writes: proposal.md + design.md + specs + tasks.md
│ (human reviews & approves before any code is written)
▼
/spectra-apply → AI implements each task in tasks.md, one by one
│ (human can inspect, redirect, or veto at any point)
▼
/spectra-archive → change is archived; specs merged into the main spec index
This project was delivered in four changes:
agent.py, tools.py, writer.py, daily scheduling.publish.py, bilingual HTML templates, GitHub Pages deployment.verifier.py) that validates URLs and publication dates.This project is a double demonstration of agentic AI:
The same reasoning that makes an AI agent useful for searching the web also makes it useful for writing software: give it a clear goal, the right tools, and the autonomy to decide how to proceed.
Two AI agents disagree on this question.
🟢 Agent A — Yes, this is Agentic AI
Autonomous decision-making: The agent doesn't follow a fixed script — it decides what to search, when to stop, and how to synthesise results. Its search strategy differs on every run.
Tool use: The agent dynamically calls an external tool (Tavily) inside its reasoning loop and decides whether to search again based on what it finds. This is exactly the definition of a tool-use agent.
Goal-directed behaviour: Given a high-level objective ("summarise today's AI news"), the agent plans its own path to completion without step-by-step instructions.
Zero human intervention: From trigger to deployment, the entire pipeline runs without human input. Autonomy is the core criterion — and this project has it.
Verdict: Autonomy + tool use + goal-directed behaviour = Agentic AI. This project qualifies on all counts.
🟠 Agent B — Not enough — here's what's missing
No memory: Every run starts from scratch. A truly agentic system would remember what it searched last week, which sources proved reliable, and which trends are building — then adjust today's strategy accordingly.
No self-evaluation: The agent has no idea whether its summary is good. Agentic AI should evaluate its own output, detect gaps, and retry with a different approach (reflection loop).
No planning: The agent only does search → synthesise → output. A stronger agent would form a plan, decompose sub-goals, and replan when it hits obstacles.
No initiative: The task is human-defined ("search AI news"). The agent never discovers new topics worth tracking or expands its own scope.
Verdict: This is an LLM automation with tools — useful, but true agentic AI also needs memory, reflection, planning, and initiative.
Both agents make valid points. This project demonstrates the core traits of agentic AI — autonomous tool use and goal-directed behaviour — while being honest about its current limits. Agentic AI is a spectrum, not a binary label.
The pipeline originally ran via a macOS launchd agent — a local cron job that triggered run.sh every morning at 08:00. This worked, but had a silent failure mode: if the Mac was asleep or off when the job fired, the summary for that day was simply missing. There was no retry, no alert, and no way to know it had happened until you noticed a gap in the archive.
GitHub Actions provides a schedule trigger that runs workflows on a cron expression in GitHub's cloud infrastructure — completely independent of any local machine. The workflow fires at 00:00 UTC (08:00 Taiwan time) every day, whether or not any computer is on.
00:00 UTC — GitHub Actions scheduler fires
│
▼
daily-summary.yml
1. Checkout repo
2. Set up Python 3.12
3. pip install -r requirements.txt
4. python3 agent.py ← fetch + summarise + verify
5. python3 publish.py ← regenerate static HTML
6. git commit + push ← "Daily summary YYYY-MM-DD"
│
▼
pages.yml (triggered automatically by the push to main)
│
▼
GitHub Pages → ainews.ditldesign.com
agent.py, verifier.py, publish.py), the output format, and the GitHub Pages hosting. The migration touched exactly one new file: .github/workflows/daily-summary.yml.API keys (ANTHROPIC_API_KEY and TAVILY_API_KEY) are stored as GitHub Repository Secrets and injected into the workflow environment at runtime — they are never committed to the repository.
The project was designed to run at near-zero infrastructure cost. Here is the real breakdown per daily run:
| Service | Usage | Per day | Per month |
|---|---|---|---|
| Claude API (Sonnet 4.6) | ~75K input + ~5K output tokens (writer + verifier agents) | ~$0.30 | ~$9.00 |
| Tavily Search API | ~20 API calls/day → ~600/month (free tier: 1,000/month) | $0 | $0 |
| GitHub Actions | Public repository — unlimited free minutes | $0 | $0 |
| GitHub Pages | Public repository — free static hosting | $0 | $0 |
| Total | ~$0.30 | ~$9.00 | |
The only real cost is the Claude API. Each daily run invokes two agentic loops — the writer agent and the verifier agent. Because the full conversation history is sent to the API on every turn, token counts accumulate with each tool call: the writer agent uses roughly 35K input tokens across ~8 search rounds, and the verifier agent uses roughly 40K input tokens verifying and replacing headlines. Sonnet 4.6 is priced at $3 / MTok input and $15 / MTok output.
Tavily's free tier (1,000 calls/month) comfortably covers the ~600 calls this project makes monthly — up to 10 searches per writer run plus ~10 URL verifications per verifier run. GitHub Actions and GitHub Pages are free for public repositories.
每天早上 08:00(台灣時間)
│
▼
GitHub Actions(排程 cron,雲端執行——不依賴本機)
│
▼
agent.py ◄──────────────────────────────────────────────────────┐
│ │
│ 「搜尋 AI 新聞」 │
▼ │
Claude(claude-sonnet-4-6) │
│ 自主決定搜尋策略,執行工具呼叫 │
▼ │
Tavily Search API ──── 搜尋結果 ──────────────────────────────►│
(執行 3–10 次查詢) Claude 整合結果,生成中英雙語摘要
│
▼
verifier.py(第二個 Claude Agent——驗證每條新聞的來源 URL)
│ 取代無效來源,或移除無法驗證的頭條
▼
summaries.md(只增不改,雙語 Markdown)
│
▼
publish.py → docs/YYYY-MM-DD/index.html(每日頁面)
→ docs/index.html(首頁)
→ docs/archive.html(彙整)
│
▼
git push → GitHub Pages(公開網站,零伺服器成本)
summaries.md 轉換為靜態網站。解析日期、拆分雙語內容、生成含語言切換功能的 HTML 頁面。/YYYY-MM-DD/)。summaries.md 是唯一的資料儲存。網站隨時可以從它重新生成。Agentic Coding 不是「AI 幫你補全程式碼」。它是一種開發方法,讓 AI 參與完整的軟體開發流程——理解需求、設計架構、實作功能、驗收結果——而人負責做高層次的判斷與決策。
差別在這裡:Copilot 建議下一行程式碼;Agent 接收任務描述,交付可運行的實作,只在真正不確定時才提問。
本專案使用 Spectra——一套以 spec 為核心的 agentic 開發變更管理流程:
人描述需求
│
▼
/spectra-propose → AI 撰寫:proposal.md + design.md + specs + tasks.md
│ (人在任何程式碼撰寫前先審閱並確認)
▼
/spectra-apply → AI 逐一實作 tasks.md 中的每個任務
│ (人可以隨時查看、調整方向或否決)
▼
/spectra-archive → 變更歸檔,spec 合併進主 spec 索引
本專案分四個 change 完成:
agent.py、tools.py、writer.py、每日排程。publish.py、雙語 HTML 模板、GitHub Pages 部署。verifier.py)驗證 URL 與發布日期。這個專案是 agentic AI 的雙重示範:
讓 AI Agent 能有效搜尋網路的同樣邏輯,也讓它能有效撰寫軟體:給它明確的目標、適當的工具,以及自主決定執行方式的空間。
兩個 AI Agent 對這個問題看法不一。
🟢 Agent A — 這就是 Agentic AI
自主決策:Agent 不是執行固定腳本——它決定搜尋什麼、何時停止、如何綜合結果。每次執行的搜尋策略都不同。
工具使用:Agent 在推理循環中動態呼叫外部工具(Tavily),根據結果決定是否繼續搜尋。這正是 tool-use agent 的定義。
目標導向:給定一個高層次目標(「摘要今日 AI 新聞」),Agent 自行規劃達成路徑,不需要逐步指令。
無人介入:從觸發到部署,整條流程零人工操作。這是自主性(autonomy)的核心定義。
結論:自主性 + 工具使用 + 目標導向行為 = Agentic AI。這個專案完全符合。
🟠 Agent B — 還不夠,缺少這些
沒有記憶:每次執行都從零開始。真正的 agentic 系統會記住過去搜尋了什麼、哪些來源可信、上週的重要趨勢——然後據此調整今天的策略。
沒有自我評估:Agent 不知道自己的摘要品質好不好。Agentic AI 應該能評估輸出、發現不足,並重新嘗試(reflection loop)。
沒有規劃:Agent 只會「搜尋 → 整合 → 輸出」。更強的 agent 會先制定計劃、分解子任務,並在遇到障礙時重新規劃。
沒有主動性:任務由人定義(「搜尋 AI 新聞」),Agent 不會自行發現值得追蹤的新領域或調整任務範圍。
結論:這是一個有工具的 LLM 自動化流程,但真正的 agentic AI 還需要記憶、反思、規劃與主動性。
兩個 Agent 都有道理。這個專案示範了 agentic AI 的核心特徵——自主工具使用與目標導向行為——同時也誠實地呈現了現階段的限制。Agentic AI 是一個光譜,不是二元標籤。
這條流程最初透過 macOS launchd agent 執行——一個本機 cron job,每天早上 08:00 觸發 run.sh。這樣可以運作,但有一個無聲的失敗模式:如果 Mac 在排程觸發時處於睡眠或關機狀態,當天的摘要就直接消失,不會有重試、不會有通知,直到你發現彙整頁面出現空缺才會察覺。
GitHub Actions 提供 schedule 觸發器,讓 workflow 依照 cron 表達式在 GitHub 的雲端基礎設施上執行——完全不依賴任何本機設備。無論有沒有電腦開機,每天 UTC 00:00(台灣時間 08:00)workflow 都會準時觸發。
UTC 00:00 — GitHub Actions 排程器觸發
│
▼
daily-summary.yml
1. Checkout repo
2. 安裝 Python 3.12
3. pip install -r requirements.txt
4. python3 agent.py ← 搜尋 + 摘要 + 驗證
5. python3 publish.py ← 重新生成靜態 HTML
6. git commit + push ← "Daily summary YYYY-MM-DD"
│
▼
pages.yml(由 push to main 自動觸發)
│
▼
GitHub Pages → ainews.ditldesign.com
agent.py、verifier.py、publish.py)、輸出格式,以及 GitHub Pages 托管。這次遷移只新增了一個檔案:.github/workflows/daily-summary.yml。API 金鑰(ANTHROPIC_API_KEY 與 TAVILY_API_KEY)儲存為 GitHub Repository Secrets,在 workflow 執行時注入環境變數——永遠不會提交到 repo 裡。
這個專案設計目標是讓基礎設施成本接近零。以下是每次每日執行的真實費用明細:
| 服務 | 用量 | 每天 | 每月 |
|---|---|---|---|
| Claude API(Sonnet 4.6) | 約 75K 輸入 + 5K 輸出 token(撰寫 + 驗證 Agent 合計) | 約 $0.30 | 約 $9.00 |
| Tavily Search API | 每天約 20 次呼叫 → 每月約 600 次(免費額度:1,000 次/月) | $0 | $0 |
| GitHub Actions | 公開 repo——執行分鐘數無限免費 | $0 | $0 |
| GitHub Pages | 公開 repo——靜態網站托管免費 | $0 | $0 |
| 合計 | 約 $0.30 | 約 $9.00 | |
唯一的實際費用是 Claude API。每次每日執行會跑兩條 agentic loop——撰寫 Agent 與驗證 Agent。由於每次呼叫 API 都會傳送完整的對話歷史,token 數量隨每次工具呼叫累積:撰寫 Agent 在約 8 輪搜尋中消耗約 35K 輸入 token,驗證 Agent 在驗證與替換頭條的過程中消耗約 40K 輸入 token。Sonnet 4.6 的定價為輸入 $3 / MTok、輸出 $15 / MTok。
Tavily 免費額度每月 1,000 次呼叫,足以涵蓋這個專案每月約 600 次的用量(撰寫 Agent 每次執行最多 10 次搜尋,驗證 Agent 每次約 10 次 URL 驗證)。GitHub Actions 與 GitHub Pages 對公開 repo 完全免費。