Spaces:
Sleeping
Sleeping
metadata
title: Blog-Writing-Agent
emoji: π
colorFrom: blue
colorTo: green
sdk: docker
app_file: main.py
pinned: false
short_description: This is the Agentic Blog Writing Agent
βοΈ Bloggig - AI Blog Writing Agent
Bloggig is a sophisticated AI-powered agent designed to transform a single topic into a professional, research-backed blog post complete with AI-generated visuals. Built with LangGraph and FastAPI, it orchestrates a complex pipeline of research, planning, writing, and image generation to deliver high-quality content in real-time.
π Key Features
- π Autonomous Research: Integrates with Tavily AI to perform deep web searches and gather factual evidence.
- π Intelligent Planning: Generates structured blog plans tailored to specific audiences and tones.
- βοΈ Parallel Writing Pipeline: Uses a worker-reducer architecture to generate multiple blog sections simultaneously for maximum efficiency.
- π¨ AI-Generated Visuals: Automatically plans and generates relevant images using Stable Diffusion XL (via Hugging Face Inference).
- π» Modern ChatGPT-like UI: A sleek, dark-themed dashboard featuring:
- Real-time Streaming: Watch the AI's "thought process" and pipeline progression via WebSockets.
- Markdown Rendering: Beautifully formatted blog previews with syntax highlighting.
- History Management: Browse, view, and manage previously generated blogs.
- π¦ Export & Management:
- Download as ZIP: Get the full markdown file along with all generated image assets.
- Clean Deletion: Permanent removal of blogs and their associated images with a single click.
π οΈ Tech Stack
- Backend: FastAPI, LangGraph, Pydantic, Uvicorn.
- AI Models: Bedrock Converse API (LLM), Stable Diffusion XL (Images).
- Search Engine: Tavily AI.
- Frontend: Semantic HTML5, Vanilla CSS (Glassmorphism), Marked.js, Highlight.js.
- Tools: UV (Python package manager), Git.
βοΈ Installation & Setup
1. Clone the Repository
git clone https://github.com/VashuTheGreat/Blog-Writing-Agent.git
cd Blog-Writing-Agent
2. Install Dependencies
Using uv (recommended):
uv sync
Or using pip:
pip install -r requirements.txt
3. Environment Variables
Create a .env file in the root directory and add your credentials:
HF_TOKEN=your_huggingface_token
TAVILY_API_KEY=your_tavily_api_key
AWS_ACCESS_KEY_ID=your_aws_key
AWS_SECRET_ACCESS_KEY=your_aws_secret
AWS_REGION=your_aws_region
π Running the Application
Start the FastAPI server:
python Application/app.py
The application will be available at http://localhost:8000.
π Project Structure
Application/: Contains the web server (app.py) and the frontend (index.html).src/graph/: Core LangGraph implementation (nodes, edges, and logic).src/components/: External integrations (Tavily search, Image generation).src/models/: Pydantic models for state management and structured output.results/: Directory where generated markdown blogs are saved.images/: Directory where generated images are stored.src/utils/: Utility functions (e.g., blog deletion logic).
π License
This project is licensed under the MIT License - see the LICENSE file for details.
