Difference between revisions of "Edge AI SDK/GenAIChatbot"

From ESS-WIKI
Jump to: navigation, search
 
(61 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  
'''<span style="font-size:x-large;">Brief of GenAI Chatbot</span>'''
+
= Introduction =
 +
 
 +
<span style="font-size:larger;">GenAI Chatbot is a next-generation conversational AI assistant designed to provide natural, context-aware interactions. At its core, it utilizes efficient Small Language Models (SLMs) and supports the direct import of models fine-tuned within GenAI Studio, enabling easy deployment and immediate use of custom models in the chatbot.</span>
 +
 
 +
<span style="font-size:larger;">The chatbot features advanced capabilities, including:</span>
 +
 
 +
*<span style="font-size:larger;">Audio processing (Speech-to-Text [STT] and Text-to-Speech [TTS]).</span>
 +
*<span style="font-size:larger;">Retrieval-Augmented Generation (RAG).</span>
 +
*<span style="font-size:larger;">An embedded vector database (VectorDB).</span>
 +
*<span style="font-size:larger;">Model Context Protocol (MCP) tools, which enable AI agents to perform actions.</span>
 +
 
 +
<span style="font-size:larger;">GenAI Chatbot features a flexible configuration suitable for diverse application scenarios and is optimized for embedded platforms such as the Ryzen AI 8000, NVIDIA Jetson Orin Nano, and Jetson Orin AGX.</span>
 +
 
 +
 
 +
= How To =
 +
 
 +
== Download Models from Ollama '''(Support Device: Nvidia)''' ==
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Ollama-1.png|none|900x600px|Ollama-1.png]]
 +
</div>
 +
*<span style="font-size:larger;">Go to the page [https://www.ollama.com/search https://www.ollama.com/search] and click on the "Models" tab as shown in Icon 1.</span>
 +
*<span style="font-size:larger;">Use the search bar shown in Icon 2 to find the model you want to download.</span>
 +
*<span style="font-size:larger;">In Icon 3, locate the name of the model.</span>
 +
 
 +
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
&nbsp;
 +
</div> <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Ollama-2.png|none|900x600px|Ollama-2.png]]
 +
</div>
 +
*<span style="font-size:larger;">After clicking in, you'll see the name and version of the model you need to download.</span>
 +
*<span style="font-size:larger;">Please note that the model size depends on your hardware resources.</span>
 +
*<span style="font-size:larger;">Make sure your hardware matches the specifications shown in [[#Platforms|the table above]].</span>
 +
 
 +
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
&nbsp;
 +
</div> <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Ollama-3.png|none|900x600px|Ollama-3.png]]
 +
</div>
 +
*<span style="font-size:larger;">Go back to GenAI-Chatbot and create new chat window, as shown in Icon 1.</span>
 +
*<span style="font-size:larger;">Enter the model name you just saw into the search bar in the chat window, as shown in Icon 2.</span>
 +
*<span style="font-size:larger;">Then, click the download button at the location marked in Icon 3.</span>
 +
 
 +
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
&nbsp;
 +
</div> <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Ollama-4.png|none|900x600px|Ollama-4.png]]
 +
</div>
 +
*<span style="font-size:larger;">After clicking the download button, a notification will pop up.</span>
 +
 
 +
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
&nbsp;
 +
</div> <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Ollama-5.png|none|900x600px|Ollama-5.png]]
 +
</div>
 +
*<span style="font-size:larger;">After the download is complete, a notification will appear confirming the completion.</span>  
  
 
&nbsp;
 
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
&nbsp;
 +
</div> <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Ollama-6.png|none|900x600px|Ollama-6.png]]
 +
</div>
 +
*<span style="font-size:larger;">Next, you'll be able to find the model you downloaded in the model selection menu.</span>
 +
 +
== Delete Models on GenAI-Chatbot '''(Support Device: Nvidia)''' ==
  
= Introduction =
+
*<div style="background-color:#fcfce6; padding:5px; margin:5px 0; font-size:larger;">⚠️ [https://ess-wiki.advantech.com.tw/view/Edge_AI_SDK/AI_Framework/AMD#Delete_model Delete Models For AMD]</div> 
  
<span style="font-size:larger;">GenAI Chatbot is a next-generation conversational AI assistant built on the [https://ollama.com/search OLLAMA] architecture, supporting all models compatible with [https://ollama.com/search OLLAMA]. Designed for seamless integration with [https://genai-studio.gitbook.io/docs GenAI Studio], it allows users to directly import models that have been fine-tuned within [https://genai-studio.gitbook.io/docs GenAI Studio], enabling easy deployment and immediate use of custom models in the chatbot. At its core, GenAI Chatbot utilizes efficient Small Language Models (SLMs) to provide natural, context-aware interactions. The chatbot features advanced capabilities, including audio processing (Speech-to-Text [STT], Text-to-Speech [TTS]), Retrieval-Augmented Generation (RAG), and an embedded vector database (VectorDB), all within a flexible configuration suitable for diverse application scenarios. It is currently optimized for embedded platforms such as NVIDIA Jetson Orin Nano and Jetson Orin AGX.</span>
+
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Delete-1.png|none|900x600px|Delete-1.png]]
 +
