top of page
  • Writer's pictureDaniel Shoroye

How to configure your chatbot behaviour for your use case




Whether you're a Personified chatbot enthusiast or just getting started with the platform, our configuration features can help you to fine-tune your chatbot for better responses relative to your use case. In this blog post, I'll guide you through our various configuration options and their practical applications.


Note: You can create different chatbots. You can modify the customisations for each chatbot without affecting the others.


Note: To customise a chatbot go to the configuration hub in your chatbot settings and click on the settings cog(this is also where you upload files).





Model Selection (Basic Settings>Model)


The type of model used will influence the results of your chatbot. Personified currently has two models available for customers to use, these are GPT-3.5 (ChatGPT) or GPT-4.

One key difference between these two models, aside from the cost, is that GPT-4 is a far larger model size than GPT-3.5. For this reason, GPT-4 is typically better at handling complex tasks, including problem solving and generating more accurate responses.

Which model to use will depend on your use case.


Temperature (Basic Settings>Temperature)


Temperature has nothing to do with the weather outside unfortunately, although we do wish it could be controlled with a slider.

In simple terms, temperature is a parameter used in large language models that controls the randomness and creativity of the generated text. A higher temperature value leads to more unpredictable and diverse responses, while a lower temperature value leads to more conservative and predictable responses.


If we were creating a chatbot to help users navigate technical documentation for example, it would make more sense for our temperature to be lower as in this case, we want our chatbot to respond predictably based on what it is available in the uploaded content which is where we will get the context to provide an answer. However, if we were creating a chatbot to generate ideas for marketing purposes, increasing the temperature to receive more creative answers would be more suitable.


Chatbot Behaviour Configuration

Scrolling down further within the configuration hub section, we arrive at the chatbot behaviour configuration.


System Message (Chatbot Behaviour Configuration>System Message)


The system message in Personified serves as a contextual guide or initial instruction that helps set the tone, topic, and direction of the generated responses. It can affect the quality, relevance, and depth of the answers produced by the chatbot. When the system message is clear and specific, it helps the chatbot understand the context and respond more accurately. On the other hand, if the system message is vague or ambiguous, the chatbot might produce responses that are less focused, less relevant, or off-topic.


Example:


Let's consider two different system messages for the same chatbot:



1. System Message: "You are an AI language model that provides general information about various topics."

2. System Message: "You are an AI language model that specialises in providing detailed technical information about computer programming languages and frameworks."

Now, let's see how the chatbot may respond to the same user prompt under the influence of these two different system messages:


User Prompt: "What is Python used for?"


Response with System Message 1:


"Python is a versatile programming language used for a variety of purposes, including web development, data analysis, artificial intelligence, machine learning, automation, and more. Due to its readability and ease of use, Python is popular among both beginners and experienced programmers."

Response with System Message 2:


"Python is a popular high-level programming language that is widely used in various domains of computer programming. Some of its primary applications include:

1. Web Development: Python offers numerous frameworks such as Django, Flask, and Pyramid, which enable developers to build web applications efficiently and effectively.
2. Data Science: Python provides powerful libraries like NumPy, pandas, and SciPy for data manipulation, analysis, and visualization, making it a preferred choice for data scientists.
3. Machine Learning and Artificial Intelligence: With libraries such as TensorFlow, Keras, and scikit-learn, Python facilitates the development and implementation of machine learning algorithms and AI models.
4. Automation and Scripting: Python's simplicity and extensive standard library make it suitable for writing scripts to automate tasks, such as file management, web scraping, and data extraction.
5. Networking and Security: Python offers libraries like Scapy, Nmap, and Requests for developing network tools and security applications.

As evident from the responses, the system message significantly influences the depth and focus of the information provided by the chatbot. The first response gives a general overview of Python's uses, while the second response, influenced by the more specific system message, provides a more detailed and technical explanation of Python.


The system message to use depends on your use case and the type of content in the files your chatbot will be referencing to generate answers.


We recommend to use just one system message at this level.


Context Available (Chatbot Behaviour Configuration>Context)


When there will be context available in the content you have uploaded to answer the question, providing more context by developing a pre-emptive conversation with system message, user message, and assistant message helps the chatbot understand the specific scenario, roles, and expectations of the ongoing discussion. This allows the chatbot to generate more relevant, accurate, and contextually appropriate responses, which can enhance the user experience and make the conversation more meaningful.



Example:


Let's consider a conversation where the context is provided as follows:


System Message: "You are an AI language model that specialises in providing information about healthy eating habits."

User Message: "I am looking for ways to eat healthier."

Assistant Message: "It's great that you're interested in improving your eating habits! Start by incorporating more fruits, vegetables, whole grains, and lean proteins into your diet, and cutting back on processed and sugary foods."

Now, let's see how the model may respond to a user prompt under the influence of these contextual messages:


Note: In this example you have uploaded files containing your healthy snack suggestions, this content is being used to answer the question.


User Prompt: "Can you suggest some healthy snacks I can try?"

AI Assistant Response:
"Absolutely! Here are some healthy snack options you can consider:

1. Fresh fruits: Apples, bananas, oranges, or berries make great on-the-go snacks.
2. Yogurt: Opt for low-fat or Greek yogurt, and add fresh fruits or nuts for extra flavour and nutrition.
3. Nuts and seeds: A handful of almonds, walnuts, or pumpkin seeds can be a satisfying and nutrient-dense snack.
4. Veggie sticks: Prepare carrot, cucumber, or bell pepper sticks, and pair them with hummus or a yogurt-based dip for added taste.
5. Whole grain crackers: Choose whole grain crackers and pair them with low-fat cheese or a thin layer of natural nut butter.
6. Rice cakes: Top rice cakes with avocado, tomato, and a sprinkle of black pepper for a light and healthy snack.
7. Granola bars: Look for low-sugar, whole-grain granola bars, or make your own at home with oats, nuts, seeds, and dried fruits.

Remember to practice portion control and moderation when snacking.

By providing the context through system message, user message, and assistant message, the your chatbot can generate responses that are more relevant and specific to the user's needs from the first message, resulting in a more engaging and informative conversation.


Now what if there is no content available in your uploaded files to answer the users question, how should the chatbot approach this situation?


No Context Available (Chatbot Behaviour Configuration>No Context)


Sometimes users might ask questions that do not relate to your uploaded files. Providing context for what to do in this case by pre-emptively curating a conversation with the system message, user message, and assistant message helps your chatbot handle these scenarios. By setting the context, you can ensure that the chatbot can provide a suitable response when the required information is not available, thus maintaining a smooth and engaging user experience.



Example:


Let's consider a conversation where the context is provided as follows:


System Message: "You are an AI language model that specialises in answering questions based on the content from the uploaded files. If you cannot find relevant information in the files, politely inform the user and suggest alternative ways to find the information."

User Message: "I am looking for information that might not be available in the uploaded files."

Assistant Message: "I apologise if I am unable to answer your question based on the available content. If I cannot find the information you seek, I will let you know and suggest other ways you can explore to find the information."

Now, let's see how the model may respond to a user prompt under the influence of these contextual messages:


User Prompt: "Can you tell me about the history of a cello?"

Chatbot Response (assuming the information required to answer is not available in the uploaded content):


AI Assistant Response:
"I apologise, but I am unable to find any information about the cello you mentioned in the files I have access to. However, I suggest you explore the following alternative ways to find the information you're looking for:

1. Online search: Perform a search using a search engine like Google, which may yield results from articles, forums, or blogs about the cello.
2. Online encyclopaedias: Websites like Wikipedia often have comprehensive articles on various topics, including cellos.
3. Books and publications: Visit a library or search for books and academic publications that focus on the history of musical instruments.
4. Music experts or historians: Reach out to experts in the field of music history, who may have specialised knowledge about the cello.
5. Museums or exhibitions: Explore museums or exhibitions that showcase musical instruments, as they might display or have information about the cello.

I hope these suggestions help you in your quest for information. If you have any other questions or need assistance with a different topic, please feel free to ask."

By providing context with system message, user message, and assistant message, you can ensure that the Chatbot can handle scenarios where the required information is not available, offering a relevant and helpful response that maintains user engagement and satisfaction. This approach improves the overall user experience, as the chatbot acknowledges the limitation, yet provides alternative solutions or resources to assist the user in their search for information.


No Context Available (Chatbot Behaviour Configuration>No Context)

Using regex (regular expressions), we can filter out unwanted terminology and replace them with alternative words or phrases in the chatbot's responses. This allows you to maintain content quality, ensure compliance with specific guidelines, and adapt the language to better suit your audience. By setting up regex filters with replacement words or phrases, you can create a more controlled and customised user experience tailored to your target audience or desired tone.



Example:


Let's consider a chatbot designed for a professional environment that wants to avoid informal language and maintain a formal tone. The owner wants to replace certain informal phrases with more formal alternatives.


Regex filters with replacement words/phrases (up to five) can be set up as follows:


1. `/wanna/`"want to"
2. `/gonna/`"going to"
3. `/gotta/`"have to"
4. `/kinda/`"somewhat"
5. `/ain't/`"is not"

These regex filters would replace the informal phrases with more formal alternatives in the chatbot's responses. Here's an example of how the filters can affect the chatbot's responses:


Without filters:


User Prompt: "I wanna know more about the project timeline."

AI Assistant Response: "Sure, I can help you with that. The project is gonna start next week, and you gotta complete the initial tasks within the first two weeks. If you have any questions, don't hesitate to ask."

With filters applied:


User Prompt: "I wanna know more about the project timeline."

AI Assistant Response: "Certainly, I can help you with that. The project is going to start next week, and you have to complete the initial tasks within the first two weeks. If you have any questions, please do not hesitate to ask."

As seen in the example, the filtered response replaces the informal phrases with more formal alternatives, maintaining a professional tone. By using regex filters with replacement words or phrases, you can ensure that the your chatbots responses align with the desired guidelines and create a more appropriate user experience for the target audience.


Note: You can use this functionality to filter out responses that begin with 'As an AI language model[...]' and replace it with something perhaps more human like such as "I'm not sure but...". This can be used to create a more immersive experience.


What will you build?


There are many variables to tweak when configuring your chatbot that can heavily influence your chatbots output. Please be careful to consider the use case and the desired user experience you wish to achieve when configuring your chatbot.


If you need any help or guidance in customising your chatbot for your use case, feel free to reach out to support@personified.me or get in contact with Daniel - daniel@personified.me.


This article was orginally published by Daniel Shoroye in May 2023.





bottom of page