A "prompt" is an instruction or question given to a language model or chatbot to elicit certain behavior.
A language model is an AI-based text generator, and "prompt engineering" is a relatively new technique for developing and optimizing prompts. With the help of this technique, large language models can autonomously complete or generate texts. However, simply adding knowledge is not enough! Your chatbot doesn't know how to use or apply that knowledge. Your prompts provide the context for the chatbot to utilize the knowledge it already has and focus it on your company, products, and services. You create the framework and boundaries within which the chatbot can operate.
General tips & tricks
- Be clear and concise: Formulate your prompts in a clear and concise manner so that the chatbot can easily understand and follow the instructions.
- Provide context: Ensure that your prompts provide sufficient context to the chatbot. This helps the chatbot provide accurate answers based on the specific situation. 'Don't tell, but show': demonstrate the chatbot how to handle provided information. You can do this by giving the chatbot examples of questions and answers, by adding this to a specific prompt:
User: [question of the user]
Assistant: [what you want to see the chatbot respond to the questions]
- Be specific: Give detailed instructions to the chatbot, especially when it comes to specific tasks or interactions with users. Avoid vague or general instructions that can lead to misunderstandings. The chatbot takes instructions very literally!
- Consider different languages: If your chatbot is multilingual, ensure that your prompts and instructions are consistent with the user's language. Set up language-specific prompts if necessary to ensure the chatbot responds correctly. You can find additional information on making your chatbot respond in different languages in this article.
- Test and improve: Experiment with different prompts and regularly test how the chatbot responds. Adjust the prompts based on feedback and learn from interactions to improve the chatbot's performance.
- Stay up-to-date: Keep your prompts regularly updated with the latest information and developments in your company or industry. This ensures that the chatbot provides relevant and up-to-date answers.
- Be friendly and empathetic: If the chatbot is customer-oriented, consider adding prompts that are friendly and empathetic. Let the chatbot show understanding and provide supportive responses to enhance the user experience. Implement this not only in the domain knowledge/personality but also in the context manager/prompts.
- Use positive language: For example, use phrases like "you can" or "you say A when asked B" instead of "you cannot" or "you don't answer question B."
- Monitor and analyze: Keep a close eye on the chatbot's interactions and analyze the provided answers. Identify patterns, frequently asked questions, and possible areas for improvement. Use these insights to optimize the prompts and the chatbot's performance.
By following these tips, you can create effective prompts that help your chatbot communicate better and support users in an appropriate and useful manner.
Watch this video:
Standard prompts necessary for a successful chatbot are referred to as "domain knowledge." This includes personality, company information, service, and other relevant aspects. By writing these prompts, you provide context to the chatbot and instruct it on how to respond to certain questions or texts.
We recommend filling the personality and company information prompts with the chatbot's personality (tone of voice) and information about the company it represents. The service and other prompts can also be filled with other relevant information.
Examples of Prompts in Personality
Here are some examples of prompts to fill the chatbot's personality. Of course, you can customize these prompts according to your preferences.
- You are chatbot XXX and work at XXX as XXX. You answer all questions from XXX's customers asked online. You are XXX.
- You use informal but professional language.
- You speak on behalf of XXX in the first-person plural form.
- As XXX, you only discuss topics related to XXX. If you receive a question, comment, or input that doesn't pertain to XXX, respond with "That's an interesting question, but I can't help you with that. Do you want to know something about XX?"
User: What is a cow?
Assistant: "That's an interesting question, but I can't help you with that. Do you want to know something about XX?"
- You respond in the language the customer speaks. If the input is in multiple languages, choose the language with the most words.
You always respond in the same language as the question is asked.
User: Hello, how are you?
Assistant: I'm fine.
User: Wie geht es dir? (How are you in German)
Assistant: Gut (Good in German).
- You provide answers within a maximum of 30 words.
Your answers consist of a maximum of 30 words.
- You only discuss and provide advice on products and services from XXX's range.
- You use emojis that are appropriate for the given answer.
- You enjoy making jokes about XXX.
- You may end the conversation with a joke about XXX but first ask if the user wants to hear one.
- You always ask at the end of your response if the user has been helped. If the user indicates they haven't been helped, describe the best way for them to contact for further assistance.
Instructions and frames
Additionally, you can provide the chatbot with other instructions in the context manager in Watermelon Pulse. It's important to realize that simply adding knowledge doesn't provide the right instructions for the chatbot. You should consider your chatbot as a new colleague. Like with a new colleague, you teach them what their scope is, establish the tone of voice, define processes for specific issues, and specify which information can and cannot be shared.
The difference is that your new colleague already has general knowledge to answer a question like "what is football?" but knows not to elaborate too much on it. We will teach the chatbot this. This ensures that the chatbot only answers questions about your company instead of promoting competitors or providing information unrelated to your company.
Below are various examples of prompts to provide your chatbot with these instructions and guidelines.
Limit to company information prompt
When you don't provide guidelines, your chatbot has knowledge of the entire internet. This means it can answer all kinds of questions, such as "what is football?" or "who are the best suppliers for chatbots?" We don't want your chatbot to promote competitors. Additionally, providing answers on topics unrelated to your company, products, or services can be sensitive. Therefore, we instruct the chatbot not to speak about other topics. We achieve this by adding the following prompt:
As chatbot XXX, you don't talk about topics other than XXX. If you receive a question, comment, or input that doesn't pertain to XXX, respond with 'That's an interesting question, but I can't help you with that. Do you want to know something about XX?'"
User: What is a cow? Assistant: "That's an interesting question, but I can't help you with that. Do you want to know something about XX?"
You can customize this prompt according to your needs.
Decision tree prompt
A commonly used prompt is the "decision tree" prompt, which allows the chatbot to ask follow-up questions. You can set it up as follows: "If the visitor says A, the chatbot responds with B." Here's a concrete example:
If someone asks about the whereabouts of their package, ask for the order number. If the order number starts with 1-, inform them that the tracking code can be found in the order confirmation email. If the order number starts with 2-, advise them to call customer service for the order status. If the order number starts differently, inform them that the order is not recognized in the system.
User: Where is my package? Assistant: I'm here to help! What's your order number? User: ORDNR345 Assistant: The tracking code can be found in the order confirmation email you received!
User: ORDER286 Assistant: I recommend calling customer service to get the most up-to-date status.
User: Another number Assistant: This order number is not familiar to me and is not recognized in our system.
Adding links and generating hyperlinks
It's also possible to set which hyperlinks the chatbot can send in the prompts. You can learn how to do this in this article.
Disclaimer in advice prompt
In some cases, it's important for the chatbot to clearly identify itself as an AI assistant and indicate that the advice given is not binding. We provide this instruction to the chatbot as well. Let's use a medical clinic as an example. A prompt could be:
When someone shares a complaint, provide advice by sharing the most relevant URLs with solutions. Always mention that you are a digital assistant, and your advice is not binding. Always advise consulting a doctor if the symptoms persist.