top of page
  • Writer's pictureIgor Alcantara

Teaching Qlik Answers to Program: A Step-by-Step Journey


Qlik Answers is a powerful tool within the Qlik Cloud platform, designed to harness the capabilities of AI by providing contextually relevant answers from unstructured data. Many great people are already providing incredible use cases for this tool. The way I decided I could contribute more was to run a few exercises and analyses, like the article I published on this blog about my first impressions of Qlik Answers and the many other posts I shared on my LinkedIn. This one here is another example which came from a demo I gave to a customer last week.


I was asked whether users could use Qlik Answers as a replacement for ChatGPT and start applying it to non-work-related tasks. While Qlik Answers, like any advanced AI assistant, is built on a pre-trained LLM, its primary design is to serve specific business needs. For example, if a bank decides to implement a custom version of ChatGPT for its customers, the base model is trained on the bank’s data, creating a tailored chatbot for customer interactions. The expectation is that users will focus on banking-related queries. However, it's impossible to fully predict how users will engage with the tool. In the first week of deployment, customers might start asking about Python programming, Thanksgiving recipes, or other topics they would typically bring to general AI assistants like ChatGPT or Gemini. This bad behavior would increase the cost of maintaining such technology.


Can the same happen with Qlik Answers? Let's put it to the test. In this article, I’ll take you through a step-by-step exercise where I "teach" programming to Qlik Answers, moving from basic queries to more complex tasks. As I am starting this, I am not sure yet if I will succeed. I want the both of us to figure this out together.


Step 1: Starting with almost no knowledge


To begin, I used an AI Assistant within Qlik Answers that was not linked to any programming-related Knowledge Base. It is trained in medical research papers. I then posed a few questions about R programming to see how the assistant would respond. Check in the following image how that interaction went.

With these responses, it was clear that the assistant needed to be "taught" programming. In other words. even though Qlik Answers is based on an advanced LLM (Anthropic Claude 3), it does not come with all of its previous knowledge... and this is great! It means Qlik Answers is immune of jailbreak use cases like the banking chatbot being used as a general "GPT" tool. It protects the product and your company from the most common misuse of this technology. Now, let's see if we can add "programming"(ish) to the list of skills Qlik Answers has.


Step 2: Creating the First Knowledge Base – R Programming


Next, I created a new Knowledge Base specifically for R programming. I uploaded three comprehensive R programming books into this Knowledge Base.

After the indexing of the 1,186 pages was complete, I linked this Knowledge Base to a new AI Assistant. We are now ready to start!

I started by asking different questions to the assistant. Beginning from a simple one, and then going to a few more complex inquiries. In that case, I decided to repeat some of the same questions I asked my previous assistant (Image 01). As I expected, the assistant was able to answer them correctly and even provided me with the source of the information in case I wanted to confirm it and learn more about it.

This is great, but I want more. Can Qlik Answers write R code based on specific instructions I gave? Well, it turns out, it can. Check this out.

I could keep testing how good my assistant is in R but instead, why not go in a different direction? Can we teach the assistant to program in 2 languages?


Step 3: Introducing Python - a second knowledge base


Satisfied with the assistant's progress in R, I moved on to Python. I created a second Knowledge Base and uploaded two Python programming books. After indexing this new content, I linked it to another AI Assistant. This time I "only" had a total of 670 pages indexed.


The next step was to add this second knowledge base to my assistant. It should now be able to answer questions about both programming languages without confusing one with the other.

I then posed a few Python-related questions. Qlik Answers did amazingly well again.

For my final pure Python test, I asked a more complex question. Can Qlik Answers help me create a machine learning code in Python? Well, good news: it could get the job done.

Step 4: Cross-Language Challenge


Finally, I decided to challenge the assistant by testing its ability to convert code between R and Python. What I wanted to test here is how well does it link two similar but very different contexts. This level of abstraction could demonstrate once more the ability of Qlik Answers to not only find information in a document, like a search tool but to give invaluable insights and even some level of "reasoning" (as much as a machine can reason).

The results show that Qlik Answers can handle this task, but it requires careful prompt construction. When I asked it to directly convert code from one language to another, it struggled, as this instruction, though clear to a human, isn't as straightforward for an AI. However, by breaking the request into two steps, as shown in the previous example, or by providing a more detailed explanation, Qlik Answers was able to complete the task. In this context, the term "convert" essentially means to identify the key elements and then rewrite them in the target language—a nuance that may not be immediately clear to the AI.

Conclusion


Through this exercise, I successfully "taught" Qlik Answers to program by progressively building its knowledge base. Starting from zero knowledge, the AI Assistant evolved into a capable tool that can now answer programming questions and even translate code between languages. This process highlights the flexibility and power of Qlik Answers as a learning AI, demonstrating how it can be tailored to meet specific needs by curating its Knowledge Base with relevant content.


If you like this content and would like me to continue doing these exercises, share this post and comment with suggestions for the next challenges.

151 views0 comments

Recent Posts

See All

Comments


bottom of page