AI Blog Generation
Bellamy Book offers an integrated AI-powered system for automated blog content generation. This feature allows administrators to schedule daily blog posts or manually trigger blog generation on specific topics. It leverages advanced AI models for content, image, and SEO generation, along with research services to create high-quality, relevant drafts.
License
AI Blog Generation is a license-gated feature. It is only available when the aiBlogGeneration feature flag is enabled in your license tier.
How it works (Worker Flow)
- Scheduled or Manual Trigger: Blog generation can be triggered automatically via a configurable cron schedule or manually by an administrator through the Admin Panel.
- Request Queuing: When triggered, a
BlogGenerationRequestMessageis published to a RabbitMQ queue (viaMassTransit). - Worker Consumption: The
BlogAutoGenerationWorker(a separate background service) consumes these messages. - Research Phase: The worker utilizes various research services to gather relevant data for the specified topic:
- Tech Trend Research
- Crypto Market Research
- Sentiment Analysis
- (Optional: Market Trend, Trending Tech, Trending Gear research services can be enabled).
- Research data is cached to optimize costs and speed.
- AI Content Generation: Using an OpenAI (GPT-3.5/GPT-4) or Anthropic content model, the worker generates the main blog content based on a configurable prompt template, target word count, and content style.
- AI Image Generation: If enabled, DALL·E (DALL·E 3 by default) is used to generate a cover image and additional content images. An intelligent image placement strategy integrates these into the blog content.
- SEO Generation: Automated SEO optimization (meta title, description, keywords, tags) is performed, again using AI models.
- Draft Saving: All generated blogs are saved as drafts in the system, awaiting review and publication by an administrator.
- Logging & Cost Tracking: The worker logs each generation attempt and tracks API costs for transparency.
Admin Panel Features
Administrators manage the AI Blog Generation feature through dedicated sections in the Admin Panel:
AI Agent Settings (/settings/ai-agent)
- Enable/Disable: Toggle the entire AI blog generation system.
- Schedule: Configure a
cron expressionfor automated daily blog generation (e.g.,0 2 * * *for 2 AM daily). - Blogs Per Day: Set the number of blogs to generate per scheduled run.
- Default Author/Tags: Configure the default author and tags for generated blogs.
- AI Provider: Set OpenAI API Key (or Anthropic), choose Content Model (
gpt-3.5-turbo,gpt-4, etc.), Image Model (dall-e-3),Max Tokens, andTemperature. - Content: Define
Target Word Count,Content Style(e.g., professional, casual),Topic Keywords, and a customContent Prompt Template. - Images: Enable/disable
Cover Image Generation, setContent Images Per Blog, andImage Placement Strategy. - SEO: Enable/disable
Auto-Generate SEOand configureSEO Settings. - Research: Enable/disable various research services (
Tech Trend,Crypto Market,Sentiment Analysis, etc.) and setResearch Cache Hours. - API Key Test: Test the configured OpenAI API key for validity.
- Manual Generation: Trigger a blog generation immediately for a specified topic.
AI Agent Logs (/settings/ai-agent/logs)
- View a paginated list of all blog generation attempts, including status (Success, Failed, InProgress), topic, generated blog ID, error messages, and duration.
- Filter logs by status, date range, and view detailed log information.
AI Agent Cost Dashboard (/settings/ai-agent/costs)
- Monitor AI API usage costs over selectable periods (e.g., last 7, 30, 90 days).
- Provides insights into token usage, image generation counts, and estimated expenditures.
API Endpoints (via api/ai-agent)
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/ai-agent/settings | Retrieve current AI Agent settings |
| PUT | /api/ai-agent/settings | Update AI Agent settings |
| POST | /api/ai-agent/settings/test-api-key | Test configured OpenAI API key |
| POST | /api/ai-agent/generate | Manually trigger blog generation (body: topic?) |
| GET | /api/ai-agent/logs | Get paginated generation logs (query: page, pageSize, status, startDate, endDate) |
| GET | /api/ai-agent/logs/:id | Get specific generation log by ID |
| GET | /api/ai-agent/metrics | Get generation metrics (query: days) |
| GET | /api/ai-agent/costs | Get cost tracking dashboard data (query: days) |
| GET | /api/ai-agent/status | Get status of the BlogAutoGenerationWorker |
Related
- Admin Panel — all admin features
- Features overview
- API structure — backend route prefixes