Tutorial | Build a conversational interface with Dataiku Answers#

Get started#

The Dataiku Answers web application allows you to build a conversational interface without coding.

In this tutorial, we’ll use it to build such interface to get answers from the LLM we’ve augmented in the previous Tutorial | Build a multimodal knowledge bank for a RAG project tutorial.

Objectives#

In this tutorial, you will:

  • Create an Answers web application.

  • Configure it to allow users to find relevant answers from the content of the Dataiku documentation.

  • Upload an additional document into Dataiku Answers for an on-the-fly analysis.

Prerequisites#

To complete this tutorial, you’ll need:

  • Dataiku 13.4 or later.

  • An Advanced Analytics Designer or Full Designer user profile.

  • A connection to a supported Generative AI model, as you need an LLM to answer the questions. See LLM connections for details.

  • A SQL connection to host the different datasets that stores the conversation history, user feedback and user profiles.

  • Any other requirements specific to Dataiku Answers.

Tip

You don’t need previous experience with Large Language Models (LLMs), though it would be useful to read the article Concept | Embed recipes and Retrieval Augmented Generation (RAG) before completing this tutorial.

Create the project#

You must have followed the Tutorial | Build a multimodal knowledge bank for a RAG project tutorial before starting this tutorial as we’ll use all the objects included in the Flow:

  • The dataiku_doc folder that contains some articles from the Dataiku documentation used to enrich the LLM. It will store new documents uploaded by users while chatting in the conversational interface.

  • The knowledge bank created by the Embed documents recipe.

  • The dataiku_doc_embedded_images folder that stores the images of each page of the documents processed by the Embed documents recipe.

Screenshot of the Answers conversational interface.

Create the conversational interface#

This section guides you in creating a conversational interface based on the content stored in the multimodal knowledge bank included in the Flow.

  1. From the Flow, double-click the multimodal_knowledge_bank object to open it.

  2. In the Usage tab, click Create Your Dataiku Answers Chat Application.

  3. In the dialog box, name the webapp answers_app_dataiku_help and click Create.

It creates the web application and opens its settings page.

Configure the conversational interface#

Set the mandatory options#

For the webapp to work, you need to configure where to store the conversations and user profiles, and you must indicate the LLM to use.

  1. Next to the Conversation history dataset field, click New Dataset and set the dataset as follows:

    • Name it prompt_history.

    • Store it using a SQL connection.

    • Click Create Dataset. It creates a dataset for logging queries, responses and associated metadata.

  2. Next to the User profile dataset field, click New Dataset and set the dataset as follows:

    • Name it user_profile.

    • Store it using a SQL connection.

    • Click Create Dataset. It creates a dataset for storing all user feedback.

  3. In the LLM field, select the LLM of your choice.

Configure the user feedback options#

The Answers webapp allows you to indicate whether you want to gather the user feedback and how. Here, we’ll store it in a new dataset, as strings.

  1. In Positive feedback choices:

    • Keep the string format in the dropdown as we want to collect the feedback as strings.

    • Click + Add an Element three times and enter the following strings in each field Complete, Correct, Easy to understand. This will offer these three choices as a positive feedback.

  2. In Negative feedback choices:

    • Keep the string format in the dropdown.

    • Click + Add an Element four times and enter the following strings in each field Incorrect, Inaccurate, Does not respect the instructions, Shocking/Risky. This will offer these four choices as a negative feedback.

  3. Enable the Allow user feedback option.

  4. Next to the General feedback dataset field, click New Dataset and set the dataset as follows:

    • Name it user_feedback.

    • Store it using a SQL connection (MySQL, PostgreSQL, Snowflake, etc.).

    • Click Create Dataset. It creates a dataset for storing all user feedback.

Configure the LLM#

The LLM configuration section helps you configure the LLM behavior.

  1. In the Configure your LLM when no knowledge bank or table retrieval is required field, enter the following text:

Please act as a support engineer who would help any users of Dataiku DSS.

Configure the storage for uploaded documents#

The webapp allows you to store images and documents uploaded by users while chatting.

Note

The storage of uploaded images depends on whether it’s supported by the LLM.

  1. In the Upload documents folder dropdown, select dataiku_doc.

Set the knowledge retrieval parameters#

The Knowledge retrieval parameters allows you to configure which knowledge bank to use and customize its use.

  1. In the Knowledge bank field, ensure that multimodal_knowledge_bank is selected.

  2. In the Customize knowledge bank’s name field, enter Dataiku Knowledge Bank. This name will be displayed on the user interface.

    Note

    If you leave this field empty, the webapp will use knowledge bank as the customized name.

  3. Uncheck the Let ‘Answers’ decide when to use the Knowledge Bank based option as we want to require the LLM to use the knowledge bank to answer any questions.

  4. In the Configure your LLM in the context of the knowledge bank field, enter the following text:

Please act as a support engineer who would help any users of Dataiku DSS. Use the knowledge bank whenever the topic from the prompt is covered by the documents in the knowledge bank.
  1. Ensure that the Display source extracts is enabled to provide the users with the sources used to generate the answers.

Customize the conversational interface#

The End user configuration section allows you to configure the conversational interface: title, subtitle, placeholder text in the prompt field, etc.

Let’s customize it a bit.

  1. In the Displayed title field, enter Ask the Dataiku Documentation.

  2. Next to Example questions, replace the following examples with the following strings:

    • What's the LLM mesh?

    • How to do Prompt Engineering in Dataiku?

    • What's the difference between the Group recipe and the Window recipe in Dataiku?

Set up the backend#

  1. Enable the Auto-start backend option.

  2. Unless you have a specific installation, set the Container option to None - use backend to execute.

  3. Click Save and View Webapp at the bottom of the Edit tab.

You should see the following interface:

Screenshot of the Answers conversational interface.

Use the conversational interface#

Ask a question#

Let’s ask a question to check how the interface works.

  1. Click on the first example provided: What’s the LLM Mesh? It enters the question in the input field.

  2. Click the Send button.

The LLM returns the response and allows you to:

  1. View the sources used to answer the question.

  2. Copy the response.

  3. Give your feedback, using the strings we set up previously or entering your own comment.

Screenshot of the a response in the conversational interface.

Upload a document#

Let’s upload a PDF to ask a question on some new content.

  1. Download the PDF here and store it on your computer.

  2. In the conversational interface, click the Upload a file or image (Attach a file icon.) icon in the input field and select the new PDF.

  3. Enter the following prompt:

    How to create a multimodal knowledge bank?
    
  4. Click Send (Send icon.).

If you go back to the Flow and open the dataiku_doc folder, you’ll see that the new PDF has been stored in it as we set it up in the Configure the storage for uploaded documents section above.

Next steps#

For more information on the Answers application, see the Dataiku Answers article in the reference documentation.