</div>
 +
*<span style="font-size:larger;">Click on icon 1 "User" to enter the Admin Panel (icon 2).</span>
 +
*<span style="font-size:larger;">After entering "Settings," click on icon 3 "Models."</span>
 +
*<span style="font-size:larger;">Click the download icon (icon 4) on the right.</span>  
  
= How To =
+
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Delete-2.png|none|900x600px|Delete-2.png]]
 +
</div>
 +
*<span style="font-size:larger;">After the window pops up, find the option to delete the model at the location of icon 1.</span>
 +
*<span style="font-size:larger;">After selecting the model you want to delete, click on icon 2 "Delete."</span>
 +
 
 +
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Delete-3.png|none|900x600px|Delete-3.png]]
 +
</div>
 +
*<span style="font-size:larger;">Click "Confirm".</span>
  
 +
&nbsp;
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Delete-4.png|none|900x600px|Delete-4.png]]
 +
</div>
 +
*<span style="font-size:larger;">A notification will pop up after a successful operation.</span>
  
 
== Download SLM Models from GenAI Studio ==
 
== Download SLM Models from GenAI Studio ==
Line 15: Line 103:
 
[[File:Genai-studio-1.png|none|900x600px|Genai-studio-1.png]]
 
[[File:Genai-studio-1.png|none|900x600px|Genai-studio-1.png]]
 
</div>  
 
</div>  
#<span style="font-size:larger;">Click GenAI Studio Hub from the left menu.</span>  
+
*<span style="font-size:larger;">Click GenAI Studio Hub from the left menu.</span>  
#<span style="font-size:larger;">Enter the URL of your GenAI Studio.</span>  
+
*<span style="font-size:larger;">Enter the URL of your GenAI Studio.</span>  
#<span style="font-size:larger;">Click the "Save"&nbsp;</span>  
+
*<span style="font-size:larger;">Click the "Save"&nbsp;</span>  
#<span style="font-size:larger;">Once the configuration is successful, a notification will appear as shown at icon 4.</span>  
+
*<span style="font-size:larger;">Once the configuration is successful, a notification will appear as shown at icon 4.</span>  
#<span style="font-size:larger;">Displays a list of all models supported by GenAI Studio.</span>  
+
*<span style="font-size:larger;">Displays a list of all models supported by GenAI Studio.</span>  
#<span style="font-size:larger;">Click on icon 6 to download the desired model.</span>  
+
*<span style="font-size:larger;">Click on icon 6 to download the desired model.</span>  
  
 
&nbsp;
 
&nbsp;
Line 34: Line 122:
 
[[File:Genai-studio-4.png|none|900x600px|Genai-studio-4.png]]
 
[[File:Genai-studio-4.png|none|900x600px|Genai-studio-4.png]]
 
</div>  
 
</div>  
<span style="font-size:larger;">After the model has downloaded, you can select this LLM Model in new Chat&nbsp;</span>
+
*<span style="font-size:larger;">After the model has downloaded, you can select this LLM Model in new Chat&nbsp;</span>  
  
 
&nbsp;
 
&nbsp;
  
== Create a new chatbot assistant with RAG ==
+
== Create a new Knowledge ==
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-1.png|none|900x600px|Rag-1.png]]
 
[[File:Rag-1.png|none|900x600px|Rag-1.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''Click on icon 1 to open the Workspace page.''</span>  
+
*<span style="font-size:larger;">Client the Workspace from the left menu.</span>  
*<span style="font-size:larger;">''Click on icon 2 to open the Knowledge settings.''</span>  
+
*<span style="font-size:larger;">Go to the Knowledge.</span>  
*<span style="font-size:larger;">''Click on icon 3 to add new Knowledge.''</span>  
+
*<span style="font-size:larger;">Click the + icon to add a new knowledge.</span>
 +
 
 +
<span style="font-size:larger;">Here are sample&nbsp;files:</span> <span style="font-size:larger;">* PDF:&nbsp;[[Media:10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.pdf|tial_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.pdf]]&nbsp;,</span> <span style="font-size:larger;">* Text:&nbsp;'''[[Media:10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.txt|10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.txt]]''' &nbsp;</span>
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-2.png|none|900x600px|Rag-2.png]]
 
