π§ Autonomous AI Agents for Blog Writing This project uses a team of AI agents that collaborate to automatically write and publish blog posts. The system simulates a writer's workflow by combining GPT assistants, a web browser, and research tools to generate high-quality content and publish it as a draft on Ghost CMS.
Great for marketers, developers, bloggers, or anyone curious about using AI as a writing assistant β from idea generation to browser-based publishing.
π What It Does Scrapes trending article ideas from Medium using browser automation. Chooses the best ideas using an OpenAI GPT agent. Researches the chosen topic using the Perplexity API. Generates a full blog post with another GPT agent. Logs into Ghost CMS and publishes the draft using a real browser. Optional dashboard with Streamlit for visual feedback and progress control. π¦ Requirements Python 3.9+ Google Chrome The following Python packages (install with pip install -r requirements.txt): streamlit openai langchain langgraph pydantic playwright selenium beautifulsoup4 browser-use π Setup API Keys OpenAI API Key Perplexity API Key Assistant IDs for the GPTs you set up in OpenAI Browser Path Set your local Chrome path in blog_pipeline.py:
chrome_path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" Ghost CMS Credentials Ghost admin must be accessible at:
https://your-site.ghost.io/ghost Optional Store your API keys in a .env file and load them using:
import os os.environ.get("OPENAI_API_KEY") π§ͺ Run the Project CLI Mode python blog_pipeline.py This will:
Scrape titles Pick one Research Write Log into Ghost CMS and publish Streamlit Dashboard streamlit run dashboard.py You'll get an interactive dashboard to monitor agent activity and blog content at each step.
π Project Structure . βββ blog_pipeline.py # Main pipeline with agent collaboration βββ dashboard.py # Optional Streamlit UI βββ browser_use.py # Ghost CMS login and post logic βββ requirements.txt # Python dependencies π§ How It Works Agents communicate by passing messages and memory between each step:
π§ Idea Agent filters scraped titles. π Research Agent uses Perplexity for gathering facts and structure. βοΈ Writing Agent builds a complete blog using research and structure. π Publishing Agent opens Chrome and uploads it to Ghost CMS. π Logs and states are displayed in the Streamlit dashboard for visibility. π§° Tech Stack GPT Assistants API from OpenAI Perplexity API for real-time search-based knowledge Browser Use (Playwright) for browser control Streamlit for visual UI Ghost CMS for final publishing π Contributing Ideas, bug fixes, and PRs are welcome! Open an issue or fork the project to help expand this multi-agent publishing pipeline.