Blog Writing Agent
An end-to-end AI blog writing system built with FastMCP, LangGraph, FastAPI, and Next.js β featuring multi-tool research, human-in-the-loop review, and real-time streaming.
Ask AI about Blog Writing Agent
Powered by Claude Β· Grounded in docs
I know everything about Blog Writing Agent. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
π Blog Writing Agent - Full Stack Project
An AI-powered full-stack application that researches, plans, and drafts blog content using an agent workflow plus external tools.
π Table of Contents
- Demo Videos
- Problem This App Solves
- Problems in the Project
- What This Project Does
- Tech Stack
- Architecture Flow
- Project Areas
- Getting Started
- Environment Variables
- Current Status
- Next Milestones
- Planning Source
- Contributing
π¬ Demo Videos
Fast-Paced Highlight Reel
A quicker highlight reel of the main workflow and output.
Demo of Full Project on YouTube
π‘ Tip: Click the settings icon (βοΈ) in the video player and select Speed β 0.25x to watch at slower speed for better understanding.
Full Long Video
A complete end-to-end walkthrough of the project, including setup, workflow execution, and final output review.
π© Problem This App Solves
Writing a high-quality blog is usually slow and manual. Most people have to:
- Research multiple sources by hand
- Gather and organize facts manually
- Draft, edit, and rework the structure several times
If you only use a simple LLM, it often produces generic content from model memory and cannot reliably do live research, source gathering, and multi-step editorial refinement.
This app solves that by using an agent workflow that can:
- Do live research with tools
- Think in steps (plan before writing)
- Write section by section
- Edit and assemble a full draft
- Run critique and revision loops
- Support human review before generating the final blog
β οΈ Problems in the Project
There are still a few important problems we need to improve:
- The current Ollama-based workflow takes nearly 17 minutes to complete end to end
- Total token usage is very high, at roughly 86,000 tokens including input and output
- We should reduce runtime and token cost to make the system faster and more efficient
- Right now the agent is not a chat app after generation
- After a blog is generated, the user should be able to edit it, add headings, or make other changes using the LLM
- That post-generation editing flow would make the experience feel more like a chat-based assistant
π― What This Project Does
The Blog Writing Agent is a full-stack AI system where:
- The frontend collects prompts and presents progress/results.
- The backend runs a LangGraph workflow to coordinate writing steps.
- The MCP server provides tool-based research (search and page fetch).
ποΈ Architecture Flow
User Prompt
β
Frontend (Next.js)
β
Backend Orchestration (LangGraph/FastAPI layer)
β
MCP Tools (web search + fetch)
β
Plan β Draft β Edit β Critique β Final Output
π€ Workflow Nodes (Current Graph Design)
| Step | What it does |
|---|---|
| π Router | Determines whether external research is needed |
| π Research Query Generator | Creates search queries |
| π Researcher + Tool Loop | Calls tools and gathers source material |
| π§Ύ Summarizer | Condenses research into usable context |
| ποΈ Planner | Builds blog outline/tasks |
| βοΈ Task Executor | Writes sections |
| π§΅ Assembler + Editor | Combines and improves draft |
| π§ Critic | Requests revision loop or finalize |
| β Finalize (+ image planning/generation nodes) | Produces final result |
π οΈ Tech Stack
Backend
- Python 3.11+
- LangGraph + LangChain
- FastAPI (route layer present, partially scaffold-level)
- PostgreSQL-oriented checkpointing setup in current agent runner
Tool Server
- FastMCP
- Tavily-based search and page-fetch tooling
Frontend
- Next.js
- React
- TypeScript
- Tailwind CSS
π Project Structure
blog-writing-agent/
βββ frontend/ # Next.js frontend app
βββ backend/ # Agent workflow, nodes, API scaffolding
βββ mcp_server/ # FastMCP research tool server
βββ docs/ # Exported Notion project docs/tasks
βββ README.md
π Project Areas
- frontend/: user interface and client-side state
- backend/: workflow orchestration and backend modules
- mcp_server/: FastMCP tools used by the agent
- docs/: exported Notion planning/task documentation
π Getting Started
Prerequisites
- Python 3.11+
- Node.js 18+
- pnpm
- uv (recommended)
1) Run MCP Server
cd mcp_server
uv sync
uv run fastmcp run server.py
Optional SSE mode:
python server.py --sse
2) Run Backend Agent Workflow
cd backend
uv sync
python -m agent.main
3) Run Frontend
cd frontend
pnpm install
pnpm dev
Open: http://localhost:3000
π Environment Variables
Create service-local .env files where needed.
Common variables used across the repo/docs:
TAVILY_API_KEYMCP_AUTH_TOKENDB_URL(orDATABASE_URLin deployment-oriented docs)HORIZON_TOKENHUGGINGFACEHUB_API_TOKENNEXT_PUBLIC_BACKEND_URL
π Current Status
Implemented now:
- LangGraph workflow with multiple nodes and conditional edges
- MCP tool integration in the agent loop
- Notion-derived planning docs and task structure
Completed recently:
- Backend implementation is completed
- Frontend implementation is completed
- Total time spent on this complete project (browsing + coding), measured with WakaTime: 99 hours 47 minutes
Deployment status (current):
- MCP server is deployed
- Frontend is not deployed yet
- Backend is not deployed yet
Planned upgrades:
- Deploy frontend and backend in future milestones
- Use OpenAI models via API (cloud) in place of the current local Ollama/Qwen 3.5 setup
To avoid confusion, treat this repository as active development rather than a fully completed production release.
π οΈ Next Milestones
- Add richer end-to-end API + UI integration
- Expand structured test coverage across services
- Improve deployment automation and production configuration
- Add publish/export flows for generated blogs
- Add configurable writing styles and tone controls
πΊοΈ Planning Source
Primary planning source:
- Notion project: https://southern-dogsled-629.notion.site/Blog-Writing-Agent-Full-Stack-Project-32fc1cfa959c8192abaffdc427593c41
- Exported docs in this repo:
docs/
π€ Contributing
- Create a feature branch.
- Keep changes focused by service.
- Update docs for behavior changes.
- Open a PR with testing notes.