[[File:Rag-2.png|none|900x600px|Rag-2.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''Enter the title at icon 1.''</span>  
+
*<span style="font-size:larger;">Enter the title.</span>  
*<span style="font-size:larger;">''Enter the content at icon 2.''</span>  
+
*<span style="font-size:larger;">Enter the goal or description.</span>  
*<span style="font-size:larger;">''Click on icon 3 to create the Knowledge.''</span>  
+
*<span style="font-size:larger;">Click the "Create Knowledge" button to finish.</span>  
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
+
 
[[File:Rag-3.png|none|900x600px|Rag-3.png]]
+
&nbsp;
</div>
 
*<span style="font-size:larger;">''The page will automatically switch back to the Knowledge section. After creation is complete, a notification will appear.''</span>
 
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-4.png|none|900x600px|Rag-4.png]]
 
[[File:Rag-4.png|none|900x600px|Rag-4.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''Click on icon 1, the "+" icon.''</span>  
+
*<span style="font-size:larger;">Click the "+" icon.</span>  
*<span style="font-size:larger;">''Click on icon 2, "Upload files."''</span>  
+
*<span style="font-size:larger;">Click the&nbsp;"Upload files" to upload files.</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-5.png|none|900x600px|Rag-5.png]]
 
[[File:Rag-5.png|none|900x600px|Rag-5.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''A file selection window will pop up. Select the files you want to use.''</span>  
+
*<span style="font-size:larger;">Select the files you want to use.</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-6.png|none|900x600px|Rag-6.png]]
 
[[File:Rag-6.png|none|900x600px|Rag-6.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''After the upload, the files will be displayed and a success notification will appear.''</span>  
+
*<span style="font-size:larger;">After the upload, the files will be displayed and a success notification will appear.</span>  
 +
 
 +
&nbsp;
 +
 
 +
== Create a Chatbot Assistant with RAG ( Knowledge ) ==
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-7.png|none|900x600px|Rag-7.png]]
 
[[File:Rag-7.png|none|900x600px|Rag-7.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''After the Knowledge is created, click on icon 1 to go to the Models page.''</span>  
+
*<span style="font-size:larger;">Go to the Models tab.</span>  
*<span style="font-size:larger;">''Click on icon 2, the "+" icon, to add a new knowledge model.''</span>  
+
*<span style="font-size:larger;">Click the "+" icon, to add a new model.</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-8.png|none|900x600px|Rag-8.png]]
 
[[File:Rag-8.png|none|900x600px|Rag-8.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''On the add new model page, fill in and select the required fields shown in the red box: Title, Subtitle, Base Model, and System Prompt.''</span>  
+
*<span style="font-size:larger;">On the add new model page, fill in and select the required fields shown in the red box:</span>
 +
**<span style="font-size:larger;">Click the "+" icon, to add a new model.</span>
 +
**<span style="font-size:larger;">* Title, * Subtitle, * Base Model, and * System Prompt.</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-9.png|none|900x600px|Rag-9.png]]
 
[[File:Rag-9.png|none|900x600px|Rag-9.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''Continuing from the previous page, click on icon 1 to select the Knowledge you just created, then click on icon 2 to save and create the model.''</span>  
+
<span style="font-size:larger;">Continuing from the previous page,</span>
 +
 
 +
*<span style="font-size:larger;">Click the "Select Knowledge" to&nbsp;select the Knowledge you just created,</span>
 +
*<span style="font-size:larger;">Click the "Save & Create"&nbsp;to save and create.</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-10.png|none|900x600px|Rag-10.png]]
 
[[File:Rag-10.png|none|900x600px|Rag-10.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''After successful creation, a notification will appear at icon 1. Then, click on the model at icon 2 to enter the model chat.''</span>  
+
*<span style="font-size:larger;">After successful creation, a notification will appear at icon 1.</span>
 +
*<span style="font-size:larger;">Then, click on the model ( icon 2 ) to enter the model chat.&nbsp;Start the Assistant chat.</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-11.png|none|900x600px|Rag-11.png]]
 
[[File:Rag-11.png|none|900x600px|Rag-11.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''The chat window will display that the model in use is the Knowledge model you created.''</span>  
+
*<span style="font-size:larger;">The chat window will display that the model in use is the Knowledge model you created.</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Rag-12.png|none|900x600px|Rag-12.png]]
 
