You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: always_on_agents/always_on_hn_briefing_agent/README.md
+63-13Lines changed: 63 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
AgentScout is an always-on Hacker News briefing agent built with Google ADK. It scans Hacker News for high-signal stories about AI agents, MCP, coding agents, workflow automation, and LLM apps, then turns the best links into a concise engineering brief.
4
4
5
-
The app can run as an interactive ADK agent or as a scheduled backend service. Use ADK Web to ask for a brief manually, or run the FastAPI scheduler hook so Cloud Scheduler can trigger a daily Hacker News briefing and send the rendered payload to email, Slack, Linear, Jira, or an internal digest workflow.
5
+
The app can run as an interactive ADK agent or as a scheduled backend service. Use ADK Web to ask for a brief manually, or run the FastAPI scheduler hook so Cloud Scheduler can trigger a daily Hacker News briefing and send it through Gmail, Slack, Linear, Jira, or an internal digest workflow.
@@ -13,7 +13,8 @@ The app can run as an interactive ADK agent or as a scheduled backend service. U
13
13
-**Brief generation**: Produces a clean text and HTML briefing with summaries, links, and next actions.
14
14
-**Google ADK agent**: Exposes a `root_agent` so users can request briefs in ADK Web.
15
15
-**Scheduler-ready backend**: Includes HTTP and Pub/Sub endpoints for Cloud Scheduler or other automation systems.
16
-
-**Safe delivery flow**: Defaults to dry-run mode and only posts to a webhook when `dry_run=false`.
16
+
-**Gmail and webhook delivery**: Sends briefs through Gmail API or a generic webhook when `dry_run=false`.
17
+
-**Safe delivery flow**: Defaults to dry-run mode and skips delivery unless credentials are explicitly configured.
17
18
18
19
## How It Works
19
20
@@ -22,13 +23,14 @@ The app can run as an interactive ADK agent or as a scheduled backend service. U
22
23
3. It ranks the most useful stories for engineers and product builders.
23
24
4. It renders a daily briefing in text and HTML.
24
25
5. ADK Web, an HTTP trigger, or a Pub/Sub push endpoint returns the result.
25
-
6. If delivery is enabled, the scheduler API posts the brief to `AGENTSCOUT_WEBHOOK_URL`.
26
+
6. If delivery is enabled, the scheduler API sends the brief through Gmail or posts it to `AGENTSCOUT_WEBHOOK_URL`.
26
27
27
28
## Requirements
28
29
29
30
- Python 3.10+
30
-
- Gemini API key for Google ADK
31
-
- Optional webhook URL for scheduled delivery
31
+
- Gemini API key for ADK Web
32
+
- Optional Gmail OAuth credentials for direct email delivery
33
+
- Optional webhook URL for Slack, Linear, Jira, GitHub Issues, SendGrid, or internal workflows
32
34
33
35
## Installation
34
36
@@ -39,7 +41,9 @@ pip install -r requirements.txt
39
41
export GOOGLE_API_KEY="your_gemini_api_key"
40
42
```
41
43
42
-
## Run in ADK Web
44
+
## Option 1: Run in ADK Web
45
+
46
+
Use ADK Web when you want to chat with the agent and ask for a brief manually.
43
47
44
48
```bash
45
49
adk web .
@@ -61,37 +65,81 @@ Scout the top 3 Hacker News stories about AI agents and LLM apps.
61
65
Show me the highest-signal Hacker News items about MCP, coding agents, and workflow automation.
62
66
```
63
67
64
-
## Run the Scheduler API
68
+
## Option 2: Run the Scheduler API Locally
69
+
70
+
Use the scheduler API when you want AgentScout to run like an always-on backend service. This is the same surface you can deploy behind Cloud Run and trigger from Cloud Scheduler.
curl -X POST "http://127.0.0.1:8000/agent-scout/trigger" \
82
88
-H "Content-Type: application/json" \
83
89
-d '{"dry_run": true, "top_n": 5, "live": false}'
84
90
```
85
91
86
-
Enable live Hacker News scanning:
92
+
Dry-run mode returns the rendered brief and delivery status, but it does not send anything.
93
+
94
+
Enable live Hacker News scanning for the current process:
87
95
88
96
```bash
89
97
export AGENTSCOUT_LIVE_HN=true
90
98
```
91
99
92
-
Enable webhook delivery:
100
+
You can also override live mode per request:
93
101
94
102
```bash
103
+
curl -X POST "http://127.0.0.1:8000/agent-scout/trigger" \
104
+
-H "Content-Type: application/json" \
105
+
-d '{"dry_run": true, "top_n": 5, "live": true}'
106
+
```
107
+
108
+
## Option 3: Enable Scheduled Delivery
109
+
110
+
Delivery is opt-in. AgentScout will not send email or call a webhook unless the request body includes `"dry_run": false` and one delivery method is configured.
111
+
112
+
Delivery mode behavior:
113
+
114
+
-`AGENTSCOUT_DELIVERY=gmail` sends through Gmail API.
115
+
-`AGENTSCOUT_DELIVERY=webhook` posts to `AGENTSCOUT_WEBHOOK_URL`.
116
+
- If `AGENTSCOUT_DELIVERY` is not set, AgentScout uses Gmail when Gmail is fully configured, otherwise webhook when a webhook URL is configured.
117
+
118
+
### Gmail Delivery
119
+
120
+
Use Gmail when you want AgentScout to send the daily brief directly to an inbox. Create a Google OAuth client with Gmail API access, generate a refresh token with the `https://www.googleapis.com/auth/gmail.send` scope, then set:
@@ -104,7 +152,7 @@ The webhook receives `subject`, `text`, `html`, `stories`, and `next_actions`.
104
152
105
153
## Cloud Scheduler Hook
106
154
107
-
Deploy the scheduler API behind Cloud Run or another HTTP service, then call one of these endpoints from Cloud Scheduler.
155
+
Deploy the scheduler API behind Cloud Run or another HTTP service, configure Gmail or webhook delivery in that environment, then call one of these endpoints from Cloud Scheduler.
108
156
109
157
Direct HTTP trigger:
110
158
@@ -122,6 +170,8 @@ Request body:
122
170
}
123
171
```
124
172
173
+
Set `dry_run` to `true` while testing the schedule. Set it to `false` only after Gmail or webhook delivery is configured.
0 commit comments