feat: migrate daily-brief implementation notes
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
# Daily Brief — Implementation Notes
|
||||||
|
|
||||||
|
## Architecture: context-from Chaining
|
||||||
|
|
||||||
|
```
|
||||||
|
┌──────────────────────────────┐
|
||||||
|
│ cron: 0 15 * * * │
|
||||||
|
│ script: collector.sh │ ← no-agent, free public APIs
|
||||||
|
├──────────────────────────────┤
|
||||||
|
│ Script stdout → agent │ ← injected as prompt context
|
||||||
|
│ context │
|
||||||
|
├──────────────────────────────┤
|
||||||
|
│ Agent: curates → formats │ ← lightweight LLM pass only
|
||||||
|
│ → delivers to Telegram │
|
||||||
|
└──────────────────────────────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cost Breakdown
|
||||||
|
|
||||||
|
| Stage | Token Cost | Frequency |
|
||||||
|
|-------|-----------|-----------|
|
||||||
|
| Script fetch (shell) | $0 | 1x per tick |
|
||||||
|
| Agent curation | Full model | 1x per tick |
|
||||||
|
|
||||||
|
vs. old approach that relied on web_search + x_search (both failing silently).
|
||||||
|
|
||||||
|
## Sources (Free, No API Key)
|
||||||
|
|
||||||
|
| Source | Endpoint | Reliability |
|
||||||
|
|--------|----------|-------------|
|
||||||
|
| Weather | `wttr.in/Placerville,CA` | 99.9% |
|
||||||
|
| Hacker News | Firebase API (v0) | 99.9% |
|
||||||
|
| GitHub Trending | `api.github.com/search/repositories` | 99% (unauthed rate limit: 60/hr) |
|
||||||
|
|
||||||
|
## Previous State (Before June 20)
|
||||||
|
|
||||||
|
Old prompt instructed the agent to use web_search and x_search tools. Both were failing — Firecrawl unconfigured, xAI credits exhausted. Brief returned `[SILENT]` for weeks.
|
||||||
|
|
||||||
|
## Key Insight
|
||||||
|
|
||||||
|
The script + context_from pattern turned a dead cron job into a working one in <5 minutes with zero ongoing API costs.
|
||||||
|
|
||||||
|
## Cron Job (Production)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
hermes cron update e94447937052 \
|
||||||
|
--script daily-brief-collector.sh \
|
||||||
|
--prompt "Curate from the injected context. Output max 8 bullets. Silent if no data."
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Job ID:** e94447937052
|
||||||
|
- **Schedule:** `0 15 * * *` (3pm UTC = 8am PDT)
|
||||||
|
- **Delivery:** Telegram (here)
|
||||||
|
- **Model:** grok-4.3 via xai-oauth
|
||||||
Reference in New Issue
Block a user