Optimize prompts and topic configuration

When using Generative AI, it's important to understand the best practices related to prompting and topic configuration. This article shares a few key practices, and helps you integrate guardrails to optimize results, and reduce errors and hallucinations in generated responses.

Generative AI settings

Normally, Generative AI settings are configured at the start of the agent build (see the Generative AI tab once the agent is created). These settings enable you to define a knowledge base for the agent and clarify the content leveraged for the generation of answers, including the following:

  • Website URLs

  • Uploaded documents

  • Desired moderation level

Consider these settings as the broadest knowledge base of information for the agent to be used, unless there are specific instructions configured in a triggered topic flow.

To learn more about the content types supported by Generative AI, and how to boost natural language capabilities, see the following articles:

Generative answers with custom instructions

In addition to the Generative AI settings page, you might also add generative answers as a node to any topic flow.

Screenshot showing the selection of generative answers from the advanced menu options.

Screenshot of the Create generative answers dialog.

Once a node is added, there are several ways to help optimize prompts. You might include fields for configuring the input prompt, data sources, and custom instructions. Custom instructions have a high return on investment, but are also often ignored.

To locate custom instructions, from the Create generative answers node dialog open the Properties pane, by selecting the node's ... then Properties.

Screenshot illustrating the process of selecting Custom Instructions from the Create generative answers properties dialog.

Sample prompts

The following examples illustrate a typical agent experience involving an end user asking questions, which results in the flow of the topic arriving at the generative answers node. The first example shows a prompt without custom instructions, while the second shows a prompt using custom instructions.

Sample prompt without custom instructions

Prompt: What should I consider when buying an electric car (for a Lexus agent)?

Response: When considering the purchase of an electric car, there are several factors you should take into account to ensure that you make an informed decision that suits your needs and preferences. Here are some key considerations:

  1. Charging Infrastructure: Assess the availability of charging stations at home, work, and in public areas. Some companies offer charging stations for employees, so it's worth checking if this is available at your workplace. ¹

  2. Range: Consider how far you can drive on a single charge and whether it meets your daily commuting needs.

  3. Cost: Evaluate the total cost of ownership, including the purchase price, incentives, tax breaks, and the cost of electricity versus gasoline.

  4. Maintenance: Electric cars typically require less maintenance than traditional gasoline cars, but it's important to understand the long-term maintenance requirements and costs.

  5. Performance: Test drive different models to experience their acceleration, handling, and comfort.

  6. Size and Capacity: Ensure the car fits your personal or family needs in terms of size and cargo space.

  7. Technology: Electric cars often come with advanced technology features. Determine which technology features are important to you, such as regenerative braking, advanced driver-assistance systems, or connectivity options.

  8. Environmental Impact: Consider the environmental benefits of driving an electric car, such as reduced emissions and a smaller carbon footprint.

  9. Resale Value: Research the car's resale value and how well it retains its value over time.

Note

The remaining numbered items, and a recommendation to talk to a friend, were truncated. The answer was already long, which doesn't help Lexus to inspire a car purchase.

Sample prompt with custom instructions

Prompt: What should I consider when buying an electric car (for a Lexus agent)?

Response: The top three factors to consider when buying an electric car in 2024 are:

  1. Range: Ensure the car's range aligns with your daily travel needs.

  2. Charging Options: Consider the availability and convenience of charging facilities.

  3. Price and Incentives: Factor in the cost, including any available tax benefits or incentives.

For Lexus, the RZ450e stands out in our 2024 electric lineup, offering a blend of luxury and performance with advanced technology features. For detailed information on our electric vehicles, please refer to the Lexus website or contact us directly for personalized assistance.

Tip

In both the custom instructions, as well as the actual input prompt, you can also leverage a formula to make the prompts more dynamic, based on variables existing before the node. The following example shows where the prompt changes, based on the desired focus area and the student’s level (previously asked in the Topic flow).

Screenshot of the Enter formula dialog.

Note that any prompts and/or instructions configured by the agent maker aren't submitted to the same level of safety filtering as are end user prompts.