AI-powered blog content generation with intelligent style matching and multi-agent orchestration.
Blog Agents is a sophisticated content generation system that uses multiple AI agents to create high-quality blog posts that match the style and voice of any reference blog or publication. Built with the OpenAI Agents SDK, it provides a comprehensive workflow from style analysis to final SEO optimization.
- Analyzes reference blogs to extract writing patterns, tone, and voice
- Supports specific reference pages for focused style analysis
- Matches headline structure, paragraph flow, and vocabulary
- Preserves authentic voice while creating original content
- Generate topic ideas based on reference blog style
- Target specific keywords for SEO optimization
- Include product/page targets for content promotion
- Automatic duplication detection against existing content
- Google Trends integration for trending keywords
- Google Ads API integration for search volume and competition data
- Web search integration for up-to-date information
- Content duplication detection to ensure originality
- Multi-perspective research with source validation
- SEO-optimized internal linking
- Comprehensive SEO performance analysis
- Style Analyzer: Extracts writing patterns from reference content
- Content Checker: Identifies potential duplicates and suggests differentiation
- Research Specialist: Gathers relevant facts, statistics, and insights
- Content Writer: Creates engaging, well-structured blog posts
- Internal Linker: Adds strategic internal links for SEO
- Content Editor: Polishes grammar, flow, and readability
- SEO Analyzer: Provides actionable SEO recommendations
- Google Sheets integration for content history
- Automatic topic caching to prevent duplicates
- Track used vs. unused topic ideas
- Performance analytics by reference blog
- Clean Streamlit web interface
- Real-time progress tracking
- Tabbed output for easy content review (Final Post, Style Guide, Research, SEO Analysis)
- Multiple download formats (Markdown, HTML, Word Document, JSON)
- Content history viewer
- Python 3.8+
- OpenAI API key with Agents SDK access
-
Clone the repository
git clone https://github.com/tomleelong/BlogAgents.git cd BlogAgents -
Set up virtual environment
python3 -m venv openai-agents-env source openai-agents-env/bin/activate # macOS/Linux # openai-agents-env\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt
-
Configure environment
cp .env.example .env # Edit .env to add your OPENAI_API_KEY
streamlit run app.pyOpen your browser to http://localhost:8501
python blog_orchestrator.pyAll models support WebSearchTool for style analysis and research:
- gpt-5: Main reasoning model with advanced capabilities
- gpt-5-mini: Efficient version with balanced performance
- gpt-5-nano: Fastest version for quick generation
- gpt-4o: Flagship multimodal model
- gpt-4o-mini: Cost-effective with good performance
- chatgpt-4o-latest: Latest updates and improvements
- gpt-4.1: Latest flagship coding-optimized model
- gpt-4.1-mini: Cost-effective GPT-4.1 variant
- Keyword Research: Fetches trending keywords via Google Trends
- Topic Ideas: AI generates topic ideas with target keywords and angles
- Enrichment: Adds search volume, competition, and trend data
- Duplication Check: Compares against existing blog topics from RSS feed
- Selection: Choose a topic and transfer to blog generator
- Style Analysis: Analyzes reference blog for writing patterns (optionally from specific pages)
- Duplication Check: Searches for existing content on the topic
- Research: Gathers comprehensive information and insights
- Content Creation: Writes blog post matching the analyzed style with product/page targeting
- Internal Linking: Adds strategic internal links for SEO
- Editing: Polishes content while preserving style and links
- SEO Analysis: Provides optimization recommendations
OPENAI_API_KEY=your_openai_api_key_here# OpenAI Organization
OPENAI_ORG_ID=your_org_id_here
# Google Sheets Integration
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
# Google Ads API (for keyword research)
GOOGLE_ADS_DEVELOPER_TOKEN=your_developer_token
GOOGLE_ADS_CLIENT_ID=your_client_id
GOOGLE_ADS_CLIENT_SECRET=your_client_secret
GOOGLE_ADS_REFRESH_TOKEN=your_refresh_token
GOOGLE_ADS_CUSTOMER_ID=your_customer_idNote: Google Trends keyword research works without Google Ads API, but provides trend-based estimates instead of actual search volume data.
- Input validation and sanitization
- URL validation with SSRF protection
- Rate limiting and timeout controls
- Secure API key handling
The system generates:
- Final Blog Post: Polished, style-matched content with internal links
- Style Guide: Extracted writing patterns and guidelines
- Research Data: Comprehensive topic research and insights
- Writer Draft: Initial content before SEO optimization
- Content With Links: Blog post with strategic internal linking
- SEO Analysis: Comprehensive performance analysis and recommendations
- Markdown (.md)
- HTML (.html)
- Microsoft Word (.docx)
- JSON (complete results data)
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For support, please open an issue on GitHub or contact Bertram Labs.
Built with β€οΈ by Bertram Labs
Professional AI Solutions & Custom Development