[[File:Rag-12.png|none|900x600px|Rag-12.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''After starting the conversation, you will see that the model retrieves information from the Knowledge you created in its responses.''</span>  
+
*<span style="font-size:larger;">After starting the conversation, you will see that the model retrieves information from the Knowledge you created in its responses.</span>  
  
 
&nbsp;
 
&nbsp;
Line 148: Line 262:
 
*<span style="font-size:larger;">''Note down the Key1 or Key2 and the Endpoint URL; you'll need these to authenticate your API requests.''</span>  
 
*<span style="font-size:larger;">''Note down the Key1 or Key2 and the Endpoint URL; you'll need these to authenticate your API requests.''</span>  
  
=== <span style="font-size:larger;">Setting Up on GenAI Chatbot</span> ===
+
&nbsp;
 +
 
 +
=== <span style="font-size:larger;">Setup the Azue Text-to-Speec in&nbsp;GenAI Chatbot</span> ===
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Stt-tts-1.png|none|900x600px|Stt-tts-1.png]]
 
[[File:Stt-tts-1.png|none|900x600px|Stt-tts-1.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''Select icon 1 and click on "Admin Panel."''</span>  
+
*<span style="font-size:larger;">Click the"Admin Panel."</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Stt-tts-2.png|none|900x600px|Stt-tts-2.png]]
 
[[File:Stt-tts-2.png|none|900x600px|Stt-tts-2.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''Find the TTS Settings section and select the Engine you want to use, as shown at icon 2: "Azure AI Speech"''</span>  
+
*<span style="font-size:larger;">Click the Audio</span>
 +
*<span style="font-size:larger;">Select the "Text-to-Speech Engine" with&nbsp;"Azure AI Speech".</span>  
 +
 
 +
&nbsp;
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Stt-tts-3.png|none|900x600px|Stt-tts-3.png]]
 
[[File:Stt-tts-3.png|none|900x600px|Stt-tts-3.png]]
 
</div>  
 
</div>  
*<span style="font-size:larger;">''Enter the Azure AI Speech API token at icon 1.''</span>  
+
*<span style="font-size:larger;">Enter the Azure AI Speech API token in API Key.</span>  
*<span style="font-size:larger;">''Click on icon 2, "Save."''</span>  
+
*<span style="font-size:larger;">Click the&nbsp;"Save" icon.</span>  
*<span style="font-size:larger;">''Finally, you will see a success notification at icon 3.''</span>
+
*<span style="font-size:larger;">Finally, you will see a success notification.</span>  
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 
[[File:Stt-tts-4.png|none|900x600px|Stt-tts-4.png]]
 
</div>
 
*<span style="font-size:larger;">''Go to the chat window and click on icon 1, the conversation icon.''</span>
 
*<span style="font-size:larger;">''An icon will appear at the position of icon 2, indicating that the feature is ready to use.''</span>  
 
  
 
== Evaluate the Benchmark of Each Chatbot Response ==
 
== Evaluate the Benchmark of Each Chatbot Response ==
Line 175: Line 291:
 
*<span style="font-size:larger;">''An information button is provided next to each response. Clicking it reveals detailed performance and inference statistics for that response, including token counts, processing speed, and computation time. This allows developers to monitor and optimize system performance in real time.''</span>  
 
*<span style="font-size:larger;">''An information button is provided next to each response. Clicking it reveals detailed performance and inference statistics for that response, including token counts, processing speed, and computation time. This allows developers to monitor and optimize system performance in real time.''</span>  
  
= Example =
+
== Using MCP tools ==
  
== Creating an Audio + RAG Chatbot for Medication Assistant ==
+
'''1. Verify the default MCP server in the GenAI-Chatbot tools'''
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:EAS-GenAI DevKit.jpg|none|800x400px|GenAI Chatbot DevKit]]</div>
+
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
=== <span style="font-size:large;">1. Configuring TTS with Azure AI Speech API</span> ===
+
[[File:Mcp-tool-1 1757558120013.png|900x600px|Mcp-tool-1 1757558120013.png]]
<div style="margin-left: 2em;"><span style="font-size:large;">[[#Create_an_Account_on_Azure_AI_Speech_API|(1). Create an Account on Azure AI Speech API]]</span></div> <div style="margin-left: 2em;"><span style="font-size:larger;">[[#Setting_Up_on_GenAI_Chatbot|(2). Setting Up on GenAI Chatbot]]</span></div> <div style="margin-left: 2em;">&nbsp;</div>  
+
</div>  
=== <span style="font-size:large;">2. Create Knowledge</span>&nbsp; ===
+
*<span style="font-size:larger;">Click '''User'''.</span>  
<div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-1.png|none|900x600px|Rag-1.png]]</div>  
+
*<span style="font-size:larger;">Select '''Admin Panel'''.</span>  
<span style="font-size:larger;">1.&nbsp;Client the Workspace from the left menu.</span><br/> <span style="font-size:larger;">2. Go to the Knowledge</span><br/> <span style="font-size:larger;">3.&nbsp;Click the + icon to add a new knowledge&nbsp;</span>
+
*<span style="font-size:larger;">Open the '''Tools''' section.</span>  
 +
