AI Assistants

This documentation will showcase how to build and use AI Assistants in m-Power.

The AI Assistant is built within the AI Studio and is used to integrate dynamic AI features into your applications. While most visibly consumed as a chatbot, the AI Assistant can alternatively be invoked “behind-the-scenes” via the workflow designer of an m-Power maintainer application, allowing developers to utilize AI to assist with automated workflow processes.

Why would I use the AI Assistant?

In the simplest of terms, the AI Assistant can be thought of—and will often be referenced in this document—as a “chatbot.” Many m-Power developers have likely already interacted with chatbots in some capacity, with notable examples being OpenAI’s ChatGPT, Google’s Gemini, or Microsoft’s Copilot. These chatbots are powered by what are generally referred to as Large Language Models (LLMs).

However, the capability of AI extends far beyond just holding a conversation. With the m-Power AI Assistant, the developer is ultimately responsible for defining the purpose and functionality of the chatbot, providing strict instructions and guidelines for what it can (and cannot) do.

In the same vein, developers can empower their AI Assistant to query live database information in real-time, process incoming parameters, and trigger workflow actions based on the chatbot’s response.

Creating an AI Assistant

The AI Assistant is managed inside of the AI Studio. To create a new Assistant:

  1. Click the + New Assistant button on the left-side panel.
  2. Select the Type:
    • General Purpose — Ideal for standard chatbots, workflow automation, and custom text-based interactions. The remainder of this document focuses entirely on General Purpose assistants.
    • Data Analytics — Specialized assistants that dynamically write their own SQL queries based on dictionary metadata provided by the developer, delivering precise data results to the user without relying on pre-built tools. Learn more about Data Analytic assistants here.
  3. Give the assistant a name and an optional description.

After creating, the developer will be shown the assistant diagram inside the AI Studio.

System Prompt

The System Prompt page defines the AI Assistant’s identity and instructions.

By clicking into the System Prompt, a developer writes specific guidelines dictating the assistant’s purpose, how it should behave, and what format its output should take. To use an analogy, this is the “job description” for your chatbot.

Developers can use the Insert Fields dropdown to append fields/parameters into the body of the system prompt to be used in conjunction with the prompt instructions.

At runtime, these text-based instructions are automatically passed to the LLM behind the scenes whenever a user sends a message. The information here is largely static—meaning the rules defined here dictate the boundaries of the entire interaction.

Any new assistant will generate a default set of instructions, which you should modify to fit your specific business needs.

Any instructions given to an LLM are subject to natural variability, which impacts the accuracy of the chatbot’s responses. To get off to a strong start, please see our guide on Writing a System Prompt for AI

User Message Template

The User Message template defines the exact input (data) sent to the AI Assistant.

In a standard chatbot, the default input is simply the text the user types into the chat interface. This entire message is encapsulated in the ${userMessage} parameter.

However, there are situations where the AI Assistant is not interacted with directly via a chat interface. Instead, it might be called “behind-the-scenes” by another m-Power application’s workflow. In those scenarios, you need to pass parameters from the workflow designer directly to the AI Assistant. The User Message Template can be customized to define these dynamic inputs:

Customer Name: ${CNAME}
Zip Code: ${CZIP}

In the example above, each time the AI Assistant is called, the system automatically injects the dynamic customer name and zip code, providing immediate context to the LLM.

Tool Functions

Tool Functions are supplemental abilities that the AI Assistant can utilize at runtime. Adding tools allows your assistant to query live data via an m-Power application, retrieve specialized information from a document repository (Knowledge Base), or trigger an External Object based on the conversation.

For more information on using tool functions, please see:

Large Language Model (LLM) Selection

This node is where you select the specific model that will power your AI Assistant. mrc does not recommend one particular model over another; the choice is entirely dependent on your organization’s needs and preferences.

Note: To utilize a specific vendor’s LLM, additional configuration and an API key are required. Please visit the Adding AI to m-Power documentation for setup instructions.

