Skip to main content
By using the right prompts, we can make sure our AI chatbots are responding accurately and appropriately—and that we’re delivering more sophisticated and engaging user experiences. They’re kind of like nudges in the right direction. The knowledge base determines what your AI Agent knows, while the prompt determines how it behaves. If the information itself is missing or outdated, update the knowledge base rather than trying to solve the problem by changing the prompt.

How prompts, the knowledge base and functions work together

When a user sends a question, the AI Agent uses multiple inputs to determine the appropriate response. How the response is generated:
Image

Where prompts are set

Prompts can be configured in different AI-powered blocks depending on what you want the block to do.

Structure of a good prompt

A well-structured prompt makes it easier for the AI Agent to understand its responsibilities and consistently follow the expected behaviour. A recommended prompt should contain four sections:
  1. Role
  2. Instructions
  3. Tone and guardrails
  4. Examples
Write these sections in the same order so that the AI Agent receives the most important context first.

Role

The Role section defines who the AI Agent is, who it serves, and what it is responsible for. Clearly establish the agent’s purpose and boundaries. Avoid giving the agent responsibilities that belong to another system or process.
A good role definition gives the AI Agent a clear identity and prevents it from behaving outside its intended purpose.

Instructions

Describe what the AI should do and how it should handle different types of questions. Write instructions as clear, actionable rules. Include what the agent should do when it has the required information and what it should do when it does not. Clear instructions reduce ambiguity and help the AI Agent follow a consistent process.

Tone

Define how the AI should communicate with users. Specify the desired voice, level of formality, response length, topics the agent should avoid, and situations where the conversation should be transferred to a human.

Guardrails

Define what the AI should and should not do. Use guardrails to restrict unsupported topics, prevent the AI from making up information, and define when it should escalate to a human.

Complete Prompt Examples

Lead generation prompt:

Customer support agent:

Appointment booking agent:

Other Examples:

Good and bad examples

A prompt does not need to be long to be effective. The goal is to make each instruction clear, specific, and actionable.

Common mistakes

Avoid giving the AI Agent instructions that contradict each other.
Adding more instructions does not necessarily make a prompt better.A prompt that contains too many repetitive, unrelated, or overly detailed instructions can make the intended behaviour harder to follow.Keep instructions:
  • Clear
  • Relevant
  • Specific
  • Non-repetitive
  • Focused on the agent’s actual responsibilities
Remove instructions that do not affect the desired behaviour.
Do not use the prompt as a replacement for your knowledge base.For example, avoid adding long lists of:
  • Product details
  • Pricing
  • Policies
  • FAQs
  • Company information
  • Delivery information
Instead, store this information in the Knowledge Base and tell the AI Agent to use it when answering questions.The prompt should define how the information should be used, not contain all the information itself.
One of the most important behaviours to define is what the AI Agent should do when it does not know the answer.Without clear instructions, the AI Agent may attempt to provide an answer even when the required information is unavailable.
Define when the AI Agent should stop handling a conversation and involve a human agent.

Testing and iterating:

Prompt behaviour can change when you add, remove, or modify instructions. Test changes systematically before deploying them.

Create a fixed set of test questions

Prepare a list of common customer questions that represent the conversations your AI Agent is expected to handle.
  • Edge cases — unusual or ambiguous questions.
  • Unknown questions — questions that are outside your knowledge base or supported scope.
  • Escalation scenarios — questions where the user should be transferred to a human.
  • Behaviour-specific questions — questions that test a particular instruction in your prompt.
For example, if you are building an e-commerce support agent, your test set could include:

Test the existing Prompt

When a response does not meet your expectations, determine why before changing the prompt. For example:
  • The answer contains incorrect facts → Check whether the required information exists in the knowledge base.
  • The AI does not follow a specific instruction → Make the prompt instruction clearer or more specific.
  • The response is too long → Add a specific response-length instruction under Tone.
  • The AI guesses when it does not know the answer → Add a clear fallback rule under Instructions or Guardrails.
  • The AI does not transfer users to a human → Add an explicit escalation rule.
  • The AI gives different answers to similar questions → Make the instruction more specific and test additional examples.
This helps you avoid using the prompt to solve problems that actually belong in the knowledge base or configuration.

Change one thing at a time

If the AI Agent does not behave as expected, change only the relevant part of the prompt.  For example, if the AI is giving responses that are too long, change the response-length instruction:
Then run the same test cases again. If you change the role, tone, fallback behaviour, and examples at the same time, it becomes difficult to determine which change improved or worsened the results.

Compare the results/ Run the same question again

Run the same test cases after making your change and compare the new responses with the previous results. Ask:
  • Did the AI follow the updated instruction?
  • Did the change solve the original problem?
  • Did it introduce any new problems?
  • Did responses to unrelated questions remain consistent?
  • Does the AI still follow the other instructions in the prompt?
A prompt change is successful when it improves the intended behaviour without negatively affecting other important behaviours.

Improve prompts based on patterns

If the same problem appears across multiple test cases, update the prompt to address the underlying behaviour rather than adding a separate instruction for every individual question. For example, if the AI repeatedly gives long responses, avoid adding:
Instead, add a general rule:

Keep testing as you iterate/ Repeat until the behaviour is consistent

Continue the cycle: Test → Identify the problem → Change one thing → Test again → Compare results Keep your original test cases even after the prompt improves. Add new test cases whenever you discover a new edge case or failure. Over time, your test set becomes a reliable way to check whether future prompt changes improve the agent without breaking existing behaviour.
Keep a fixed set of real customer questions and run them after every significant prompt or knowledge base change. This gives you a consistent way to measure whether your changes actually improve the AI Agent.

When to use Custom Answers instead

Not every response issue requires a prompt change. If you need a specific question or scenario to always return a specific response, Custom Answers may be a better solution.
Last modified on October 22, 2026