*<span style="font-size:larger;">Under '''Manage Tool Server''', ensure that '''file-utils''' / '''mcp-system-info''' are listed.</span>  
 +
*<span style="font-size:larger;">Click '''Save''' to apply the changes.</span>  
  
<span style="font-size:larger;">Here are sample&nbsp;files: *&nbsp;</span>'[[Media:10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.pdf|tial_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.pdf]]&nbsp;, *&nbsp;''''[[Media:10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.txt|10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.txt]]''' &nbsp;
+
'''2. Open a new chat and select the tools'''
<div style="margin-left: 2em;">&nbsp;</div> <div style="margin-left: 2em;">&nbsp;</div> </div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-2.png|none|900x600px|Rag-2.png]]</div>  
+
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
<span style="font-size:larger;">1. Enter the title.</span><br/> <span style="font-size:larger;">2. Enter the goal or description.</span><br/> <span style="font-size:larger;">3. Click the "Create Knowledge" button to finish.</span>
+
[[File:Mcp-tool-2 1757558139296.png|900x600px|Mcp-tool-2 1757558139296.png]]
 +
</div>  
 +
*<span style="font-size:larger;">Select '''New Chat'''.</span>  
 +
*<span style="font-size:larger;">Click the “+” button in the chat window.</span>  
 +
*<span style="font-size:larger;">Choose the tool to open, e.g., '''system-info'''.</span>  
 +
*<span style="font-size:larger;">Verify that the tool icon appears next to the “+” button, with the number of icons corresponding to the number of selected tools.</span>  
  
&nbsp;
+
'''3. Use the tool to obtain system information'''
  
&nbsp;
+
*<span style="font-size:larger;">Example: Ask the LLM model → “'''What is the current memory usage?'''”</span>
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-4.png|none|900x600px|Rag-4.png]]</div>  
+
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
<span style="font-size:larger;">1. Click the "+" icon</span><br/> <span style="font-size:larger;">2. Click the&nbsp;"Upload files" to upload files.</span> &nbsp;
+
[[File:Mcp-tool-3 1756969033152.png|900x600px|Mcp-tool-3 1756969033152.png]]
 +
</div>  
 +
'''4. Review the MCP server APIs and available functions'''
  
&nbsp;
+
*<span style="font-size:larger;">MCP - System-Info-Server: [http://localhost:23952/mcp-system-info/docs http://localhost:23952/mcp-system-info/docs]</span>
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-6.png|none|900x600px|Rag-6.png]]</div>  
+
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
<span style="font-size:larger;">After the upload, the files will be displayed and a success notification will appear.</span> &nbsp;
+
[[File:Image 1757556413952.png|900x600px|Image 1757556413952.png]]
 +
</div>  
 +
== Using GenAI Assistant Mode ==
  
&nbsp;
+
'''1. Configure Agent Settings'''
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Ai-agent-1 1757558170990.png|900x600px|Ai-agent-1 1757558170990.png]]
 
</div>  
 
</div>  
=== <span style="font-size:large;">3. Create a Chatbot Assistant with RAG ( Knwledge )</span> ===
+
*<span style="font-size:larger;">Click '''User'''.</span>  
<div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-7.png|none|900x600px|Rag-7.png]]</div>  
+
*<span style="font-size:larger;">Select '''Admin Panel'''.</span>
<span style="font-size:larger;">1. Go to the Models tab.</span><br/> <span style="font-size:larger;">2. Click the "+" icon, to add a new model.</span> &nbsp;
+
*<span style="font-size:larger;">Open the '''Agent''' section.</span>
 +
*<span style="font-size:larger;">Select model.</span>
 +
*<span style="font-size:larger;">Select tools.</span>  
 +
*<span style="font-size:larger;">Click '''Save''' to apply the changes.</span>  
 +
