AI Actions

Technical fundamentals and practical examples for the use of AI Actions

AI Actions enable natural conversation. They keep the conversation going and can draw users' attention to relevant product information. 
This article describes how to create the following AI Actions in the moinAI Hub:

  1. Action
  2. Follow-up
  3. Web search

Action

Actions include general webhooks. They are useful for integrating external systems into the conversation. Typical use cases are availability queries, shop searches, or connection to the ticket system. The settings are described below.

Set up an action (based on the example of Shopify)

The product search action requires a functioning Shopify integration, which is described in this article.

The implementation in the Hub is as follows:

  1. Create an agent for the product search: The first step is to create a new agent (article).
  2. Assign at least one source: At least one source must be assigned to the new agent (article).

  3. Create webhook: The next step is to create a webhook (article).
  4. Create action: Step-by-step instructions follow.
    (1) Under the Knowledge Base menu item, click the RAG button to open the RAG Management view. Click Add Action in the Actions & Follow-Up card to open a new input mask for creating an action.


    (2) All settings are defined under the Actions tab.

    1. Tool description: Brief description of what the action is to be used for.
    2. Instructions before: If the product search takes longer, you can specify what the agent should do while the customer waits, e.g. that they are currently searching for the requested products.
    3. Instructions after: Specification of how the products should be displayed.
      Note: Only text is currently supported. Additional output options are in the planning stage.

      (3) Parameters: Parameters define what the search query looks like. Clicking on the plus symbol opens the input fields. The parameter must be named identically to the variable in the webhook body. In the example, the parameter of type string is used:
      : \”{{query}}\”)  other values (Boolean value or number) can also be set here.
      .  
  5. Syntax: Shopify expects a specific query syntax, which must be defined in the AI Action. The following example performs a product search that filters by title and product category. It also specifies which product types are available: 
    ‘title:*vans* OR product_type:Shoes’



    The more complex a search agent is, the less reliable it is. Multiple AI actions with clearly defined purposes increase the stability and accuracy of the results.

    • Click Save to apply the settings.
  6. Test agent
    • Once the agent is active, it can be tested in the AI Playground. By clicking on Generate Answer, the AI Action performs a product search matching the user's query.
    • By clicking on the arrow next to Used Action, details such as parameters and product data can be viewed and adjusted to optimise the AI Action.


Further tips and optimisations

AI Actions can also be expanded to enable more complex searches, e.g. by brand, category or price range.

Example:

A request such as ‘Search for Nike children's shoes between £50 and £100’ is translated into the following search query: vendor:‘nike’ AND tag:‘kid’ AND price:>50 AND price:<100

Implementation in 3 steps:

  1. Export all vendors, tags and product types as CSV from Shopify or create them manually.

  2. Import the CSV files into the agent's knowledge base.

  3. Customise the description of the query parameter in the AI action.



Die Query für Shopify SearchProducts products(query). Auf folgende Eigenschaften kannst du Suchen, inkl. Beispiel:
- title - title:*vans*
- tags - tag:'kid'
- product_type - product_type:Shoes
- vendor - vendor:'vans'
- price - price:>50 AND price:<100

Beispiele:
"Ich suche den x100 Damenschuh"
-> "title:*x100* AND tag:'woman' "

 

Follow-Up

This article describes how to set up a follow-up AI action.

Web search

With web search, the chatbot answers questions based on content from a domain without having to manually store it as a resource. The method is similar to a Google search on a specific domain to find relevant information and extract knowledge from it to answer user queries.

Web search is useful for constantly updated content. For product details, navigation to links is more useful than direct answers. The following explains how to set up web search and provides advice for using it.

Set up web search

The web search performs a semantic Google web search.

If source search and web search are activated at the same time, web search is only used if the agent cannot find an answer in the stored sources.

  1. Setting up web search requires some default settings that can only be configured by the CSM team. The CSM team is available to answer any questions and provide support in setting up web search.
  2. In the Knowledge Base menu item, the RAG Management view opens via the RAG button. A new input mask opens via Add Action in the Actions & Follow-Up card.
  3. In the window under the Web Search section, the following is defined in the fields
    1. Action Name: the display name of the web search,
    2. Search results from site: the domain for the web search.
      Important: Only domains can be specified, not subdomains. E.g. ✅ moin.ai, ❌ moin.ai/blog
    3. In the Optional section, instructions are stored before and after the web search results are displayed.
      Recommendation: It improves the customer experience if the AI chatbot transparently indicates that it is searching the internet during the waiting time.

Example

Answer generation without web search

.  

Answer generation with web search

.  

Web search is currently only available in English. This means that for multilingual websites, English is always used to generate responses. The expansion to other languages is currently in development and will be available with the next moinAI updates.

Advice on using web search

Web search is recommended for the following use cases:

  • Supplementary as a fallback option to supplement resources
  • For websites that are updated daily (e.g. event pages, weather, etc.)


Why web search should not be set as default:

  • Longer loading time: Uploading resources directly to the knowledge base results in a faster response than web search. This leads to a better customer experience.
  • Less control: Web search is based on Google rankings. Relevant pages that rank poorly may not be found. Outdated website information with better Google rankings is preferred over more current information with poorer rankings.
  • More hallucinations: Web search is much more prone to AI hallucinations than accessing resources in the knowledge base.

Uploading resources directly to the knowledge base results in a faster response than using the web search function.