Edit and divide the Creating Your First Agent guide#11209
Conversation
| * `Solution` as *String*, length 2000 | ||
| * `Status` as *Enumeration*; create a new Enumeration `ENUM_Ticket_Status` with *Open*, *In Progress*, and *Closed* as values | ||
|
|
||
| 2. From the [GenAI Showcase App](https://marketplace.mendix.com/link/component/220475), extract the following components from the `ExampleMicroflows` module and import them into your app: |
There was a problem hiding this comment.
What is the recommended way to do this? Copy and paste from the GenAI Showcase app?
There was a problem hiding this comment.
That's certainly the fastest + saves us time + forces people to check out the showcase - yes
|
|
||
| 5. Remove the **Save** and **Cancel** buttons. Add a new button with the caption *Ask the agent* below the **User input** text field. | ||
|
|
||
| 6. Open the **Model response** input field and set the **Grow automatically** option to `Yes`. |
There was a problem hiding this comment.
The data view automatically filled with a Text box, and I needed to convert to Text area before there was a Grow automatically option. Is it fine to just remove this instruction?
There was a problem hiding this comment.
Wouldn't it make more sense then to write to first convert it to a text area and then set the option?
|
|
||
| If you are using a GenAI starter app such as the Blank GenAI Starter App, you can skip ahead to [Creating the Agent's Functional Prerequisites](#creating-functional-prerequisites) because the following setup steps are completed by default. Otherwise, follow these steps to add the required modules and configuration to your app: | ||
|
|
||
| 1. Set your app's [security level](/refguide/app-security/) to **Production**. |
There was a problem hiding this comment.
Added because some of the instructions in this guide are only possible at production-level security.
linaaaf
left a comment
There was a problem hiding this comment.
1st iteration :) Missing: create-agent-programmatically because there are open questions
|
|
||
| The end result is an example agent in a Mendix app. In this use case, you can ask IT-related questions to the model, which assists in solving problems. The model has access to a knowledge base containing historical, resolved tickets that can help identify suitable solutions. Additionally, function microflows are available to enrich the context with relevant ticket information, such as the number of currently open tickets or the status of a specific ticket. | ||
|
|
||
| This agent is a single-turn agent, which means that: |
There was a problem hiding this comment.
We should actually already use the word 'task' instead of single-call
|
|
||
| ## Implementation Approaches {#implementation-approach} | ||
|
|
||
| You can define an agent for your Mendix app using any of the following approaches, all of which use Agents Kit: |
There was a problem hiding this comment.
Love the subtle mention of the Kit
| * Case B: The user is trying to solve an IT-related issue. Use the `FindSimilarTickets` tool to base your response on relevant historical tickets. | ||
|
|
||
| If the retrieved results are not helpful to answer the request, inform the user in a user-friendly way. | ||
| ``` |
There was a problem hiding this comment.
Could it be that something is wrong with rendering here, does the txt part maybe need to end differently? It seems to me that everything from the beginning of the system prompt is now txt and the ``` are not taken into account
|
|
||
| Create and configure the required Model and Agent documents in Studio Pro, including prompts and a context entity: | ||
|
|
||
| 1. In the **App Explorer**, right-click your module and select **Add other** > **Constant**. Set the **Type** to `string` and the **Default value** to your text generation [resource key](/appstore/modules/genai/mx-cloud-genai/Navigate-MxGenAI/#keys) from the Mendix Cloud GenAI Portal. |
There was a problem hiding this comment.
It is not a best practice to specify a constant's value inside of a module. Instead you specify the value for the constant belonging to a module as part of the App Settings. The reason for this is that the value of the constant is not shipped as part f the App Package, instead it is an Environment variable
Let me know if you have questions, in the current How to it says pragmatically
'For the Model key, create and select a string type constant that contains your text generation resource key from the Mendix Cloud GenAI Portal.' This might be a bit short, what do you think about:
'For the Model key, first create a string type constant inside of the module and then, inside of the App Settings, set its value to your text generation resource key from the Mendix Cloud GenAI Portal.'
There was a problem hiding this comment.
Same goes for the part about the knowledge base key
| * Intermediate understanding of Mendix – Knowledge of simple page building, microflow modeling, domain model creation, and import/export mappings | ||
| * Basic understanding of GenAI concepts – Review [Enrich Your Mendix App with GenAI Capabilities](/appstore/modules/genai/) for foundational knowledge and familiarize yourself with the [concepts of GenAI](/appstore/modules/genai/using-gen-ai/) and [agents](/appstore/modules/genai/agents/) | ||
| * Basic understanding of function calling and prompt engineering – Learn about [Function Calling](/appstore/modules/genai/function-calling/) and [Prompt Engineering](/appstore/modules/genai/get-started/#prompt-engineering) to use them within the Mendix ecosystem | ||
| * Optional – If you are not yet familiar with the GenAI modules, follow these GenAI documents: [Grounding Your LLM in Data](/appstore/modules/genai/how-to/howto-groundllm/), [Prompt Engineering at Runtime](/appstore/modules/genai/how-to/howto-prompt-engineering/), and [Integrate Function Calling into Your Mendix App](/appstore/modules/genai/how-to/howto-functioncalling/) |
There was a problem hiding this comment.
not yet familiar with GenAI modules -> not yet familiar with implementing specific GenAI concepts with Agents Kit
(or something similar)
| * Tool action module: Select the module that contains the function microflows you created earlier (**MyFirstModule** if you started from the Blank GenAI App) | ||
| * Microflow: Select `Ticket_GetTicketByID` | ||
| * Name: `RetrieveTicketByIdentifier` (expression) | ||
| * Description: `Get ticket details based on a unique ticket identifier (passed as a string). If there is no information for this identifier, inform the user about it.` (expression) |
There was a problem hiding this comment.
what do we mean by 'expression'? That they could use anything they find unique enough? also, we use this only for this second function, not for the first one
|
|
||
| * **Knowledge base resource**: Select the knowledge base resource created in [Set Up Your App for Agent Creation](/appstore/modules/genai/how-to/creating-agents/shared-setup/#ingest-knowledge-base) | ||
| * **Collection**: Select `HistoricalTickets`. If nothing appears in the list, refer to the documentation of the connector on how to set it up correctly | ||
| * Name: `RetrieveSimilarTickets` (expression) |
There was a problem hiding this comment.
'expression' again, if we remove it it needs to be removed here, too
|
|
||
| ## Calling the Agent | ||
|
|
||
| The button does not perform any actions yet, so you need to create a microflow to call the agent. Your completed microflow will look like this: |
There was a problem hiding this comment.
Add in the beginning that this is the 'Ask the agent' button on the TicketHelper_Agent page. Also, if they import this page the button it will ask for 'ACT_TicketHelper_Agent_AgentCommons' which is another example microflow they can lookup in the showcase app if interested
|
|
||
| ## Enabling User Confirmation for Tools (Optional) {#user-confirmation} | ||
|
|
||
| This optional step uses the human-in-the-loop pattern to give users control over tool executions. When [adding tools to the agent](#empower-agent), you can configure a **User Access and Approval** setting to either make the tools visible to the user or require the user to confirm or reject a tool call. This way, the user controls actions that the LLM requests to perform. |
There was a problem hiding this comment.
'This way, the user controls actions that the LLM requests to perform.'
-> 'This way, the user can control LLM actions.'
|
|
||
| 5. Remove the **Save** and **Cancel** buttons. Add a new button with the caption *Ask the agent* below the **User input** text field. | ||
|
|
||
| 6. Open the **Model response** input field and set the **Grow automatically** option to `Yes`. |
There was a problem hiding this comment.
Wouldn't it make more sense then to write to first convert it to a text area and then set the option?
No description provided.