~/projects/blog-writing-agent.md

Blog Writing Agent

P / 01Agentic AI

A LangGraph agent that writes a blog post from a topic: it decides whether the topic needs fresh web facts, plans the post, and writes every section in parallel.

sections written in parallel
4–6
LLM calls per post
5–8
to write a post
~2 min

Repository (opens in a new tab)All projects

How it works

hybrid / open_bookclosed_bookSend per section STARTrouterpicks a moderesearchTavily, optionalorchestratorplans 4–6 sectionsworker 1section 1worker 2section 2worker Nsection Nimagesoptionalreducerorder · cite · saveENDROUTE · CLOSED BOOKROUTE · WITH RESEARCH
How Blog Writing Agent works. Routes: closed book: START to router to orchestrator to worker 1 to images to reducer to END. with research: START to router to research to orchestrator to worker 2 to images to reducer to END.
  • closed book: START → router → orchestrator → worker 1 → images → reducer → END
  • with research: START → router → research → orchestrator → worker 2 → images → reducer → END

What it does

  • Fans out with LangGraph Send: one worker per planned section (4 to 6), merged back by an operator.add reducer.
  • No invented links: any Markdown link whose URL is not in the supplied evidence is turned back into plain text.
  • Honest about thin research: with fewer than 3 distinct sources, the post opens with a note saying so.
  • Quota-aware: every call goes through one cached, rate-limited path with backoff and an outage breaker.

Stack

  • LangGraph
  • LangChain
  • Gemini
  • Tavily
  • Pydantic
  • Streamlit