The Problem
Running a technical blog by hand doesn't scale: choosing topics across six ML domains without repeating yourself, staying current on a fast-moving news cycle, and keeping editorial quality consistent are all full-time jobs that compete with actually doing the work.
The Solution
A single LangGraph state machine with two generation tracks and one shared quality gate. The Tutorial Agent autonomously picks the least-recently-updated domain, reads recent publishing history to avoid repeats, and drafts an in-depth tutorial. The News Agent runs a ReAct research loop armed with Tavily and Guardian search tools, then synthesizes the week's stories into a cited roundup. Every draft funnels into a Validator Agent that scores it against editorial standards — rejections route back with actionable feedback (bounded at three loops), approvals generate SEO metadata and publish markdown plus a JSON registry straight to Cloudflare R2 for a zero-build static frontend.
How the workflow runs
01 · Route
Entry router sends ainews requests to the News Agent; everything else enters the tutorial rotation.
02 · Select
Tutorial Agent scans per-domain last-updated dates in R2, picks the stalest domain, and reads its recent titles so new topics never collide with old ones.
03 · Research
News Agent's ReAct loop calls Tavily and Guardian search tools for top-3 stories of the past week, summarized with URL citations.
04 · Draft
Generation runs on Groq llama-3.3-70b at task-tuned temperatures — 0.8 topic ideation, 0.6 tutorials, 0.4 factual synthesis.
05 · Gate
The Validator returns strict JSON verdicts; rejected drafts loop back with folded-in critique until approved or the 3-revision budget is spent.
06 · Publish
Approved posts get title, meta description, slug, and read time, then land in R2 as markdown plus a date-sorted articles.json registry.
AI layer
- Groq inference
- All agents run on llama-3.3-70b-versatile via Groq — model swappable from settings.
- Tool-using researcher
- LangGraph's prebuilt ReAct orchestrator binds custom BaseTool wrappers for Tavily and Guardian into the news workflow.
- Editorial validator
- A strict JSON-verdict reviewer producing approval decisions, actionable feedback, and SEO metadata in one structured response.
Automation layer
- Autonomous topic rotation
- Domain selection is driven entirely by R2 registry timestamps — the system decides what to write about next.
- Bounded revision loop
- Conditional edges route rejections back to the originating agent with a hard cap, guaranteeing termination.
- Zero-build publishing
- A vanilla HTML/CSS/JS frontend renders published markdown directly from the R2 public bucket — no framework, no build step.
- Managed prompts
- Prompts versioned in Opik when configured, with local fallbacks baked into the repo so the pipeline never blocks.
Technical challenges
Autonomous topic selection could repeat recently covered subjects or fixate on one domain.
The agent reads the N most recent articles per domain from R2 as negative context, and domain choice is driven by least-recently-updated ordering — coverage rotates naturally.
News content must be factual, not hallucinated — raw LLM knowledge goes stale immediately.
The News Agent writes only from live Tavily/Guardian search context synthesized with citations, at reduced temperature for factual fidelity.
Unbounded revision loops between generator and critic could spin forever or churn quality downward.
The validator enforces a hard revision budget — after three rejections the best available draft is force-approved instead of the run failing.
Outcome
- One command produces a publish-ready article: topic selection, drafting, critique, revision, and deployment happen without human touch.
- Every published draft cleared an explicit editorial bar with SEO metadata generated at approval time.
- Coverage self-balances across six ML domains plus a weekly news cadence — no editorial calendar maintained by hand.
Lessons learned
- “Routing logic belongs in graph structure, not prompts — conditional edges made the two-track design trivially extensible.”
- “Critics need teeth: returning structured JSON verdicts with mandatory feedback turned revisions from cosmetic into substantive.”
- “Treating the registry as source of truth (timestamps drive topic rotation) let simple data modelling replace complex scheduling code.”