Assistant Configuration

The right-side Assistant Configuration panel contains various properties and settings associated with your AI Assistant.

Fields

The default fields of the AI Assistant will contain just the userMessage and assistantResponse. This is normal and and represents the core input (the user’s message) and output (the AI’s reply).

You can optionally add additional Assistant Fields. These act as parameters, or placeholders, that the assistant can capture and feed values into at runtime. To add new field parameters, click the “Manage Fields” button and type in the field name, description, and type, then click + Add.

To add new field parameters that will capture information for the assistant, type in the field name and description, type, and then click “Add”.

General Settings

  • Chat History: Controls whether the AI remembers the conversation only while the chatbot is open on the current page (clears on load) or retains it throughout the user’s entire session.
  • Hide JSON from Chat Responses: Useful if your AI is configured to return JSON responses for backend processing and you want them hidden from the end-user’s chat window.
  • Save Conversation History: Persists past conversations and displays a history button for the user to review past chats.
  • Summarize for History Title: Uses the LLM to generate a clean, summarized title for each historical conversation, rather than just grabbing the user’s first message.

Advanced Settings

As the name implies, these are advanced options for the selected model. Generally, these should not be altered without direction from mrc support.

  • Max Chat History Messages: When chatting, previous messages are sent to the LLM to maintain conversational continuity. Lowering this value saves tokens but may cause the AI to forget older parts of the conversation. Raising it too high can confuse the AI.
  • Temperature: Controls the creativity of the responses. A lower value (0.1 – 0.3) is best for strict, factual responses. A higher value (0.8+) is better for creative or conversational tasks.
  • Max Tokens: AI providers charge based on token usage (input and output). This limits the maximum length of the LLM’s response.

Content Retriever Settings

  • Content Retriever: Appends retrieved document content to the system prompt for context.
  • Max Results: Tells the AI how many document rows it should retrieve based on proximity to the user’s question. Lowering this might cause the AI to miss valid resources; raising it might overwhelm the AI with too much information. If your chatbot misses important context, try increasing this slightly.
  • Min Score: Determines how closely a piece of content must match the user’s question before it is included. A higher score guarantees high relevance but fewer results. A lower score casts a wider net. If the bot includes off-topic info, raise the minimum score.
  • Embedding Store Name: Overrides the default embedding store file name.

AI Assistant at Runtime

Clicking the Run as Application button in the top toolbar will open a live chat interface, allowing you to instantly test your assistant and send messages.

How to Embed an AI Assistant in Another m-Power Application

While it is possible to use the assistant as a standalone application, you will often want to embed it into a separate m-Power app. For instance, if your AI Assistant is trained to answer questions about order statuses, you likely want to embed it directly on the application screen where users view their orders.

Using the m-Painter editor, an AI Assistant can be embedded into any m-Power application either via the graphical interface or directly in the HTML source.

Via the m-Painter GUI

1. Open m-Painter for your main application and click inside the title bar.

2. Select the AI Chatbot option from the Featured Components section.

3. From the Insert/Edit Chatbot popup, select the AI Assistant retrieval that you wish to embed.

4. Save your changes. When running the application, the AI Assistant will now be accessible via a floating chat icon in the bottom-right corner of the screen.

5. In the m-Painter editor, the embedded assistant call is displayed using Freemarker syntax. You can use the Quick Edit (pencil) button to modify it if necessary.

Via HTML Source

When working in the HTML source directly, the following syntax can be inserted to embed your AI Assistant using this import statement:

${Import("DICTIONARY.I#####s","assistant","false")}

Replace with the following values as necessary:

  • DICTIONARY.A#####s – the dictionary name and application number of the AI Assistant you want to import/embed.
  • false – if set to false, the assistant will be suppressed on page load. If set to true, then the assistant chat interface will automatically open on page load.

Updated on August 4, 2026

Was this article helpful?

Related Articles