Skip to content

Commit aed8e7d

Browse files
Merge pull request #9880 from liamsommer-mx/how-to-fixes
Small fixes to align with current modules
2 parents a6ed903 + 6f01681 commit aed8e7d

18 files changed

+72
-48
lines changed

content/en/docs/marketplace/genai/how-to/create-single-agent.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ Mendix ticket data needs to be ingested into the knowledge base. You can find a
106106
* Edit the first retrieve action to retrieve objects from your new entity `Ticket`.
107107
* In the loop, delete the second action that adds metadata to the `MetadataCollection`.
108108
* In the last action of the loop `Chunks: Add KnowledgeBaseChunk to ChunkCollection` keep the **Human readable ID** field empty.
109-
* Near the end of the microflow, edit the `DeployedKnowledgeBase` retrieve action to change the XPath constraint for name from *example* to `HistoricalTickets`.
110109

111110
7. Finally, create a microflow `ACT_CreateDemoData_IngestIntoKnowledgeBase` that first calls the `Tickets_CreateDataset` microflow, followed by the `ACT_TicketList_LoadAllIntoKnowledgeBase` microflow. Add this `ACT_CreateDemoData_IngestIntoKnowledgeBase` new microflow to your navigation or homepage and ensure that it is accessible to admins (add the admin role under **Allowed Roles** in the microflow properties).
112111

content/en/docs/marketplace/genai/how-to/ground_your_llm_in_data.md

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ To start, create a microflow that allows you to upload data into your knowledge
6262

6363
1. Create a new microflow, for example, `ACT_TicketList_LoadAllIntoKnowledgeBase`.
6464

65-
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/loaddataintokb_example.png" >}}
65+
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/loaddataintokb-example-replace.png" >}}
6666

6767
2. Add the `Retrieve Objects` action. You can configure it as follows:
6868

@@ -91,25 +91,14 @@ To start, create a microflow that allows you to upload data into your knowledge
9191

9292
6. Next, add the `DeployedKnowledgeBase: Get` action from the `Mendix Cloud Knowledge Base` category:
9393

94-
To edit the parameter value for `MxCloudKnowledgeBaseResource`, double-click its type, select `Variable`, and assign it the value `MxCloudKnowledgeBaseResource`. Similarly, for `CollectionName`, double-click its type, select `Expression`, and assign it the value `TicketSolutions`.
94+
* **MxCloudKnowledgeBaseResource**: `MxCloudKnowledgeBaseResource` (as retrieved in the step above)
95+
* **CollectionName**: `HistoricalTickets`
96+
* Use return value: Yes, `DeployedKnowledgeBase`
9597

96-
You can keep the **Use return variable** as *Yes* and the object name `DeployedKnowledgeBase`.
98+
7. Add the `Embed & Replace` action to insert your knowledge into the knowledge base:
9799

98-
7. Add the `Embed & Repopulate Collection` action to insert your knowledge into the knowledge base:
99-
100-
To edit the parameter value for `DeployedKnowledgeBase`, double-click its type, select `Variable`, and assign it the value `DeployedKnowledgeBase`. Similarly, for `ChunkCollection`, double-click its type, select `Variable`, and assign it the value `GenAICommons.ChunkCollection`.
101-
102-
You can keep the **Use return variable** as *Yes* and the variable name `IsSuccess`.
103-
104-
8. Next (optional), include a decision:
105-
106-
* **Caption**: for example, `Replace Success`
107-
* **Decision Type**: `Expression`
108-
* **Expression**: `$IsSuccess`
109-
110-
If the decision is `true`, an `End event` action can be added where a microflow return value to `true`. You may add a message to inform the end user that the insertion was successful.
111-
112-
If the decision is `false`, an `End event` action can be added where a microflow return value to `false`. You may add a message to inform the end user that the insertion failed.
100+
* **ChunkCollection**: `ChunkCollection` (as created earlier)
101+
* **DeployedKnowledgeBase**: `DeployedKnowledgeBase`
113102