*<span style="font-size:larger;">Click '''Test''' button.</span>  
  
&nbsp;
+
'''2. Start GenAI Assistant Mode'''
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-8.png|none|900x600px|Rag-8.png]]</div>
 
&nbsp;
 
  
<span style="font-size:larger;">On the add new model page, fill in and select the required fields shown in the red box:</span>
+
*The GenAI Assistant Mode will appear, allowing you to invoke tools and start a conversation.
 
+
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
<span style="font-size:larger;">* Title, * Subtitle, * Base Model, and *System Prompt.</span> &nbsp;
+
[[File:Ai-agent-2 1757558303765.png|900x600px|Ai-agent-2 1757558303765.png]]
 
+
</div> <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
&nbsp;
+
[[File:Ai-agent-3 1757558242087.png|900x600px|Ai-agent-3 1757558242087.png]]
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-9.png|none|900x600px|Rag-9.png]]</div>  
+
</div>  
 
&nbsp;
 
&nbsp;
  
<span style="font-size:larger;">Continuing from the previous page,</span>
+
'''Change Suggest content'''
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">
 +
[[File:Suggestions1.png|900x600px|Suggestions1.png]]
 +
</div>
 +
*<span style="font-size:larger;">Change Suggested Content on the Agent Page.</span>  
  
<span style="font-size:larger;">1. Click the "Select Knowledge" to&nbsp;select the Knowledge you just created,</span>
+
= Example =
  
<span style="font-size:larger;">2. Click the "Save & Create"&nbsp;to save and create.</span> &nbsp;
+
== Creating an Audio + RAG Chatbot for Medication Assistant ==
 +
<div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:EAS-GenAI DevKit.jpg|none|800x400px|GenAI Chatbot DevKit]]</div>
 +
=== <span style="font-size:large;">1. Configuring TTS with Azure AI Speech API</span> ===
 +
