{"id":14783,"date":"2025-10-22T16:10:19","date_gmt":"2025-10-22T21:10:19","guid":{"rendered":"https:\/\/www.mrc-productivity.com\/docs\/?post_type=ht_kb&#038;p=14783"},"modified":"2025-10-24T11:43:20","modified_gmt":"2025-10-24T16:43:20","slug":"ai-assistant-template","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/ai-assistant-template","title":{"rendered":"AI Assistant template"},"content":{"rendered":"\n<p>This documentation will showcase how to building and using AI Assistant template in m-Power. <\/p>\n\n\n\n<p>The AI Assistant is one of two artificial intelligence templates in the m-Power software, the other being the <a href=\"\/docs\/knowledge-base\/content-retriever\" target=\"_blank\" rel=\"noreferrer noopener\">AI Content Retrieval<\/a>.<\/p>\n\n\n\n<p>The AI Assistant template is a retrieval template, used to create most notably a AI chatbot interface for end-users to interact and chat with at runtime. While most visibly consumed as chatbot, the AI Assistant can alternatively be invoked via the workflow designer of an m-Power maintainer application, allowing developers to utilize their chatbot &#8220;behind-the-scenes&#8221; to assist with workflow processes. <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"m-Power AI Assistant Template Tutorial\" width=\"643\" height=\"362\" src=\"https:\/\/www.youtube.com\/embed\/eOUUoGDihvg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\">Why would I use the AI Assistant?<\/h2>\n\n\n\n<p>In the simplest of terms, the AI Assistant can be though and will often be referenced in this document as a &#8220;chatbot&#8221;. Many m-Power developers have likely already interacted with chatbots in some capacity, with two notable examples being OpenAI&#8217;s ChatGPT or Microsoft&#8217;s Copilot. These &#8220;chatbots&#8221; are more generally referred to as <strong>large multimodal models (LLMs)<\/strong>.<\/p>\n\n\n\n<p>As is true with many LLMs, the capability of AI extends beyond just holding a conversation. With the m-Power AI Assistant, the developer will ultimately be responsible for defining the purpose and functionality of their chatbot, providing instruction and guidelines for what it can (and cannot do). <\/p>\n\n\n\n<p>In the same vein, the developer will be able to query information in real-time, pass parameters into their chatbot for processing, and trigger workflow actions based on the response of their chatbot.    <\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Creating an AI Assistant<\/h2>\n\n\n\n<p>The AI Assistant is a standalone template that can be selected when creating a new retrieval, as shown in Figure 1.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757c2a0&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757c2a0\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_template_selection.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Figure 1. Creating a new AI Assistant retrieval.<\/figcaption><\/figure>\n\n\n\n<p>After creating, the developer will be shown the 3. Customize tab. At this point, the AI Assistant retrieval can be compiled immediately &#8211; no further action is required.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Customizing an AI Assistant<\/h2>\n\n\n\n<p>After building, all customizations to the AI Assistant can be access from the &#8220;3. Customize&#8221; tab of the application, as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/ai_assistant_customize_tab.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>Each area will be explained more in depth:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Edit Data Model<\/h3>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/ai_assistant_customize_btn1.png\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>Unlike traditional m-Power applications that query the database (e.g. a Multiple Row Data List retrieval), the data model will not show any database tables or datasets.<\/p>\n<\/div>\n<\/div>\n\n\n\n<p>The Data Model of the AI Assistant template will contain just the <code>userMessage <\/code>and <code>assistantResponse <\/code>as the two &#8220;fields&#8221; selected, as shown in Figure 2. This is normal and will represent the input (message) to the assistant and the output (response) from the assistant.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757c7e4&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757c7e4\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_data_model.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Figure 2. The data model of an AI Assistant retrieval.<\/figcaption><\/figure>\n\n\n\n<p>On this screen, the developer has the ability to (optionally) add Assistant Fields to their data model, which can be though of as parameters, or placeholders for values that the assistant can fed a value into when it&#8217;s utilized at runtime. <\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon\"><strong>Purpose<\/strong>: Define additional fields (parameters) for the AI Assistant to utilize and populate with values at runtime.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Adding Parameters to the Data Model<\/h4>\n\n\n\n<p>To add parameters that will capture information for the assistant, type in the field name and description, type, and then press Add Field.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/ai_assistant_add_parms.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Figure 3. Additional parameters added to the data model.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">A more in-depth guide to passing values into any defined parameters, can be found in the following documentation:<br><br><strong><a href=\"\/docs\/knowledge-base\/passing-parameters-to-the-ai-assistant\">Passing Parameters to the AI Assistant<\/a><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Edit UI\/System Prompt<\/h3>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/ai_assistant_customize_btn2.png\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>The heart of your AI Assistant is configured here. This option will open up the m-Painter editor, where various configuration files associated to the AI Assistant can be edited.<\/p>\n\n\n\n<p>While the presentation of the assistant can be customized, this is not the main purpose of this option. Rather, this option is used to <strong>configure your system prompt to provide instructions and guidelines <\/strong>for how the AI Assistant chatbot will operate. <\/p>\n<\/div>\n<\/div>\n\n\n\n<p>Each of the three files shown in the m-Painter editor will be discussed for more in-depth understanding:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">System Prompt<\/h4>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757cf6a&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757cf6a\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_mp_sysprompt.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Figure 3. The System Prompt page with default instructions.<\/figcaption><\/figure>\n\n\n\n<p><strong>The System Prompt page defines the AI Assistant&#8217;s identity and instructions. <\/strong><\/p>\n\n\n\n<p>Within the System Prompt a developer will be writing specific guidelines and instructions as to what the AI Assistant&#8217;s purpose is, how to behave and response, as well as the output format of the response. To put it in an analogy, this file is the &#8220;job description&#8221; of your chatbot.<\/p>\n\n\n\n<p>At runtime, these text based instructions will be passed automatically to the LLM when a user message is sent. The information here should be seen as largely static &#8211; meaning the instructions and defined rules will not change in the context of a interaction. <\/p>\n\n\n\n<p>Any new assistant will generate a default set of instructions (shown in Figure 3) that are expected to be modified by the developer, in order to outline the tasks they intend the AI Assistant to perform.<\/p>\n\n\n\n<p>The text displayed can be edited just by clicking inside the editor and typing, whether in Design mode or the HTML Source mode.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-success\">Any instructions given to an LLM are subject to a natural variability, which will impact the accuracy of the chatbot&#8217;s response. So to help get started, visit the following documentation which offers more in-depth understanding of how to write an effective System Prompts:<br><br><a href=\"\/docs\/knowledge-base\/ai-system-prompt\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Writing a System Prompt for AI<\/strong><\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Main Page<\/h4>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757d3d8&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757d3d8\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_mp_mainpage.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Figure 4. The Main Page.<\/figcaption><\/figure>\n\n\n\n<p><strong>The Main Page is used exclusively to customize the appearance of the chat interface the end-user will see.<\/strong><\/p>\n\n\n\n<p>Aside from changing the title or instructions on the page, generally speaking this page will be left as-is, as edits to this screen are <span style=\"text-decoration: underline;\">purely cosmetic<\/span>, rather than functional.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">If the user will not interface with the AI Assistant directly via a chat interface, meaning the AI Assistant will be used for behind-the-scenes workflow, then this page will never be seen.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">User Prompt Template<\/h4>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757d7c4&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757d7c4\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_mp_user_prompt_template.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Figure 5. The User Prompt template page.<\/figcaption><\/figure>\n\n\n\n<p><strong>The User Prompt defines the input (data) to the AI Assistant.<\/strong><\/p>\n\n\n\n<p>In any AI Assistant out of the box, the input is simply the user message that is directly typed into the chat interface and sent to the LLM. The entire user message is encapsulated in the &#8216;message&#8217; variable shown by default (see Figure 5):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>${message}<\/code><\/pre>\n\n\n\n<p>There may be situations where the AI Assistant will not be interacted with directly via the chat interface. Meaning the user does not type and send a message to the LLM themselves, but rather the AI Assistant is called and sent a message &#8220;behind-the-scenes&#8221; by another m-Power&#8217;s application workflow. <\/p>\n\n\n\n<p>In those situations, parameters will need to be passed from workflow designer to the the AI Assistant. The User Prompt Template can be customized to define the inputs (parameters) that will be dynamically fed to the assistant:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Customer Name: ${row.CNAME?html}\nZip Code: ${row.CZIP?html}<\/code><\/pre>\n\n\n\n<p>In the above example, each time the AI Assistant is called, this is providing context to the chatbot that the customer name and a zip code are dynamic piece of data that will be supplied . More on parameters will be discussed later on. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Edit Properties<\/h3>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/ai_assistant_edit_properties.png\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>The Edit Properties section contains various settings and configurable properties associated with the AI Assistant.<\/p>\n\n\n\n<p>Selecting this will provide three sections (tabs) with different properties.<\/p>\n<\/div>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">General<\/h4>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757dcaa&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757dcaa\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_edit_properties_general.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Figure 6 &#8211; AI Assistant &#8216;General&#8217; properties.<\/figcaption><\/figure>\n\n\n\n<p>Most notably, the model (LLM) that will be utilized by the AI Assistant is selected here. mrc does not recommend a particular model over the other, as the choice of which model is utilized is entirely dependent on the developer<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">Note that to utilize a specific vendor&#8217;s LLM, additional configuration and an API key will be needed. Please visit the<a href=\"\/docs\/knowledge-base\/adding-ai-to-m-power\" data-type=\"link\" data-id=\"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/adding-ai-to-m-power\"> <strong>Adding AI to m-Power<\/strong><\/a> documentation which discusses this setup.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Tool Functions<\/h4>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757e088&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757e088\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_edit_properties_toolfunctions.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Figure 7. Tool Functions calls within the AI Assistant template<\/figcaption><\/figure>\n\n\n\n<p>Tool Functions are supplemental calls to data the AI Assistant can utilize at runtime. This will allow the AI Assistant to optionally query live data via retrieval, query information from a document repository (an AI Content retrieval), or fire an External Object when it&#8217;s interacted with. <\/p>\n\n\n\n<p>For more information on using tool functions, please see the following links:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"\/docs\/knowledge-base\/content-retriever\"><strong>Using a Content Retriever Tool Function in Your AI Assistant<\/strong><\/a><\/li>\n\n\n\n<li><a href=\"\/docs\/knowledge-base\/using-application-tool-functions-in-the-ai-assistant\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Using Application Tool Functions in the AI Assistant<\/strong><\/a><\/li>\n\n\n\n<li>Using External Object Tool Functions in the AI Assistant<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Advanced<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/ai_assistant_edit_properties_advanced.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Figure 8. AI Assistant&#8217;s &#8220;Advanced&#8221; properties.<\/figcaption><\/figure>\n\n\n\n<p>The other properties as the name implies are considered advanced options for the model selected. Generally speaking, these should not be altered without the direction from the mrc staff. <\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">If you&#8217;d like to read more about these individual properties, please see <a href=\"\/docs\/knowledge-base\/adding-ai-to-m-power#advanced\">here<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Edit Workflow<\/h3>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/ai_assistant_edit_workflow.png\" alt=\"\"\/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>The option opens the Workflow Designer tool. <\/p>\n\n\n\n<p>The workflow designer allows developers to establish and define workflow processes that should occur after a message is sent to the assistant. <\/p>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" src=\"\/docs\/vue-images\/ai_assistant_worklow_designer.png\" alt=\"\" style=\"aspect-ratio:1;width:668px;height:auto\"\/><figcaption class=\"wp-element-caption\">Figure 9. Configured workflow with the AI Assistant retrieval<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">AI Assistant at Runtime<\/h2>\n\n\n\n<p>Executing the AI Assistant standalone will bring up a chat interface (Figure 10), where messages can be sent to the assistant.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/images\/AI_Assistant.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Figure 10. Default chat interface of the AI Assistant.<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">(How-To) Embed an AI Assistant in another m-Power application<\/h3>\n\n\n\n<p>While it is possible to utilize the assistant standalone as it&#8217;s own application, the AI Assistant can be accessed and embedded into a separate m-Power application. For instance, if my AI Assistant returns information about order statuses and customers, then I want my AI Assistant on the application screen where the end-user will view the orders.<\/p>\n\n\n\n<p>Using the m-Painter editor, an AI Assistant can be embedded into any m-Power application. It can be done via the m-Painter GUI or the HTML source.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">m-Painter GUI<\/h4>\n\n\n\n<p>1. Open m-Painter for the main application and click inside the title bar.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757e9a8&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757e9a8\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_embed1.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>2. Select the AI Chatbot option from the Featured Components section:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757eb5a&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757eb5a\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_embed2.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>3. From the Insert\/Edit Chatbot Popup, select the AI Assistant retrieval that will be embedded. <\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757ed0c&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757ed0c\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_embed3.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>4. After saving m-Painter and running the main application, the AI Assistant will be accessible from the bottom-right corner of the viewport.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757eeae&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757eeae\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_embed4.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>5. The m-Painter editor will show the embedded assistant call using Freemarker syntax. Use the Quick Edit (pencil button) to edit if necessary, as shown below:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d3f1757f059&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d3f1757f059\" class=\"wp-block-image size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"\/docs\/vue-images\/ai_assistant_embed5.png\" alt=\"\"\/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">HTML Source<\/h4>\n\n\n\n<p>When working in the HTML source directly, the following syntax can be inserted to embedded your AI Assistant using this import statement:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>${Import(\"DICITIONARY.I#####s\",\"assistant\",\"false\")}<\/code><\/pre>\n\n\n\n<p>Replace with the following values as necessary:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>DICTIONARY.I#####s<\/code> &#8211; the dictionary name and application of the AI Assistant you want to import\/embed.<\/li>\n\n\n\n<li><code>false<\/code> &#8211; 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.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>An in-depth documentation on the AI Assistant template in m-Power, offering insight on how to build, customize, and implement an AI Assistant retrieval template. <\/p>\n","protected":false},"author":2,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[313],"ht-kb-tag":[],"class_list":["post-14783","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-artificial-intelligence-ai"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/14783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/comments?post=14783"}],"version-history":[{"count":68,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/14783\/revisions"}],"predecessor-version":[{"id":14949,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/14783\/revisions\/14949"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/media?parent=14783"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=14783"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=14783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}