Hi Mallikarjun Jaggarapu,
the GenAI Showcase App covers a lot of examples to integrate AI into a Mendix application. Some of the examples demonstrate patterns that you might find useful.
To build your use case, there are a few options that you can discover:
I hope that helps you to get inspired and build your chat bot in Mendix.
Best regards
Liam
Build a Chatbot in Mendix 10.21 Using ChatGPT and PostgreSQL
Objective
Let users ask questions in natural language (e.g., “Show mobiles under 20000”)
Use ChatGPT to convert input to structured data (e.g., category = mobile, price < 20000)
Use structured data to search PostgreSQL
Display results in Mendix
Tools Required
Mendix 10.21
OpenAI Connector v5.2.0Link: https://marketplace.mendix.com/link/component/120144
PostgreSQL Database
(Optional) External Database ConnectorLink: https://marketplace.mendix.com/link/component/118664
Implementation Steps
1. UI Setup
Add a text input field and a send button
On button click, trigger a microflow
2. Store User Input
Create an entity UserQuery
with fields:
UserInput (String)
StructuredCategory (String)
StructuredPriceLimit (Decimal)
3. Call ChatGPT
Use CallOpenAIChatCompletion
from OpenAI Connector
Provide prompt to extract structured filtersExample prompt:
Convert this question into JSON format: "Show mobiles under 20000" Expected Output: { "category": "mobile", "price_limit": 20000 }
4. Parse ChatGPT Response
Create a JSON structure based on the expected output
Use Import Mapping to convert JSON to Mendix object
Store values in StructuredCategory
, StructuredPriceLimit
5. Query PostgreSQL
Option A: If data is in Mendix, use XPath
Option B: If using PostgreSQL directly, use OQL or SQL via External Database Connector
6. Display Results
Use a ListView or DataGrid to show filtered results
Bind it to a microflow or data source returning the query result