<div style="margin-left: 2em;"><span style="font-size:large;">[[#Create_an_Account_on_Azure_AI_Speech_API|(1). Create an Account on Azure AI Speech API]]</span></div> <div style="margin-left: 2em;"><span style="font-size:larger;">[[#Setup_the_Azue_Text-to-Speec_in.C2.A0GenAI_Chatbot|(2). Setting Up on GenAI Chatbot]]</span></div> <div style="margin-left: 2em;">&nbsp;</div>
 +
=== <span style="font-size:large;">2. [[#Create_a_new_Knowledge|Create a Knowledge]]</span> ===
  
 
&nbsp;
 
&nbsp;
  
&nbsp;
+
=== <span style="font-size:large;">3. [[#Create_a_Chatbot_Assistant_with_RAG_.28_Knowledge_.29|Create a Chatbot Assistant with RAG ( Knowledge )]]</span> ===
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-10.png|none|900x600px|Rag-10.png]]</div>  
 
<span style="font-size:larger;">After successful creation, a notification will appear at icon 1.</span>
 
 
 
<span style="font-size:larger;">Then, click on the model ( icon 2 ) to enter the model chat.</span>&nbsp;<span style="font-size:larger;">Start using the audio assistant.</span>
 
  
 
&nbsp;
 
&nbsp;
  
 +
=== <span style="font-size:large;">4. </span>Start a voice chatbot assistant with RAG ===
 +
<div style="margin-left: 2em;">
 
&nbsp;
 
&nbsp;
 
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-stt-tts-4.png|none|900x600px|Rag-stt-tts-4.png]]</div>  
 
</div> <div style="margin-left: 2em;"><div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;">[[File:Rag-stt-tts-4.png|none|900x600px|Rag-stt-tts-4.png]]</div>  
 
<span style="font-size: 15.6px;">1. Make sure the select model is the RAG model.</span><br/> <span style="font-size:larger;">2. Click the mic icon&nbsp;to start voice mode.</span><br/> <span style="font-size:larger;">3. While speaking, the system will show a listening status.</span><br/> <span style="font-size:larger;">4. After speaking, your question will appear as text.</span><br/> <span style="font-size:larger;">5. The Medical Chatbot Assistant will response and play the answer with audio.</span>
 
<span style="font-size: 15.6px;">1. Make sure the select model is the RAG model.</span><br/> <span style="font-size:larger;">2. Click the mic icon&nbsp;to start voice mode.</span><br/> <span style="font-size:larger;">3. While speaking, the system will show a listening status.</span><br/> <span style="font-size:larger;">4. After speaking, your question will appear as text.</span><br/> <span style="font-size:larger;">5. The Medical Chatbot Assistant will response and play the answer with audio.</span>
</div>
+
</div>  
 +
== Add new mcp server on the Genai-Chatbot&nbsp;==
 +
[https://github.com/ADVANTECH-Corp/EdgeAI_Workflow/blob/main/ai_system/amd/aimb-2210/create_mcp_server.md Link]<br/> &nbsp;

Latest revision as of 03:42, 26 September 2025

Introduction

GenAI Chatbot is a next-generation conversational AI assistant designed to provide natural, context-aware interactions. At its core, it utilizes efficient Small Language Models (SLMs) and supports the direct import of models fine-tuned within GenAI Studio, enabling easy deployment and immediate use of custom models in the chatbot.

The chatbot features advanced capabilities, including:

  • Audio processing (Speech-to-Text [STT] and Text-to-Speech [TTS]).
  • Retrieval-Augmented Generation (RAG).
  • An embedded vector database (VectorDB).
  • Model Context Protocol (MCP) tools, which enable AI agents to perform actions.

GenAI Chatbot features a flexible configuration suitable for diverse application scenarios and is optimized for embedded platforms such as the Ryzen AI 8000, NVIDIA Jetson Orin Nano, and Jetson Orin AGX.


How To

Download Models from Ollama (Support Device: Nvidia)

Ollama-1.png
  • Go to the page https://www.ollama.com/search and click on the "Models" tab as shown in Icon 1.
  • Use the search bar shown in Icon 2 to find the model you want to download.
  • In Icon 3, locate the name of the model.

 

 

Ollama-2.png
  • After clicking in, you'll see the name and version of the model you need to download.
  • Please note that the model size depends on your hardware resources.
  • Make sure your hardware matches the specifications shown in the table above.

 

 

Ollama-3.png
  • Go back to GenAI-Chatbot and create new chat window, as shown in Icon 1.
  • Enter the model name you just saw into the search bar in the chat window, as shown in Icon 2.
  • Then, click the download button at the location marked in Icon 3.

 

 

Ollama-4.png
  • After clicking the download button, a notification will pop up.

 

 

Ollama-5.png
  • After the download is complete, a notification will appear confirming the completion.

 

 

Ollama-6.png
  • Next, you'll be able to find the model you downloaded in the model selection menu.

Delete Models on GenAI-Chatbot (Support Device: Nvidia)

 

Delete-1.png
  • Click on icon 1 "User" to enter the Admin Panel (icon 2).
  • After entering "Settings," click on icon 3 "Models."
  • Click the download icon (icon 4) on the right.

 

Delete-2.png
  • After the window pops up, find the option to delete the model at the location of icon 1.
  • After selecting the model you want to delete, click on icon 2 "Delete."

 

Delete-3.png
  • Click "Confirm".

 

Delete-4.png
  • A notification will pop up after a successful operation.

Download SLM Models from GenAI Studio

Genai-studio-1.png
  • Click GenAI Studio Hub from the left menu.
  • Enter the URL of your GenAI Studio.
  • Click the "Save" 
  • Once the configuration is successful, a notification will appear as shown at icon 4.
  • Displays a list of all models supported by GenAI Studio.
  • Click on icon 6 to download the desired model.

 

 

Genai-studio-3.png
  • After the download is complete, a notification will appear, and the icon will change to a completion icon.

 

Genai-studio-4.png
  • After the model has downloaded, you can select this LLM Model in new Chat 

 

Create a new Knowledge

Rag-1.png
  • Client the Workspace from the left menu.
  • Go to the Knowledge.
  • Click the + icon to add a new knowledge.

Here are sample files: * PDF: tial_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.pdf , * Text: 10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.txt  

 

Rag-2.png
  • Enter the title.
  • Enter the goal or description.
  • Click the "Create Knowledge" button to finish.

 

Rag-4.png
  • Click the "+" icon.
  • Click the "Upload files" to upload files.

 

Rag-5.png
  • Select the files you want to use.

 

Rag-6.png
  • After the upload, the files will be displayed and a success notification will appear.

 

Create a Chatbot Assistant with RAG ( Knowledge )

Rag-7.png
  • Go to the Models tab.
  • Click the "+" icon, to add a new model.

 

Rag-8.png
  • On the add new model page, fill in and select the required fields shown in the red box:
    • Click the "+" icon, to add a new model.
    • * Title, * Subtitle, * Base Model, and * System Prompt.

 

Rag-9.png

Continuing from the previous page,

  • Click the "Select Knowledge" to select the Knowledge you just created,
  • Click the "Save & Create" to save and create.

 

Rag-10.png
  • After successful creation, a notification will appear at icon 1.
  • Then, click on the model ( icon 2 ) to enter the model chat. Start the Assistant chat.

 

Rag-11.png
  • The chat window will display that the model in use is the Knowledge model you created.

 

Rag-12.png
  • After starting the conversation, you will see that the model retrieves information from the Knowledge you created in its responses.

 

Configuring TTS with Azure AI Speech API

Create an Account on Azure AI Speech API

1. Create an Azure account

Azure-1.png
  • Get started with Azure’s free account: new users receive $200 credit for 30 days and free access to popular services.
Azure-2.png
  • AI Speech – Text-to-Speech: 500,000 neural characters per month for free accounts

2. Set Up the Azure Speech Service

Azure-speech-1.png
Azure-speech-2.png
  • Click on icon 1: "AI + Machine Learning"
  • Then, click on icon 2: "Speech"
Azure-speech-3.png
  • Click on “Start” at the position marked by the red box.
Azure-speech-4.png
  • Click "Create" and fill in the necessary details:
    • Subscription: Choose your Azure subscription.
    • Resource Group: Select an existing group or create a new one.
    • Region: Choose a region close to your location.
    • Name: Provide a unique name for your Speech resource.
    • Pricing Tier: Select Free F0.
    • Click on icon 2: "Review + create"
Azure-speech-5.png
  • After confirming the information, click the “Create” button.
Azure-speech-6.png
  • After entering the overview page, click on the name link of the resource you created under "Resource."
Azure-speech-7.png
  • In the left-hand menu, click on "Keys and Endpoint".
  • Note down the Key1 or Key2 and the Endpoint URL; you'll need these to authenticate your API requests.

 

Setup the Azue Text-to-Speec in GenAI Chatbot

Stt-tts-1.png
  • Click the"Admin Panel."

 

Stt-tts-2.png
  • Click the Audio
  • Select the "Text-to-Speech Engine" with "Azure AI Speech".

 

Stt-tts-3.png
  • Enter the Azure AI Speech API token in API Key.
  • Click the "Save" icon.
  • Finally, you will see a success notification.

Evaluate the Benchmark of Each Chatbot Response

Chatbot-benchmark.png
  • An information button is provided next to each response. Clicking it reveals detailed performance and inference statistics for that response, including token counts, processing speed, and computation time. This allows developers to monitor and optimize system performance in real time.

Using MCP tools

1. Verify the default MCP server in the GenAI-Chatbot tools

Mcp-tool-1 1757558120013.png

  • Click User.
  • Select Admin Panel.
  • Open the Tools section.
  • Under Manage Tool Server, ensure that file-utils / mcp-system-info are listed.
  • Click Save to apply the changes.

2. Open a new chat and select the tools

Mcp-tool-2 1757558139296.png

  • Select New Chat.
  • Click the “+” button in the chat window.
  • Choose the tool to open, e.g., system-info.
  • Verify that the tool icon appears next to the “+” button, with the number of icons corresponding to the number of selected tools.

3. Use the tool to obtain system information

  • Example: Ask the LLM model → “What is the current memory usage?

Mcp-tool-3 1756969033152.png

4. Review the MCP server APIs and available functions

Image 1757556413952.png

Using GenAI Assistant Mode

1. Configure Agent Settings

Ai-agent-1 1757558170990.png

  • Click User.
  • Select Admin Panel.
  • Open the Agent section.
  • Select model.
  • Select tools.
  • Click Save to apply the changes.
  • Click Test button.

2. Start GenAI Assistant Mode

  • The GenAI Assistant Mode will appear, allowing you to invoke tools and start a conversation.

Ai-agent-2 1757558303765.png

Ai-agent-3 1757558242087.png

 

Change Suggest content

Suggestions1.png

  • Change Suggested Content on the Agent Page.

Example

Creating an Audio + RAG Chatbot for Medication Assistant

GenAI Chatbot DevKit

1. Configuring TTS with Azure AI Speech API

(1). Create an Account on Azure AI Speech API
(2). Setting Up on GenAI Chatbot
 

2. Create a Knowledge

 

3. Create a Chatbot Assistant with RAG ( Knowledge )

 

4. Start a voice chatbot assistant with RAG

 

Rag-stt-tts-4.png

1. Make sure the select model is the RAG model.
2. Click the mic icon to start voice mode.
3. While speaking, the system will show a listening status.
4. After speaking, your question will appear as text.
5. The Medical Chatbot Assistant will response and play the answer with audio.

Add new mcp server on the Genai-Chatbot 

Link