NashTech Insights

Transforming your process with smart chatbots powered by private Azure OpenAI & Cognitive Search

Hai Hoang
Hai Hoang
Table of Contents

As you already know ChatGPT only recently launched, but it has been widely spread and received many positive reviews from users. ChatGPT can answer in detail and fluently in many different fields, so many people think that this technology will make Google afraid.

From point of view of a software developer like me, by leveraging ChatGPT, you can unlock AI’s complete capabilities within your applications, enabling the creation of exceptional user experiences through natural language interactions. ChatGPT transcends being an awesome tool; it revolutionizes the way we access and analyze data. Regardless of whether you utilize Azure, SQL Server, or any other data source, seamlessly incorporating ChatGPT into your projects empowers you to commence the development of intelligent applications from now on.

What are smart chatbots?

Smart chatbot is AI-powered chatbots that transform users’ productivity, automate processes, and derive insights.

Bing Chat is an example of a smart chatbot. OpenAI is at the core of Bing Chat. Bing Chat uses OpenAI to take in complex queries, summarize relevant information from various sources, and generate responses.

Build smart chatbots with Azure OpenAI & Cognitive Search

Let’s say we have an internal knowledgebase that contains information about job descriptions, skillset standards, career path development plans, delivery processes, health care plans, and other business documents.

All staff may already be able to search through this knowledgebase, but searching for answers to specific questions by filtering through all the documents in the search results can be time-consuming.

Using AI models like ChatGPT, we can transform staff productivity by summarizing the information contained in those documents and extracting key insights.

You may concern about the security aspect, e.g. how can I upload company documents into Cloud? So, please be assured that this solution is based on the possibility of using Azure OpenAI service and deploying it privately for only your organization’s usage.

Application architecture

User Interface (UI)

The chatbot user interface (in this article) is using ReactJS to build a single page application. This UI, by chatting, is what accepts user queries, routes request to the application backend, and displays generated responses. It is web-based so we can run on any internet devices with a browser.

Application backend

There are lot of technologies to build application backends, e.g. ASP.NET API, Python, NodeJS…And the core of backend is services below:

  • Azure Cognitive Search – indexes documents from the data stored in an Azure Storage Account. This makes the documents searchable.
  • Azure OpenAI – provides the ChatGPT models to generate responses. Additionally, Semantic Kernel is used in conjunction with the Azure OpenAI Service to orchestrate the more complex AI workflows. For using Azure OpenAI, your administrator of Azure Portal needs to submit a request to Microsoft for enabling this service first. Then, this is private service allocated to a defined individual Azure account, with no one to access this OpenAI service.

Using ChatGPT on documents

Before we can chat with our documents, we will need to let OpenAI to learn the knowledgebase of all documents. To do this, we need to upload all documents into Azure Blob (storage), then configure on Azure Cognitive Search for reading the content of these documents.

In this article, the knowledgebase building process is manual. However, based on our needs we may opt to run this as an event-driven job whenever a new document is added to the Azure Blob or in batches as a background job.

Another pattern worth mentioning involves the use of embeddings to encode semantic information about data. These embeddings are typically stored in vector databases. For a quick introduction to embeddings, please refer to the Azure OpenAI embeddings documentation.

Chatting with your data

Once everything is ready, we just open the website to chat:

To build more trust in the responses, the response includes citations, the full prompt used to generate the response, and supporting content containing the documents from the search results. As you can see in the answer below, chatbot also includes the source of knowledgebase for your reference as well.

Last but not least

Are you interested in building or currently building intelligent chatbots? Keep in touch at NashTech Accelerator

Hai Hoang

Hai Hoang

Engineering Manager at NashTech VN

Leave a Comment

Your email address will not be published. Required fields are marked *

Suggested Article

%d bloggers like this: