Buddy prompt management and testing
Writing prompt instructions is an iterative process that involves testing and refining over time, so the prompt instructions that you initially create for a Pega GenAI Knowledge Buddy™ rarely remain unchanged. Improving a prompt over time can involve user testing, analyzing user feedback, and adjusting the prompt as needed. There is no strict rule or specific format requirement that you need to respect when you write prompts for a knowledge Buddy, but there are a series of best practices that you should follow for better results.
Ultimately, each prompt should be unique to the function that the Buddy performs, and you should adjust the prompt until the Buddy consistently provides the expected results.
Best practices for writing prompts
Well-crafted prompts that effectively convey the desired task or context tend to produce more accurate and relevant results, as the clarity and specificity of the instructions directly influence the accuracy and relevance of the Pega GenAI™ output. The following guidelines are a series of best practices for writing prompts, but you should supplement this list with other best practices that are specific to your organization.
- Provide clear and specific instructions: Ensure your prompts clearly explain what you expect the Buddy to do and provide any necessary information or context.
- Ensure that every rule is valid and concise: Although the prompt length does not present an issue, be concise; for example, a numbered list provides better readability.
- Use simple and concise language: Avoid using technical jargon or complex language, and focus on either an informal style or a code format for your prompt, but do not mix them.
- Be consistent: While there is no specific format requirement, a consistent format and style for your prompts helps the Buddy understand what you expect of it.
- Test your prompts: Before making a Buddy available to users in your organization, test them with a sample audience to ensure that your prompts are effective and easy to understand.
- Avoid hallucinations: Ensure that your prompts are unambiguous and are not open to multiple interpretations. A Buddy should only create responses based on the context provided, which helps prevent confusion and made-up responses.
- Follow style guidelines: If you are writing prompts for a specific organization, follow any style guidelines to help ensure consistency and professionalism.
Buddy testing
It is crucial that you thoroughly test your Buddy instructions before publishing. After you submit and resolve a Buddy, it becomes available for use outside the Buddy Portal application. However, Buddies in an IN-PROGRESS state are inaccessible outside the Knowledge Buddy Portal.
When you make changes to a published Buddy, it is important to exercise caution and make changes in a controlled manner. Randomly editing a Buddy to suit a specific use case is not a best practice. If you edit a "live" Buddy when its status is IN-PROGRESS, users cannot ask questions until you republish it. Plan Buddy maintenance accordingly .
Create a second Buddy (V2) of the original Buddy by copying it and changing the instructions to continue maintaining and tuning it. It is a best practice to have a list of questions that previously returned the right answers and a list of new questions and target answers that you expect following your changes.
As a Buddy Manager, you must extensively test to ensure that the prompt returns the expected results and addresses any negative use cases. Even a small change to the instructions can produce vastly different results due to how prompting works with generative AI.
Prompt revision example
The following example is a sample prompt before and after restructuring to make it more concise and focused. In the improved version, the rules are displayed as a numbered list, the language is simplified, and specific instructions are included for each rule. Additional rules provide instructions for the situation in which the Buddy does not find an answer in the provided context.
Move the slider from one side to the other of the following image to compare examples of a prompt before and after best practices have been applied.
This Topic is available in the following Modules:
Want to help us improve this content?