114103
You have successfully implemented the knowledge base insertion microflow! If you do not have any data available in your app yet, you need to create a microflow to generate the dataset, as described in the [Data Set Microflow](#dataset) section below.
115104

@@ -119,7 +108,7 @@ This microflow first checks whether a list of tickets already exists in the data
119108

120109
1. Create a new microflow, for example, `Tickets_CreateDataset`.
121110

122-
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/loaddataintokb_example2.png" >}}
111+
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/loaddataintokb-example-demodata.png" >}}
123112

124113
2. Add a `Retrieve` action:
125114

@@ -155,7 +144,7 @@ With both microflows created, they must be combined and added to the homepage to
155144

156145
1. Create a new microflow `ACT_TicketList_CreateData_InsertIntoKnowledgeBase`.
157146

158-
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/loaddataintokb_example3.png" >}}
147+
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/loaddataintokb-example-combine.png" >}}
159148

160149
2. Add a `Call Microflow` action where you call the `MyFirstModule.Tickets_CreateDataset` microflow created above.
161150

@@ -181,20 +170,21 @@ To use the knowledge in a chat interface, create and adjust certain microflows a
181170

182171
With the `MyFirstBot.ACT_FullScreenChat_Open microflow` configured, the `MyFirstBot.ChatContext_ChatWithHistory_ActionMicroflow` can now be adjusted to handle user-submitted messages in the chat interface.
183172

184-
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/chatcontext_microflow_example.png" >}}
173+
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/chatcontext-microflow-example.png" >}}
185174

186175
4. Open your `MyFirstBot.ChatContext_ChatWithHistory_ActionMicroflow` microflow in your **MyFirstBot** module.
187176

188-
5. After the `Request found` decision, add a `Retrieve` action. In this example, the first entry found in the database is used, just as in the insertion microflow.
177+
5. After the `Request found` decision, add a `Retrieve` action. In this example, we retrieve the same as in the insertion microflow.
189178

190179
* **Source**: `From database`
191-
* **Entity**: `MxGenAIConnector.MxCloudKnowledgeBaseResource`
180+
* **Entity**: `GenAICommons.DeployedKnowledgeBase`
181+
* **XPath constraint**: `[Name = 'HistoricalTickets']`
192182
* **Range**: `First`
193-
* **Object name**: `MxCloudKnowledgeBaseResource`
183+
* **Object name**: `DeployedKnowledgeBase_SimilarTickets`
194184

195-
6. Add the `Tools: Add Mendix Cloud Knowledge Base` action with the settings shown in the image below:
185+
6. Add the `Tools: Add Knowledge Base` action with the settings shown in the image below:
196186

197-
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/tool_mendixcloudgenai_example_action.png" >}}
187+
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-goundllm/tool-addknowledgebase-example.png" >}}
198188

199189
The rest of the actions can remain as they are currently set. Now that everything is implemented, you can test the chat with enriched knowledge.
200190

content/en/docs/marketplace/genai/mendix-cloud-genai/Mx GenAI Connector.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Follow the steps below to get started:
9393

9494
## Operations
9595

96-
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/mxgenAI-connector/MxGenAIConnector_Configuration.png" >}}
96+
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/mxgenAI-connector/mxgenaiconnector-configuration.png" >}}
9797

9898
Configuration keys are stored persistently after they are imported (either via the UI or the exposed microflow). There are three different types of configurations that reflect the use cases this service supports. The specific operations are described below.
9999

@@ -123,13 +123,17 @@ The microflow activity [Chat completions (with history)](/appstore/modules/genai
123123

124124
#### Retrieve & Generate {#retrieve-and-generate}
125125

126-
To use retrieval and generation in a single operation, an internally predefined tool can be added to the [Request](/appstore/modules/genai/genai-for-mx/commons/#request) via the `Tools: Add Knowledge Base` action . The model can then decide whether to use the [knowledge base retrieval](/appstore/modules/genai/genai-for-mx/commons/#knowledge-base-retrieval) tool when handling the request. This functionality is supported in both with-history and without-history operations. The (optional) `Description` helps the model to understand the knowledge base content and decide whether it should be called in the current chat context. Additionally, you may apply optional filters, such as `MaxNumberOfResults` or `MinimumSimilarity`, or pass a [MetadataCollection](/appstore/modules/genai/genai-for-mx/commons/#metadatacollection-entity).
126+
To use retrieval and generation in a single operation, an internally predefined tool can be added to the [Request](/appstore/modules/genai/genai-for-mx/commons/#request) via the `Tools: Add Knowledge Base` action. The model can then decide whether to use the [knowledge base retrieval](/appstore/modules/genai/genai-for-mx/commons/#knowledge-base-retrieval) tool when handling the request. This functionality is supported in both with-history and without-history operations. The (optional) `Description` helps the model to understand the knowledge base content and decide whether it should be called in the current chat context. Additionally, you may apply optional filters, such as `MaxNumberOfResults` or `MinimumSimilarity`, or pass a [MetadataCollection](/appstore/modules/genai/genai-for-mx/commons/#metadatacollection-entity).
127127

128-
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/mxgenAI-connector/MxGenAIConnector_ConfigureRAG.png" >}}
128+
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/mxgenAI-connector/mxgenaiconnector-rag.png" >}}
129129

130-
The returned `Response` includes [References](/appstore/modules/genai/genai-for-mx/commons/#reference) if the model used them to generate its response. In some cases, a knowledge chunk consists of two texts: one for the semantic search step (retrieval) and another for the generation step. For example, when solving a problem based on historical solutions, the semantic search identifies similar problems using their descriptions, while the generation step produces a solution based on the corresponding historical solutions. In those cases, you can add [MetaData](/appstore/modules/genai/genai-for-mx/commons/#chunkcollection-add-knowledgebasechunk) with the key `knowledge` to the chunks during the insertion stage, allowing the model to base its response on the specified metadata rather than the input text (only the knowledge is passed to the model).
130+
The returned `Response` includes [References](/appstore/modules/genai/genai-for-mx/commons/#reference) for each retreived chunk from the knowledge base.
131131

132-
Additionally, to utilize the `Source` attribute of the references, you can include `MetaData` with the key `sourceUrl`. Finally, the `HumanReadableId` of a chunk is used to display the reference's title in the response.
132+
Optionally, you can control both reference creation and the output returned for the model during the insertion step:
133+
134+
* The `HumanReadableId` of a chunk is used for the reference title in the response, which is shown to the end user in the [ConversationalUI](/appstore/modules/genai/genai-for-mx/conversational-ui/).
135+
* To utilize the `Source` attribute of the references, include `MetaData` with the key `sourceUrl`. In [ConversationalUI](/appstore/modules/genai/genai-for-mx/conversational-ui/), this will appear as a clickable link for the end user.
136+
* In some cases, a knowledge chunk consists of two texts: one for the semantic search (retrieval) step, and another for the generation step. For example, when solving a problem based on historical solutions, semantic search identifies similar problems using their descriptions, while the generation step produces a solution based on the corresponding historical solutions. In such cases, you can add [MetaData](/appstore/modules/genai/genai-for-mx/commons/#chunkcollection-add-knowledgebasechunk) with the key `knowledge` to each chunk during insertion. This allows the model to generate its response using the specified metadata instead of the input text (only the value of `knowledge` is passed to the model).
133137

134138
#### Function Calling{#function-calling}
135139

content/en/docs/marketplace/platform-supported-content/modules/aws/amazon-bedrock.md

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,62 @@ Follow the instructions in [How to Use Marketplace Content](/appstore/use-conten
5151

5252
After you install the connector, you can find it in the **App Explorer**, in the **AmazonBedrockConnector** section. The connector provides a [domain model and several activities](#technical-reference) that you can use to connect your app to Amazon Bedrock. Each activity can be implemented by using it in a microflow. To ensure that your app can connect to the AWS service, you must also configure AWS authentication for the connector.
5353

54-
### Using Amazon Bedrock Models
54+
### Configuring AWS Authentication {#configure-authentication}
5555

56-
To use Amazon Bedrock models, keep in mind some specific requirements, as listed below.
56+
To use the Amazon Bedrock service, you must authenticate with AWS. To do so, you must set up a configuration profile in your Mendix app. After you set up the configuration profile, the connector module handles the authentication internally.
5757

58-
#### Model Lifecycle
58+
As of version 3.0.0 of the [AWS Authentication Connector](https://marketplace.mendix.com/link/component/120333), all the resources and logic required to set up authentication are centralized inside the AWS Authentication Connector module.
5959

60-
Amazon Bedrock models have a lifecycle that consists of the Active, Legacy, and EOL stages. For more information, see [Model lifecycle](https://docs.aws.amazon.com/bedrock/latest/userguide/model-lifecycle.html). Models are no longer available for use after they reach the EOL state. To ensure that your application functions as intended, make sure that you regularly monitor the state of the model that you are using. For example, you may want to use an API call to retrieve the status of the model and alert you once it reaches the Legacy state. To programmatically get information about available models and their lifecycle status, you can use the **ListFoundationModels** operation.
60+
The AWS Authentication Connector supports both **static credentials** and **temporary credentials**. For more information and detailed instructions please refer to the [AWS Authentication Connector documentation page](/appstore/modules/aws/aws-authentication/).
6161

62-
### Configuring AWS Authentication
62+
### Syncing Available Models, Knowledge Bases, and Agents
6363

64-
In order to use the Amazon Bedrock service, you must authenticate with AWS. To do so, you must set up a configuration profile in your Mendix app. After you set up the configuration profile, the connector module handles the authentication internally.
64+
You can use the `SNIP_Settings_Admin_ConfigOverview` snippet under **_USE_ME > SyncBedrockMetadata > ReusableUI** on an administrator page to sync models, knowledge bases and agents for the selected region at runtime. Admins on the page first need to configure the settings of the [AWS Authentication Connector](#configure-authentication) module, by selecting the AWS region and how to authenticate. When saving the settings or when you sync the models for the current region, AWS metadata services are called to create persistent objects in the database which you can view in the tables at the bottom of the snippet.
6565

66-
As of version 3.0.0 of the [AWS Authentication Connector](https://marketplace.mendix.com/link/component/120333), all the resources and logic required to set up authentication are centralized inside the AWS Authentication Connector module.
66+
{{% alert color="info" %}}
67+
All models are shown, even those which you cannot accesss. Access to models must be configured in the AWS console.
68+
{{% /alert %}}
6769

68-
The AWS Authentication Connector supports both **static credentials** and **temporary credentials**. For more information and detailed instructions please refer to the [AWS Authentication Connector documentation page](/appstore/modules/aws/aws-authentication/).
70+
#### Syncing Resources Using Microflows
71+
72+
If you do not want to configure the resources in an admin user interface, you can use the following actions in your custom microflows:
73+
74+
* Sync Models & Knowledge Bases & Agents
75+
* [Sync Models](#sync-models)
76+
* [Sync Knowledge Bases](#sync-knowledge-bases)
77+
* [Sync Agents](#sync-agents)
78+
79+
The following actions only list the available resources as non-persistent objects:
80+
81+
* List Foundation Models
82+
* List Agents
83+
* List Data Sources
84+
85+
#### Adding Custom Models to your Bedrock Configuration {#adding-custom-model}
86+
87+
When syncing your Bedrock configuration, only publicly available foundation models can be retrieved using the `List Foundation Models` action from the Bedrock Connector. To use cross-region inference (CRI) or provisioned-throughput models that you have setup in your AWS console, you must manually add these models to your database. To add a custom model, follow the steps below:
88+
89+
1. Click **Add model** above the model's table.
90+
2. Fill out the form with the relevant information of your custom model.
91+
92+
The display name is shown in the model dropdowns while choosing a model to use. The model ID is required to use the model with Amazon Bedrock. The other fields must be filled out according to the functionalities the model can use.
93+
94+
3. Save the model.
95+
96+
You can now use the custom model with the actions of your choice.
97+
98+
### Using Amazon Bedrock Models
99+
100+
To use Amazon Bedrock models, keep in mind some specific requirements, as listed below.
101+
102+
#### Model Lifecycle
103+
104+
Amazon Bedrock models have a lifecycle that consists of the Active, Legacy, and EOL stages. For more information, see [Model lifecycle](https://docs.aws.amazon.com/bedrock/latest/userguide/model-lifecycle.html). Models are no longer available for use after they reach the EOL state. To ensure that your application functions as intended, make sure that you regularly monitor the state of the model that you are using. For example, you may want to use an API call to retrieve the status of the model and alert you once it reaches the Legacy state. To programmatically get information about available models and their lifecycle status, you can use the **ListFoundationModels** operation.
69105

70106
### Configuring a Microflow for an AWS Service
71107

72-
After you configure the authentication profile for Amazon Bedrock, you can implement the functions of the connector by using the provided activities in microflows. The **USE_ME** folder contains several subfolders containing operations that depend on the GenAI Commons module. The following example microflows have been created for each of these inside the **ExampleImplementations** folder:
108+
After you configure the authentication profile for Amazon Bedrock, you can implement the functions of the connector by using the provided activities in microflows. The most important actions are available in the toolbox or in the [GenAI Commons](/appstore/modules/genai/genai-for-mx/commons/#microflows) module.
109+
The **USE_ME** folder contains several subfolders containing operations. The following example microflows have been created for each of these inside the **ExampleImplementations** folder:
73110

74111
* EXAMPLE_ChatCompletions_FunctionCalling
75112
* EXAMPLE_ChatCompletions_Vision
@@ -669,13 +706,7 @@ The Amazon Bedrock Connector offers a range of operations to retrieve and store
669706

670707
This can be useful to e.g. associate a chatbot configuration to an available model by selecting the model via dropdown in runtime. The persistent domain model allows for simple and efficient filtering capabilities on the available metadata. Further, the *SNIP_Settings_Admin_BedrockConfig* Snippet can be used to manage and view the synced data from an administrator perspective.
671708

672-
Currently, there are operations available to sync metadata about:
673-
674-
* Sync Models
675-
* Sync Knowledge Bases
676-
* Sync Agents
677-
678-
The syncing process works the same for all of these operations.
709+
The syncing process works the same for all of these operations:
679710

680711
1. Information about models, knowledge bases, and agents is persistent in the Mendix app's database on the initial sync.
681712
2. For knowledge base and agents, an association to the `AmazonBedrockRegion` object, that represents the AWS region used when syncing, is stored.
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)