Pega provides two primary GenAI capabilities:This is the article I’ve been waiting to write, as Pega 25 is now GA, and GenAI Connect unlocks a completely new way to infuse GenAI into case management. Let’s start understanding this GenAI connect rule by following a simple scenario.

Scenario

As a Solution Architect, you want Pega to generate a personal fitness plan based on a user’s health details:

  • Age
  • Gender
  • Height
  • Weight
  • Symptoms

We will use Pega 25 GenAI Connect to send this information to an LLM and receive personalised exercise recommendations.

This example is only to demonstrate GenAI Connect technically.

Case & Data Model

Create a case type: Health Assessment and needed data attributes like Age, Gender, Height, weight, and Symptoms and exercise plan data reference to store Plan Type, Duration, sets, target area, etc.

This case will collect inputs and pass them to the AI engine.

Introducing AI Designer (Pega 25)

Go to App Studio to find out about AI Designer. Pega provides two primary GenAI capabilities:

Article content
Article content

For this scenario, we use GenAI Connect.

GenAI Connect – Configuration

Create a GenAI Connect rule and fill out basic details, especially the cases where you want to integrate GenAI.  For now, you do not want to worry about System & User Prompt; by default, Pega uses Autopilot to generate these prompts. I have updated those prompts as per our requirement.  Let’s understand these prompts in detail.

Article content

System Prompt

This defines the role and behavior of the model.

“Act as a professional fitness coach. Your goal is to generate safe and beginner-friendly exercise plans…”

Here I have updated those instructionsinstructions as per my requirement, but they can be further tuned using Autopilot

Article content

User Prompt

This describes how the user/data is provided and how the model should respond.

By this prompt, you are informing the GenAI rule about how a user would ask. Technically, we are making the Gen AI rule to be prepared for such prompts to generate responses in order to help us map the required content back to the Pega Data model.  Here on the right side, I have used an embedded Page to map the generated exercise plans.

Here, I need to pass the user information via masked data, and as parameters, I have used {} to map required data from the case data model.

Article content

Here, sometimes, we might ned to mask the data, for example, a user’s weight and some confidential health parameters while masking.

Article content

Model

Pega provides a good number of out-of-the-box options to choose the best LLM engine.  I have used GPT 40 mini based on a performance comparison, which I will explain later in this article.

Article content

Temperature

Temperature specifies how best you want the model to generate content as per need, anything between 0 to1 as per results (after a few iterations after running this agent)

Article content

Unit Test & Choose the Best Model

Run the configured GenAI rule to check on the response and choose temperature or model settings as per the run results.

Article content

Here, we can use the Compare option to run these prompts against another LLM model and pick a good-performing one. Once tested and satisfied with the response style and response data. Let’s now integrate the above GenAI connect rule to the case the case flow.

Case Designer – Automation Step (GenAI Connect)

Add an automation step called GenAI Connect and choose an existing GenAI rule to map the above created rule and show the response as view in the flow

Article content

Demo

Let’s run a simple case as an individual and test whether the system is able to generate a few fitness exercise plans based on the case data. Here, as shown below, we can see that based on the given health information, the system can provide a few plans within consideration of instructions and provided health data with respect to age, gender, height, weight, and so on.

Article content

After this step, the GenAI connect rule gets integrated, and the results are shown as a review for the user to choose and continue.

Article content

Summary

We have seen how Pega 25 GenAI Connect seamlessly embeds Generative AI into case workflows, enabling dynamic data-driven outcomes without custom integrations.

I’m Kondal

Hello, I’m Kondala Rao, known as Kondal. With extensive IT experience spanning product development, solution consulting, and business conduct, my passion lies in hands-on experimentation with the latest features of the Pega Platform and other low-code/no-code platforms to benefit businesses. Whenever I get free time, this blog is a space where I share insights, tips, and tutorials to help you leverage these technologies effectively.

I believe that even if one person benefits from my insights, it enriches my purpose to serve better. Join me on this journey of exploration and learning, and let’s elevate our skills together.

Happy Reading!!!

Let’s connect