{"id":41613,"date":"2023-12-01T00:41:52","date_gmt":"2023-12-01T07:41:52","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=41613"},"modified":"2023-11-29T11:53:46","modified_gmt":"2023-11-29T18:53:46","slug":"how-to-enhance-your-chatbot-so-it-can-retrieve-data-from-multiple-data-sources-orchestrate-its-own-plan-with-c-semantic-kernel-planner-azure-openai-part-1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/how-to-enhance-your-chatbot-so-it-can-retrieve-data-from-multiple-data-sources-orchestrate-its-own-plan-with-c-semantic-kernel-planner-azure-openai-part-1\/","title":{"rendered":"How to enhance your chatbot so it can retrieve data from multiple data sources &#038; orchestrate its own plan with C# Semantic Kernel, planner &#038; Azure OpenAI \u2013 part 1"},"content":{"rendered":"<p>In this multi-part series, <a href=\"https:\/\/www.linkedin.com\/in\/jordan-bean\/\">Jordan Bean<\/a> shares how to enhance a chatbot to retrieve data from multiple data sources and orchestrate plans with C# Semantic Kernel, planner, and Azure Open AI.<\/p>\n<hr \/>\n<p>As discussed in the\u00a0<a href=\"https:\/\/jordanbeandev.com\/how-to-limit-search-results-when-combining-azure-cognitive-search-azure-openai-using-azure-ad-groups\/\">previous post<\/a>\u00a0about Azure OpenAI, using the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/search\/retrieval-augmented-generation-overview\">Retrieval Augmented Generation (RAG) pattern<\/a>\u00a0is a simple &amp; effective way to enable\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/ai-services\/openai\/overview\">Azure OpenAI<\/a>\u00a0to \u201cchat with your data\u201d. This pattern enables you to search your data with\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/search\/search-what-is-azure-search\">Azure Cognitive Search<\/a>\u00a0(a search engine), retrieve relevant snippets of information from your data, then add that additional information to your prompts to the Azure OpenAI service to respond in human readable fashion.<\/p>\n<p>This pattern is simple, effective and should always be the first thing you deploy. There are several excellent reference implementations posted on GitHub to help you do this.<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/Azure-Samples\/azure-search-openai-demo\">Azure-Samples\/azure-search-openai-demo: A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&amp;A experiences. (github.com)<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/Azure-Samples\/azure-search-openai-demo-csharp\">Azure-Samples\/azure-search-openai-demo-csharp: A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&amp;A experiences. (github.com)<\/a><\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">This isn\u2019t always enough<\/h2>\n<p>However, if you look at the implementation of the RAG pattern, you will notice that it can be limiting. There is only a single data source (Cognitive Search). Technically, Cognitive Search can index\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/search\/search-data-sources-gallery\">many data sources<\/a>\u00a0(PDFs, Word docs, etc). It is best at searching unstructured data. In addition, I have to manually copy the results from the Cognitive Search and append them to the prompt myself in code. I had to parse the results of Cognitive Search myself in code.<\/p>\n<p>This leads to several questions:<\/p>\n<ul>\n<li>What if I want to use multiple data sources to retrieve the data necessary to answer the user\u2019s question?<\/li>\n<li>What if I don\u2019t know or don\u2019t want to hard-code the order of operation for calling multiple data sources?<\/li>\n<li>What if I don\u2019t want to write the parsing code for calling multiple data sources with disparate data formats?<\/li>\n<li>How can I let AI \u201corchestrate\u201d the API calls to answer questions &amp; pull together data that I couldn\u2019t predict beforehand?<\/li>\n<\/ul>\n<p>To solve these more complex issues, I need more than the RAG pattern.<\/p>\n<p>Continue reading this post, as well as the full series on <a href=\"https:\/\/jordanbeandev.com\/how-to-build-your-own-chatbot-using-c-semantic-kernel-azure-openai-part-1\/\">Jordan&#8217;s dev blog<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this multi-part series, Jordan Bean shares how to enhance a chatbot to retrieve data from multiple data sources and orchestrate plans with C# Semantic Kernel, planner, and Azure Open AI. As discussed in the\u00a0previous post\u00a0about Azure OpenAI, using the\u00a0Retrieval Augmented Generation (RAG) pattern\u00a0is a simple &amp; effective way to enable\u00a0Azure OpenAI\u00a0to \u201cchat with your [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":41614,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14],"tags":[15,10650,56,10651],"class_list":["post-41613","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","tag-ai","tag-azure-openai","tag-bots","tag-semantic-kernel"],"acf":[],"blog_post_summary":"<p>In this multi-part series, Jordan Bean shares how to enhance a chatbot to retrieve data from multiple data sources and orchestrate plans with C# Semantic Kernel, planner, and Azure Open AI. As discussed in the\u00a0previous post\u00a0about Azure OpenAI, using the\u00a0Retrieval Augmented Generation (RAG) pattern\u00a0is a simple &amp; effective way to enable\u00a0Azure OpenAI\u00a0to \u201cchat with your [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/41613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=41613"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/41613\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/41614"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=41613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=41613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=41613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}