Mix multiple Knowledge Bases outcomes

Sometimes a single Knowledge base is not enough. Some examples:

  1. You indexed your PDFs or your website but you want to add more knowledge ar runtime, without modifing or adding more pdfs, modifing original website pages etc.
  2. You splitted your Knowledge base in more KBs for easy maintainance, but you want to query all you KBs all at once to find out the best answer from all of them
  3. You uploaded your original contents but you wnat to fix some reply, improving the answer quality, without touching the original contents (pdfs, docs, website pages etc.)

There are a lot of ways to achieve the previous goals. But first of all you will take advantage of the Tiledesk ability to mix multiple Knowledge Bases in the same chatbot flow.

How to mix many KBs to provide the best answers? Use prompt engineering! In the following article we want show you one elegant way to reach your “KBs mixing” goals using prompts with the Tiledesk Design Studio.

In Tiledesk we have our Help Center (https://gethelp.tiledesk.com/) that we indexed for live cunsulting through our chatbot in our home page:

You can ask everything you find in the Help Center to our chatbot. Our RAG engine will provide you the best available answer using the Knowledge base action filled up using the tiledesk sitemap ("https://gethelp.tiledesk.com/sitemap.xml" uploaded with the “sitemap” feature of the KB).

What happens when we want to add some additional content in our Help Center but without modifying or updating it?

You can simply add another Knowledge base action in the flow. In the new one you can add more FAQs, fixing some reply adding more info and/or using some external content that you don't want to add to your online Help center (e.g. because of SEO policies) etc. How can query all of your KBs at once getting a simple, unique, comprehensive reply mixing the best of all your KBs? Use a super prompt!

Suppose that we want our chatbot to also reply to some prompt engineering questions, despite the fact that this course is not available in our Help Center. We can add all the course contents into a specific KB created for the pourpose.

Well, now we want to get replies from both our KBs, Tiledesk Help Center and Prompt engineering course. Move to our designer. Put in chain the two KBs as in the following picture.

 

There is no need to connect the Success and Else flows. When no connectors are set the Actions are executed, the attributes populated (kb1 and kb2) and the flow continues upward → downward. When a connector is encountered it will be automatically followed.

During the flow kb1 attribute will be fulfilled with the reply eventually coming from the first KB query (tiledesk), and kb2 with the reply from the second one (prompt engineering course). At this point we have 2 attributes available, eventually populated with some content (depending on the user question asked during flow runinng).

Here is where the magin happens. Create a new block with the GPT Task, with the following prompt, that will mix both replies, generating the best answer mixing kb1 and kb2 attributes:

This is the whole flow:

How it works? Simply ask something targeted for the first or the second Knowledge base, and the prompt will do the magic of mixing the contents togheter. I asked for some info about Prompt engineering and the chatbot correctly got the reply from the second KB (prompt engineering course)

Then I asked something about Tiledesk, and the “tiledesk” Knowledge Base replied accordingly:

We also introduced a typo, just to show you how great are LLMs : )

This is the prompt we used:

Generate an answer to the user's question using the text contained between << >>
<<
{ {kb1} }
{ {kb2} }
>>
user's question: 

You can also use this method to mix whatever content you like. You can for example mix contents coming from multiple OpenAI Assistants or mixing Ask KB Actions with OpenAI Assistants and whatever new content actions will come in the future!

This Chatbot is available to fork on the community! https://tiledesk.com/community/search/getchatbotinfo/chatbotId/66e55d1feb7e950013c54d48-Mixing-Knowledge-Bases

Write to info@tiledesk.com for more info. Happy Tiledesk!