You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/marketplace/genai/how-to/create-single-agent.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,7 +106,6 @@ Mendix ticket data needs to be ingested into the knowledge base. You can find a
106
106
* Edit the first retrieve action to retrieve objects from your new entity `Ticket`.
107
107
* In the loop, delete the second action that adds metadata to the `MetadataCollection`.
108
108
* 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`.
110
109
111
110
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).
2. Add the `Retrieve Objects` action. You can configure it as follows:
68
68
@@ -91,25 +91,14 @@ To start, create a microflow that allows you to upload data into your knowledge
91
91
92
92
6. Next, add the `DeployedKnowledgeBase: Get` action from the `Mendix Cloud Knowledge Base` category:
93
93
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`
95
97
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:
97
99
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)
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.
115
104
@@ -119,7 +108,7 @@ This microflow first checks whether a list of tickets already exists in the data
119
108
120
109
1. Create a new microflow, for example, `Tickets_CreateDataset`.
2. Add a `Call Microflow` action where you call the `MyFirstModule.Tickets_CreateDataset` microflow created above.
161
150
@@ -181,20 +170,21 @@ To use the knowledge in a chat interface, create and adjust certain microflows a
181
170
182
171
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.
4. Open your `MyFirstBot.ChatContext_ChatWithHistory_ActionMicroflow` microflow in your **MyFirstBot** module.
187
176
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.
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.
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).
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 knowledgebase.
131
131
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).
Copy file name to clipboardExpand all lines: content/en/docs/marketplace/platform-supported-content/modules/aws/amazon-bedrock.md
+47-16Lines changed: 47 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,25 +51,62 @@ Follow the instructions in [How to Use Marketplace Content](/appstore/use-conten
51
51
52
52
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.
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.
57
57
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.
59
59
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/).
61
61
62
-
### Configuring AWS Authentication
62
+
### Syncing Available Models, Knowledge Bases, and Agents
63
63
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.
65
65
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 %}}
67
69
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.
69
105
70
106
### Configuring a Microflow for an AWS Service
71
107
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:
73
110
74
111
* EXAMPLE_ChatCompletions_FunctionCalling
75
112
* EXAMPLE_ChatCompletions_Vision
@@ -669,13 +706,7 @@ The Amazon Bedrock Connector offers a range of operations to retrieve and store
669
706
670
707
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.
671
708
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:
679
710
680
711
1. Information about models, knowledge bases, and agents is persistent in the Mendix app's database on the initial sync.
681
712
2. For knowledge base and agents, an association to the `AmazonBedrockRegion` object, that represents the AWS region used when syncing, is stored.
0 commit comments