AI based Chatbot with LLaMA Models and Microsoft Semantic Kernel

2024-01-21 aiazuresolution-diagram

This diagram illustrates an idea of implementing an AI based chatbot for Kontext on Azure. It leverages open source frameworks and LLMs (large language models) to implement a RAG (retrieval augmented generation). The chatbot will get the domain specific information from Kontext search engine as context information and provided it into backend API service which leverages Microsoft Semantic Kernel to construct the question and send to LLM service to generate the answers and then sends back to frontend.

Alternatives

In the diagram, LLMs can be replaced by other models like Open AI services of Azure Open AI services or any other relevant language models. Microsoft Semantic Kernel can also be replaced with LangChain too.

References

Chatbot Backend
[Not supported by viewer]
reads data
[Not supported by viewer]
kontext applicaiton db
(Azure SQL)
[Not supported by viewer]
write into
[Not supported by viewer]
Indexer Func
(Azure Function)
[Not supported by viewer]
Azure Storage
(indexes)
[Not supported by viewer]
reads from
[Not supported by viewer]
retrieve context info
[Not supported by viewer]
invokes
[Not supported by viewer]
Chat Box Backend API
(Azure App service)
[Not supported by viewer]
submit questions
[Not supported by viewer]
Chatbot Frontend
[Not supported by viewer]
generate answer
[Not supported by viewer]
Microsoft Semantic Kernel
[Not supported by viewer]
LLama2 Services
 (via LLamaSharp)
(Azure App service)
[Not supported by viewer]
REST API for Search
(Azure Function)
[Not supported by viewer]
LLMs
[Not supported by viewer]
Kontext Domain info (Articles, Diagrams and Comments)
[Not supported by viewer]
Icon-databases-130 public:true sdk:MsPortalFx.Base.Images.Polychromatic.Database(); MsPortalFx.Base.Images.Polychromatic.SqlDatabase() category: Databases image/svg+xml Icon-databases-130 Icon-compute-29 public:true sdk:MsPortalFx.Base.Images.Polychromatic.Functions() category: Compute, IoT image/svg+xml Icon-compute-29 MsPortalFx.base.images-1 public:true sdk: MsPortalFx.Base.Images.Polychromatic.StorageAzureFiles() category: General image/svg+xml MsPortalFx.base.images-1 Icon-web-41 public:true sdk:MsPortalFx.Base.Images.Polychromatic.Website() category: Compute, Containers, App Services image/svg+xml Icon-web-41 MsPortalFx.base.images-15 public:true sdk: MsPortalFx.base.images.Polychromatic.Browser() category: General image/svg+xml MsPortalFx.base.images-15 Icon-web-41 public:true sdk:MsPortalFx.Base.Images.Polychromatic.Website() category: Compute, Containers, App Services image/svg+xml Icon-web-41 Icon-compute-29 public:true sdk:MsPortalFx.Base.Images.Polychromatic.Functions() category: Compute, IoT image/svg+xml Icon-compute-29