Skip to Content
TutorialHow to Build an AI Smart Tagger?

https://editor.momen.app/tool/z7Bx4APAo7X/WEB?code=b9P5pHc4xubKD

Tutorial Video

https://www.youtube.com/watch?v=a5XvuI-eSL8

Introduction

  • Goal: Automatically analyze an article’s title and content to extract 3–5 relevant keywords and save them as associated tags in the database.
  • Applicable Scenario: Content management systems (CMS), blog platforms, or automated SEO tagging tools.
  • Core Logic: UI Input -> Actionflow (AI Agent Analysis -> Insert Article -> Loop Insert Tags) -> Database Storage.

Steps

Data Storage

First, define the relational structure to store articles and their corresponding tags.

  • Data Model:

    Table NameField NameTypeNote
    articletitleTextThe headline of the article.
    contentTextThe main body of the article.
    tagnameTextThe keyword extracted by AI.
  • Relationship: Create a One-to-Many (1:N) relationship from article to tag. One article can have multiple tags, and each tag belongs to one specific article.


Logic & State Configuration

AI Agent Configuration

Switch to the AI tab to create an agent that handles the natural language processing.

  1. Inputs: Add two Text variables: title and content.
  2. Prompt template:
    • Role: You are a professional Content Analysis Assistant.
    • Goals: Extract 3 to 5 core keywords/tags based on the input content. Ignore irrelevant information and ensure the tags accurately summarize the core main idea.
    • Context Reference: Reference the inputs using {{Input/title}} and {{Input/content}}.
  3. Outputs: Set the type to Structured.
    • Define an object body containing an ARRAY(STRING) named tag. This ensures the AI returns a list of strings that the system can iterate through.

Actionflow Construction

Navigate to the Actionflow tab to build the backend logic.

  • Name: AI Auto Tagging
  • Execution Mode: Set to Async.
  • Nodes:
    1. Input Node: Define title and content as input parameters.
    2. AI Node: Select the agent_smart_tagging. Bind its inputs to the Actionflow’s input parameters.
    3. Insert Data (save article): Insert a record into the article table using the inputs.
    4. Loop (loop save tags):
      • Datasource: Select the tag array returned by the AI node (AI node.body.tag).
    5. Insert Data (save tag): Inside the loop, insert a record into the tag table.
      • name: Bind to item (the current tag in the loop).
      • article_id: Bind to the id generated by the previous “save article” node.

Because the AI returns multiple tags, a Loop node is necessary to create individual database records for each keyword while linking them to the parent article ID.


UI Construction & Interaction

  1. Component Tree:
    • Text Input (title)
    • Text Input (content)
    • Button (Get Started)
  2. Interaction:
    • Select the Button.
    • Go to the Action panel -> On click -> Actionflow.
    • Choose AI Auto Tagging.
    • Data Binding:
      • title -> Text input title.value
      • content -> Text input content.value


Verification

  1. Enter Preview Mode.
  2. Paste a sample article title and body into the inputs.
  3. Click the Get Started button.
  4. Check the Data (Database) tab:
    • Verify a new record exists in the article table.
    • Open the tag table to see the keywords extracted by the AI, all correctly linked to the article’s ID.

Last updated on