Share via


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 incorrect information in generated responses.

Generative AI settings

Typically, you configure Generative AI settings at the start of the agent build (see the Generative AI tab once the agent is created). By using these settings, you can define a knowledge base for the agent and clarify the content leveraged for the generation of answers, including the following types of content:

  • Website URLs
  • Uploaded documents
  • Desired moderation level

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

Learn more about the content types supported by generative AI and how to boost natural language capabilities in your agent:

Generative answers with custom instructions

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

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

Once a node is added, there are several ways to 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.

Screenshot of the Create generative answers node dialog.

To locate custom instructions, from the Create generative answers node dialog, open the Properties pane. Next, select the node's three dots (), and 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 a customer 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 option is available at your workplace.1

  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

1 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 and the actual input prompt, you can use 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 showing a formula editor with a PlainText function.

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