Skip to content

Commit 6d54d8d

Browse files
committed
Add "using GenAI" files
1 parent 49c8465 commit 6d54d8d

3 files changed

Lines changed: 355 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: "Build Smarter Apps Using GenAI"
3+
url: /appstore/modules/genai/using-genai/
4+
linktitle: "Use GenAI to Build Smarter Apps"
5+
weight: 10
6+
description: "Tutorial on how to get started with GenAI for Smarter Apps"
7+
no_list: false
8+
---
9+
10+
## Introduction
11+
12+
Generative Artificial Intelligence (GenAI) transforms business applications, empowering developers and technologists to create smarter, more dynamic solutions. This document provides the knowledge and tools needed to make your first GenAI-powered application and guides developers and business technologists in integrating GenAI into their Mendix applications.
13+
14+
## Key Resources to Continue Your GenAI Journey
15+
16+
### Support Resources
17+
18+
* The [GenAI Showcase App](https://marketplace.mendix.com/link/component/220475) demonstrates over 10 use cases for implementing GenAI.
19+
* The [Support Assistant Starter App](https://marketplace.mendix.com/link/component/231035) is a template that incorporates [**RAG (Retrieval-Augmented Generation)**](/appstore/modules/genai/rag/), [**function calling (ReAct Pattern)**](/appstore/modules/genai/function-calling/), and knowledge base integration. For more details on this use case, see [How to Build Smarter Apps with Function Calling & Generative AI](https://www.mendix.com/blog/building-smarter-apps-with-function-calling-and-generative-ai/).
20+
21+
### Prompt Engineering Resources
22+
23+
* The [Prompt Engineering](/appstore/modules/genai/prompt-engineering/) documentation provides an introduction to the basics of prompting and useful tips.
24+
* The [Prompt Library](https://mendixlabs.github.io/smart-apps-prompt-library/) offers a collection of prompts used in Mendix applications, as well as other examples.
25+
* The blog post [Hey ChatGPT, Write a Blog Post About Prompt Engineering – Part 1](https://www.mendix.com/blog/part-one-hey-chatgpt-can-you-write-me-a-blog-post-about-prompt-engineering/) introduces the fundamentals of prompt engineering, including techniques and examples.
26+
* The blog post [Hey ChatGPT, Write a Blog Post About Prompt Engineering – Part 2](https://www.mendix.com/blog/hey-chatgpt-can-you-write-me-a-blog-post-about-prompt-engineering-part-2/) explores the Tree of Thought (ToT) prompt technique, provides recommendations for getting started, and discusses how to handle hallucinations.
27+
28+
### Additional Resources
29+
30+
* Basic documentation on [Get Started with Generative AI](/appstore/modules/genai/get-started/) is an essential resource for anyone beginning their GenAI journey.
31+
* The [GenAI Commons](/appstore/modules/genai/commons/) and [Conversational UI](/appstore/modules/genai/conversational-ui/) modules offer a comprehensive overview of the technical aspects.
32+
* The [OpenAI](/appstore/modules/genai/openai/) provides essential information about the OpenAI connector.
33+
* The [Amazon Bedrock](/appstore/modules/aws/amazon-bedrock/) provides key information about the AWS Bedrock connector.
34+
* The [PGVector Knowledge Base](/appstore/modules/genai/pgvector/) offers the option for a private knowledge base outside of the LLM infrastructure.
35+
36+
For any additional feedback, please send us a message in the #genai-connectors channel in the Mendix Community Slack. You can sign up [here!](https://mendixcommunity.slack.com/join/shared_invite/zt-270ys3pwi-kgWhJUwWrKMEMuQln4bqrQ#/shared-invite/email)
37+
38+
## Documents in this Category
39+
40+
* [Build a Smart App using a Starter Template](/appstore/modules/genai/using-genai/starter-template/)
41+
* [Build a Smart App from a Blank GenAI App](/appstore/modules/genai/using-genai/blank-app/)
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: "Build a Smart App using a Starter Template"
3+
url: /appstore/modules/genai/using-genai/starter-template
4+
linktitle: "Use a Starter Template to Build a Smart App"
5+
weight: 10
6+
description: "A tutorial that describes how to get started building a smart app with a starter template"
7+
---
8+
9+
## Introduction
10+
11+
This document guides on building a smart app using a starter template. Alternatively, you can create your smart app from scratch using a blank GenAI app template. For more details, see [Build a Smart App from a Blank GenAI App](/appstore/modules/genai/using-genai/blank-app/).
12+
13+
### Pre-requisites
14+
15+
Before starting this guide, make sure you have completed the following prerequisites:
16+
17+
* Intermediate knowledge of the Mendix platform: Familiarity with Mendix Studio Pro, microflows, and modules is required.
18+
19+
* Basic understanding of GenAI concepts: Review the [Enrich Your Mendix App with GenAI Capabilities](/appstore/modules/genai/) page to gain foundational knowledge and become familiar with the key [concepts](/appstore/modules/genai/get-started/).
20+
21+
* Understanding Large Language Models (LLMs) and Prompt Engineering: Learn about [LLMs](/appstore/modules/genai/get-started/#llm) and [prompt engineering](/appstore/modules/genai/get-started/#prompt-engineering) to effectively use these within the Mendix ecosystem.
22+
23+
### Learning Goals
24+
25+
By the end of this document, you will:
26+
27+
* Understand the core concepts of Generative AI and its integration with the Mendix platform.
28+
29+
* Build your first augmented Mendix application using GenAI starter apps and connectors.
30+
31+
* Develop a solid foundation for leveraging GenAI capabilities to address common business use cases.
32+
33+
## Building Your Smart App with a Starter Template
34+
35+
To simplify your first use case, start building a chatbot using the [AI Bot Starter App](https://marketplace.mendix.com/link/component/227926). This pre-built template streamlines the process, allowing you to quickly integrate AI capabilities into your application. You can see the result in the image below.
36+
37+
{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genai-howto-starterapp/starter_genai_interface.jpg" >}}
38+
39+
### Choosing the Infrastructure
40+
41+
Selecting the infrastructure for integrating GenAI into your Mendix application is the first step. Depending on your use case and preferences, you can choose from the following options:
42+
43+
* [OpenAI](/appstore/modules/genai/openai/): The [OpenAI Connector](https://marketplace.mendix.com/link/component/220472?_gl=1*1gbywo4*_gcl_au*NjUwMzI0NzA0LjE3MzI2MjkxMTI.) supports OpenAI’s platform and Azure’s OpenAI service.
44+
45+
{{% alert color="info" %}}
46+
To start, you can sign up for a free trial with OpenAI and receive credits valid for three months from the account creation date. For more details, see the [OpenAI API reference](https://platform.openai.com/docs/api-reference/authentication).
47+
{{% /alert %}}
48+
49+
* [Amazon Bedrock](/appstore/modules/genai/bedrock/): The [Bedrock Connector](https://marketplace.mendix.com/link/component/215042?_gl=1*yogwo1*_gcl_au*NjUwMzI0NzA0LjE3MzI2MjkxMTI.) allows you to leverage Amazon Bedrock’s fully managed service to integrate foundation models from Amazon and leading AI providers.
50+
51+
* Your Own Connector: Optionally, if you prefer a custom connector, you can integrate your chosen infrastructure. However, this document focuses on the OpenAI and Bedrock connectors, as they offer comprehensive support and ease of use to get started.
52+
53+
### Getting Started
54+
55+
Download the [AI Bot Starter App](https://marketplace.mendix.com/link/component/227926) from the Marketplace and configure the **encryption key** in the **App Settings**. Follow the steps below based on the infrastructure you chose.
56+
57+
#### OpenAI Configuration
58+
59+
Follow the steps below to configure OpenAI for your application. For more information, see the [Configuration](/appstore/modules/genai/openai/#configuration) section of the *OpenAI*.
60+
61+
1. Run the application locally.
62+
63+
2. Configure OpenAI Settings:
64+
65+
* In the chatbot-like application interface, go to the **Settings** ({{% icon name="cog" %}}) icon, and find the **OpenAI Configuration**.
66+
* Click **New** and provide the following details:
67+
* **Display Name**: A reference name to identify this configuration (for example, "My OpenAI Configuration").
68+
* **API Type**: Choose between **OpenAI** or **Azure OpenAI**.
69+
* **Endpoint**: Enter the endpoint URL for your selected API type.
70+
* **Token**: Provide the API key for authentication.
71+
* If using Azure OpenAI, add:
72+
* **Deployment Name**: Specify the deployed model (for example, *gpt-4o*, *gpt-3.5-turbo*, etc.)
73+
* **API Version**: Provide the version of the API you are using (for example, *2024-06-01*, *2024-10-21*, etc.)
74+
75+
* Click **Save** to store your configuration.
76+
77+
3. Test the Configuration:
78+
79+
* Select the configuration you created, and click **Test Configuration**.
80+
* If an error occurs, check the **Mendix Console** for more details on resolving the issue.
81+
82+
#### Bedrock Configuration
83+
84+
Follow the steps below to configure Amazon Bedrock for your application:
85+
86+
1. Set Up AWS credentials:
87+
88+
* Navigate to **App Settings** > **Configurations** in Studio Pro.
89+
* Go to the **Constants** tab and add the following (In this example, static credentials are used. For more details on the temporary credentials, see the [Implementing Temporary Credentials](/appstore/modules/aws/aws-authentication/#session) section of the *AWS Authentication*).
90+
91+
* `AWSAuthentication.AccessKey`: Enter the access key obtained from the Amazon Bedrock console.
92+
* `AWSAuthentication.SecretAccessKey`: Enter the secret access key from the Amazon Bedrock console.
93+
94+
* Save your changes.
95+
96+
2. Run the application locally.
97+
98+
3. Configure Bedrock settings:
99+
100+
* In the chatbot-like application interface, go to **Administration** > **Amazon Bedrock Configuration**.
101+
* Click **New/Edit** and provide the following details:
102+
* **Region**: Select the AWS region where your Bedrock service is hosted.
103+
* **Use Static Credentials**: Enable this option if you are using static AWS credentials configured in the app.
104+
* Click **Save & Sync Data** to ensure your changes are applied.
105+
106+
### Bot Configuration
107+
108+
Before starting the bot configuration, ensure that the OpenAI or Bedrock configuration is complete.
109+
110+
1. In the **Administration** menu, go to the **Bot Configuration**, and click **New**.
111+
2. Enter the following details:
112+
113+
* **Display Name**: A reference name for the bot configuration (for example, "Configuration Bot").
114+
* **Architecture**: Select **OpenAI** or **Bedrock** based on your choice.
115+
* **Is Selectable in UI**: Enable this option to allow the end user to select this configuration.
116+
* **Configuration**: Select the OpenAI or Bedrock configuration you just created.
117+
* **Action Microflow**: Choose the provided microflow, `ChatContext_ChatWithHistory_ActionMicroflow`.
118+
119+
3. Save your changes, and optionally set it as the default bot configuration by selecting **Make Default** on the Bot Configuration page.
120+
121+
## Testing and Troubleshooting
122+
123+
Follow the steps below to test the chatbot:
124+
125+
1. Navigate to the **Chat** option in the top menu to open the chatbot interface.
126+
2. In the **Configuration** box:
127+
* Select your bot configuration.
128+
* Optionally, choose instructions for the LLM to follow.
129+
3. Start interacting with your chatbot by typing in the chat box.
130+
4. For additional testing, create a custom instruction for the LLM, such as: 'You are a travel advisor assistant. Your role is to provide travel tips and destination information.'
131+
132+
Congratulations! Your chatbot is now ready to use.
133+
134+
If an error occurs, check the **Mendix Console** in Studio Pro for details to help resolve the issue.

0 commit comments

Comments
 (0)