Skip to main content

Overview

A 5-stage pipeline that researches AI news, checks for duplicates, and publishes Gutenberg-formatted posts to WordPress.

Decision Flow

Quick Start

1. Install Dependencies

pip install praisonai praisonai-tools praisonaiwp

2. Set Environment

export TAVILY_API_KEY="your-key"
export OPENAI_API_KEY="your-key"

3. Create Files

framework: praisonai
topic: "AI developments {{today}}"

roles:
  topic_gatherer:
    role: AI News Researcher
    goal: Find current AI news topics
    tools:
      - tavily_search
    tasks:
      gather:
        description: |
          Search for AI news from {{today}}.
          Find 5-10 specific developments.
        expected_output: List of topics with URLs

  duplicate_checker:
    role: Deduplication Agent
    tools:
      - check_duplicate
    tasks:
      check:
        description: |
          {{previous_output}}
          Check each topic. Find ONE unique topic.
        expected_output: One unique topic

  deep_researcher:
    role: Content Researcher
    tools:
      - tavily_search
      - crawl_url
    tasks:
      research:
        description: |
          {{previous_output}}
          Crawl 3+ URLs. Extract facts and statistics.
        expected_output: Research summary

  content_writer:
    role: Blog Writer
    tasks:
      write:
        description: |
          {{previous_output}}
          
          Write in GUTENBERG FORMAT:
          - <!-- wp:paragraph --><p>text</p><!-- /wp:paragraph -->
          - <!-- wp:heading --><h2>title</h2><!-- /wp:heading -->
          - <!-- wp:html --><table>...</table><!-- /wp:html -->
          
          Output:
          ARTICLE_TITLE: [your title]
          ARTICLE_CONTENT: [Gutenberg blocks]
        expected_output: ARTICLE_TITLE and ARTICLE_CONTENT

  publisher:
    role: WordPress Publisher
    tools:
      - create_wp_post
    tasks:
      publish:
        description: |
          {{previous_output}}
          Extract title and content. Call create_wp_post.
        expected_output: Published post ID

4. Run

praisonai workflow run workflow.yaml

Architecture

Tools Reference

ToolPurposeReturns
tavily_searchAI-powered web searchResults with URLs
crawl_urlExtract page contentTitle + content
check_duplicateSemantic similarity check{has_duplicates: bool}
create_wp_postPublish to WordPress{post_id: int}

Gutenberg Blocks

Use these block formats in content:
BlockFormat
Paragraph<!-- wp:paragraph --><p>text</p><!-- /wp:paragraph -->
Heading<!-- wp:heading --><h2 class="wp-block-heading">title</h2><!-- /wp:heading -->
Table<!-- wp:html --><table>...</table><!-- /wp:html -->
List<!-- wp:list --><ul class="wp-block-list"><li>item</li></ul><!-- /wp:list -->
Separator<!-- wp:separator --><hr/><!-- /wp:separator -->

Title Validation

The create_wp_post tool blocks invalid titles:

Troubleshooting

IssueCauseFix
Title “VERIFIED”Agent prefix in outputRemove quality checker stage
Empty contentContext not passedUse {{previous_output}}
Outdated newsNo date filterAdd {{today}} to search
Raw HTML tablesWrong block formatUse <!-- wp:html --> for tables