Skip to content

KA18202005/LangGraph-Blog-Writing-Agent

Repository files navigation

πŸš€ LangGraph Blog Writing Agent

An AI-powered Blog Writing Agent built using LangGraph, LangChain, Google Gemini, and Tavily Search. This project demonstrates the evolution of a blog-writing agent from a basic implementation to a research-enhanced, image-capable workflow while also providing a frontend and backend application for generating high-quality blog content.

✨ Features

  • πŸ“ Generate complete blog articles from a topic
  • πŸ” Research-powered content generation using Tavily Search
  • 🧠 Multi-step agent workflow with LangGraph
  • 🎯 Improved prompting techniques for better outputs
  • πŸ–ΌοΈ AI-assisted image generation support
  • 🌐 Interactive frontend application
  • ⚑ Backend API for blog generation
  • πŸ“š Progressive learning notebooks demonstrating agent development

πŸ—οΈ Project Structure

LangGraph-Blog-Writing-Agent/
β”‚
β”œβ”€β”€ bwa_frontend.py
β”œβ”€β”€ bwa_backend.py
β”‚
β”œβ”€β”€ 1_bwa_basic.ipynb
β”œβ”€β”€ 2_bwa_improved_prompting.ipynb
β”œβ”€β”€ 3_bwa_research.ipynb
β”œβ”€β”€ 4_bwa_research_fine_tuned.ipynb
β”œβ”€β”€ 5_bwa_image.ipynb
β”‚
β”œβ”€β”€ tavily_test.ipynb
β”‚
β”œβ”€β”€ ai_unpacked_the_weeks_top_developments_in_funding_research_and_regulation_may_24-31_2026.md
β”‚
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .gitignore
└── README.md

πŸ“– Notebook Roadmap

1️⃣ Basic Blog Writing Agent

File: 1_bwa_basic.ipynb

  • Introduction to LangGraph
  • Basic blog generation workflow
  • Single-agent content creation

2️⃣ Improved Prompting

File: 2_bwa_improved_prompting.ipynb

  • Advanced prompt engineering
  • Better structure and readability
  • Enhanced blog quality

3️⃣ Research Agent

File: 3_bwa_research.ipynb

  • Integrates external research
  • Uses search tools for fact gathering
  • Produces more informative content

4️⃣ Fine-Tuned Research Workflow

File: 4_bwa_research_fine_tuned.ipynb

  • Improved research pipeline
  • Better source utilization
  • Higher quality article generation

5️⃣ Image-Enhanced Blog Agent

File: 5_bwa_image.ipynb

  • Adds image generation capabilities
  • Creates richer blog content
  • Demonstrates multimodal workflows

πŸ› οΈ Tech Stack

AI & Agent Frameworks

  • LangGraph
  • LangChain

LLM

  • Google Gemini

Search & Research

  • Tavily Search API

Frontend

  • Streamlit

Backend

  • Python

Utilities

  • Python Dotenv
  • Requests

βš™οΈ Installation

Clone Repository

git clone https://github.com/KA18202005/LangGraph-Blog-Writing-Agent.git
cd LangGraph-Blog-Writing-Agent

Create Virtual Environment

python -m venv venv

Windows

venv\Scripts\activate

Linux/macOS

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

πŸ”‘ Environment Variables

Create a .env file in the project root:

GOOGLE_API_KEY=your_google_api_key
TAVILY_API_KEY=your_tavily_api_key

▢️ Running the Application

Start Backend

python bwa_backend.py

Start Frontend

streamlit run bwa_frontend.py

Open the local Streamlit URL displayed in the terminal.


πŸ”„ Agent Workflow

User Topic
     β”‚
     β–Ό
Planning Agent
     β”‚
     β–Ό
Research Agent
     β”‚
     β–Ό
Content Generation Agent
     β”‚
     β–Ό
Refinement Agent
     β”‚
     β–Ό
Image Generation
     β”‚
     β–Ό
Final Blog Output

πŸ“„ Sample Output

The repository includes an example generated article:

ai_unpacked_the_weeks_top_developments_in_funding_research_and_regulation_may_24-31_2026.md

This demonstrates the quality and structure of the generated blog content.


🎯 Learning Outcomes

By exploring this project, you'll learn:

  • LangGraph fundamentals
  • Agent-based workflow design
  • Prompt engineering techniques
  • Research-Augmented Generation (RAG)
  • Search tool integration
  • AI content creation pipelines
  • Streamlit application development

πŸš€ Future Improvements

  • Multiple LLM support
  • SEO optimization module
  • Blog export to PDF/DOCX
  • Citation generation
  • Multi-language blog generation
  • Publishing directly to CMS platforms

🀝 Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
git checkout -b feature-name
  1. Commit your changes
git commit -m "Add feature"
  1. Push to GitHub
git push origin feature-name
  1. Open a Pull Request

⭐ Support

If you found this project helpful:

  • ⭐ Star the repository
  • 🍴 Fork the repository
  • πŸš€ Share it with others

πŸ‘¨β€πŸ’» Author

Kavya Agarwal

GitHub: https://github.com/KA18202005


Built with ❀️ using LangGraph, LangChain, Gemini, and Tavily Search.

About

A blog writing Agent using AI which generate a perfect blog with images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors