Skip to main content

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)

  1. Scheduled or Manual Trigger: Blog generation can be triggered automatically via a configurable cron schedule or manually by an administrator through the Admin Panel.
  2. Request Queuing: When triggered, a BlogGenerationRequestMessage is published to a RabbitMQ queue (via MassTransit).
  3. Worker Consumption: The BlogAutoGenerationWorker (a separate background service) consumes these messages.
  4. 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.
  5. 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.
  6. 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.
  7. SEO Generation: Automated SEO optimization (meta title, description, keywords, tags) is performed, again using AI models.
  8. Draft Saving: All generated blogs are saved as drafts in the system, awaiting review and publication by an administrator.
  9. 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 expression for 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, and Temperature.
  • Content: Define Target Word Count, Content Style (e.g., professional, casual), Topic Keywords, and a custom Content Prompt Template.
  • Images: Enable/disable Cover Image Generation, set Content Images Per Blog, and Image Placement Strategy.
  • SEO: Enable/disable Auto-Generate SEO and configure SEO Settings.
  • Research: Enable/disable various research services (Tech Trend, Crypto Market, Sentiment Analysis, etc.) and set Research 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)

MethodEndpointDescription
GET/api/ai-agent/settingsRetrieve current AI Agent settings
PUT/api/ai-agent/settingsUpdate AI Agent settings
POST/api/ai-agent/settings/test-api-keyTest configured OpenAI API key
POST/api/ai-agent/generateManually trigger blog generation (body: topic?)
GET/api/ai-agent/logsGet paginated generation logs (query: page, pageSize, status, startDate, endDate)
GET/api/ai-agent/logs/:idGet specific generation log by ID
GET/api/ai-agent/metricsGet generation metrics (query: days)
GET/api/ai-agent/costsGet cost tracking dashboard data (query: days)
GET/api/ai-agent/statusGet status of the BlogAutoGenerationWorker