The era of information has made it incredibly valuable to interact with and gain insights from data. With the emergence of advanced AI technologies, integrating natural language processing with data has opened up new possibilities for data interaction. Semantic Kernel is a technology that combines artificial intelligence with software development to bring together large language models and software functionality. It is designed to show how AI can work together with human expertise and technical knowledge to create a solution where we can use intelligent tools that blend seamlessly into our digital world.
In this blog post, we are thrilled to discuss two new features for Semantic Kernel's AI-powered assistant - SQLPlugin and UploadPlugin. SQLPlugin uses SQL to extract insights that can transform the way professionals interact with data, while UploadPlugin lets users upload documents and retrieve knowledge. These cutting-edge advancements are transforming how businesses operate, making them more efficient and productive.
The process for message flow is as follows:
End-users connect to a messaging channel where your bot is published, for example, Web, PowerBI dashboard, or Teams.
Messages are processed through Azure Bot Services, which communicates with a .NET application running on App Services.
The .NET application has a Semantic Kernel Stepwise Planner at its core, which elaborates a series of steps to process the user's request and then executes it.
Each plan step is formulated through Azure OpenAI and then executed against Cognitive Search (traditional RAG pattern) or Azure SQL (structured data RAG).
Cognitive search simplifies data retrieval from multiple cloud sources by ingesting and indexing the data, while Azure SQL contains customer data from the AdventureWorksLT sample.
Azure OpenAI decides which data source each question gets routed to. Questions may also span multiple data sources.
For this tutorial, you will deploy Document Intelligence, SQL, and Cognitive Search resources using the Semantic Kernel Bot-in-a-box accelerator. This will ensure a seamless and efficient setup process with optimal deployment parameters.
Add the parameters by following the recommended parameters to use SQL assistant and upload the document for search using retrieval-augmented generation.
3. Use Case 1: SQL-powered GenAI assistant.
Consider the task of extracting the top 10 product figures with prices and categories. With the SQL Assistant plugin, the analyst can easily extract the top 10 product figures with prices and categories. The GPT-4 model interprets the request and translates it into SQL, providing a structured representation of the data sourced directly from the database.
Select your Azure Bot resource from the menu on the Azure portal for this first use case.
Test the bot by asking some sample questions:
Can you provide the top 10 list of all products, their prices, and the categories they belong to?
How much in total sales do we have?
What are my biggest customers?
What are my top-selling products?
4. Use Case 2: AI Search Retrieval-augmented generation.
Envision a scenario where users effortlessly extract valuable information from uploaded documents. Integrated with GPT-4, a document processing system adeptly analyzes diverse document types, including PDFs. Simultaneously, the system collaborates with HR processes, extracting insights from employee data for strategic workforce planning. This seamless integration enhances efficiency and reduces manual effort in extracting information from various document formats.
To retrieve the information, kindly select the document you wish to use.
After uploading, you can enter your prompt by typing it in. Sample prompt : How does HRM contribute to achieving an organization’s strategic goals through its functional objectives?
5. Embed the web chat.
In the context of communication applications, a channel refers to a means of establishing a connection between a bot and its users. By registering with Azure, a bot can leverage channels to facilitate effective communication with its users.
To configure a bot to connect to a channel, complete the following steps:
Select the bot that you want to configure.
In the left pane, select Channels under Settings.
Select the channel icon you want to add to your bot in the right pane. You may need to scroll down to see the list of all Available Channels.
Embed the web chat control on a web page.
Under Settings, select Channels. Then select Web Chat.
The Web Chat page will open. Select the Default Site from the list of Sites.
Copy the first Secret key and the Embed code.
6. Integrated the Bot in Power BI Dashboard
To enrich your reports and dashboards, you can easily incorporate HTML content by either manually entering the embedded code or copying and pasting it from popular websites like YouTube, Twitter, and embed.ly. This feature provides a convenient way to enhance your reports and dashboards' visual appeal and functionality.
From the Add tile window, select Web content > Next.
Add information to the Add web content tile window:
To display a title above the tile, select Display title and subtitle and enter a Title and an optional Subtitle.
Enter the embed code. In this example, we're copying and pasting a Twitter feed.
On the dashboard, resize and move the web content tile as needed.
Congratulations on exploring the Semantic Kernel Bot in-a-box, the innovative solution revolutionizing data interaction. This advanced platform features the SQL-Powered GenAI Assistant and the Upload document Plugin, which can easily manage complex analyses and document processing. Azure's infrastructure ensures a secure and scalable environment that's easy to set up. With Power BI dashboards, you'll get real-time insights and analytics. The Semantic Kernel Bot in-a-box makes data interaction more user-friendly and accessible, and it's a great example of how AI can transform howt we work with data.