Difference between revisions of "Edge AI SDK/GenAIChatbot"
Eric.liang (talk | contribs) (→Creating an Audio + RAG Chatbot for Medication Assistant) |
|||
| (72 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
= Introduction = | = Introduction = | ||
| − | <span style="font-size:larger;">GenAI Chatbot is a next-generation conversational AI assistant | + | <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;"> | + | *<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 = | |
| − | |||
| − | |||
| − | |||
| − | <span style="font-size:larger;"> | + | == 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> | ||
| − | == | + | |
| + | <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> | ||
| + | | ||
| + | </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> | ||
| − | *<span style="font-size: | + | |
| + | <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> | ||
| + | | ||
| + | </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> | ||
| − | < | + | |
| + | <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> | ||
| + | | ||
| + | </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> | ||
| − | *<span style="font-size: | + | |
| + | <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> | ||
| + | | ||
| + | </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> | ||
| − | < | + | |
| + | <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> | ||
| + | | ||
| + | </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)''' == |
| − | < | + | *<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> |
| − | + | | |
| − | + | <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> | ||
| − | + | | |
| − | + | <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> | ||
| − | = | + | |
| + | <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> | ||
| + | |||
| + | | ||
| + | <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 54: | 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;"> | + | *<span style="font-size:larger;">Click GenAI Studio Hub from the left menu.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Enter the URL of your GenAI Studio.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Click the "Save" </span> |
| − | *<span style="font-size:larger;"> | + | *<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;"> | + | *<span style="font-size:larger;">Displays a list of all models supported by GenAI Studio.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Click on icon 6 to download the desired model.</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;"> | ||
| + | | ||
| + | </div> <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> | ||
[[File:Genai-studio-3.png|none|900x600px|Genai-studio-3.png]] | [[File:Genai-studio-3.png|none|900x600px|Genai-studio-3.png]] | ||
</div> | </div> | ||
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">After the download is complete, a notification will appear, and the icon will change to a completion icon.</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: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;"> | + | *<span style="font-size:larger;">After the model has downloaded, you can select this LLM Model in new Chat </span> |
| − | |||
| | ||
| − | == Create a new | + | == 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;"> | + | *<span style="font-size:larger;">Client the Workspace from the left menu.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Go to the Knowledge.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Click the + icon to add a new knowledge.</span> |
| + | |||
| + | <span style="font-size:larger;">Here are sample files:</span> <span style="font-size:larger;">* PDF: [[Media:10_Essential_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.pdf|tial_Q&As_About_Over-the-Counter_(OTC)_Medication_Use.pdf]] ,</span> <span style="font-size:larger;">* Text: '''[[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]]''' </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-2.png|none|900x600px|Rag-2.png]] | [[File:Rag-2.png|none|900x600px|Rag-2.png]] | ||
</div> | </div> | ||
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Enter the title.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Enter the goal or description.</span> |
| − | *<span style="font-size:larger;"> | + | *<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;"> | <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;"> | + | *<span style="font-size:larger;">Click the "+" icon.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Click the "Upload files" to upload files.</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-5.png|none|900x600px|Rag-5.png]] | [[File:Rag-5.png|none|900x600px|Rag-5.png]] | ||
</div> | </div> | ||
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Select the files you want to use.</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-6.png|none|900x600px|Rag-6.png]] | [[File:Rag-6.png|none|900x600px|Rag-6.png]] | ||
</div> | </div> | ||
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">After the upload, the files will be displayed and a success notification will appear.</span> |
| + | |||
| + | | ||
| + | |||
| + | == 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;"> | + | *<span style="font-size:larger;">Go to the Models tab.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Click the "+" icon, to add a new model.</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-8.png|none|900x600px|Rag-8.png]] | [[File:Rag-8.png|none|900x600px|Rag-8.png]] | ||
</div> | </div> | ||
| − | *<span style="font-size:larger;"> | + | *<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> | ||
| + | |||
| + | | ||
<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,</span> | |
| + | |||
| + | *<span style="font-size:larger;">Click the "Select Knowledge" to select the Knowledge you just created,</span> | ||
| + | *<span style="font-size:larger;">Click the "Save & Create" to save and create.</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-10.png|none|900x600px|Rag-10.png]] | [[File:Rag-10.png|none|900x600px|Rag-10.png]] | ||
</div> | </div> | ||
| − | *<span style="font-size:larger;"> | + | *<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. Start the Assistant chat.</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-11.png|none|900x600px|Rag-11.png]] | [[File:Rag-11.png|none|900x600px|Rag-11.png]] | ||
</div> | </div> | ||
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">The chat window will display that the model in use is the Knowledge model you created.</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-12.png|none|900x600px|Rag-12.png]] | [[File:Rag-12.png|none|900x600px|Rag-12.png]] | ||
</div> | </div> | ||
| − | *<span style="font-size:larger;"> | + | *<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> |
| | ||
| Line 186: | 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;"> | + | |
| + | |||
| + | === <span style="font-size:larger;">Setup the Azue Text-to-Speec in 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;"> | + | *<span style="font-size:larger;">Click the"Admin Panel."</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-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;"> | + | *<span style="font-size:larger;">Click the Audio</span> |
| + | *<span style="font-size:larger;">Select the "Text-to-Speech Engine" with "Azure AI Speech".</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-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;"> | + | *<span style="font-size:larger;">Enter the Azure AI Speech API token in API Key.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Click the "Save" icon.</span> |
| − | *<span style="font-size:larger;"> | + | *<span style="font-size:larger;">Finally, you will see a success notification.</span> |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
== Evaluate the Benchmark of Each Chatbot Response == | == Evaluate the Benchmark of Each Chatbot Response == | ||
| Line 213: | 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> | ||
| − | = | + | == Using MCP tools == |
| − | |||
| − | |||
| − | + | '''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;"> | <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> | ||
| − | [[File: | + | [[File:Mcp-tool-1 1757558120013.png|900x600px|Mcp-tool-1 1757558120013.png]] |
</div> | </div> | ||
| − | + | *<span style="font-size:larger;">Click '''User'''.</span> | |
| − | < | + | *<span style="font-size:larger;">Select '''Admin Panel'''.</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> | ||
| − | 2. | + | '''2. Open a new chat and select the tools''' |
| − | <div style=" | + | <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> |
| − | + | [[File:Mcp-tool-2 1757558139296.png|900x600px|Mcp-tool-2 1757558139296.png]] | |
| − | |||
| − | |||
</div> | </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> | ||
| − | + | '''3. Use the tool to obtain system information''' | |
| − | + | *<span style="font-size:larger;">Example: Ask the LLM model → “'''What is the current memory usage?'''”</span> | |
| − | < | + | <div style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> |
| − | [[File: | + | [[File:Mcp-tool-3 1756969033152.png|900x600px|Mcp-tool-3 1756969033152.png]] |
</div> | </div> | ||
| − | + | '''4. Review the MCP server APIs and available functions''' | |
| − | + | ||
| − | [[File: | + | *<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 style="display:inline-block; box-shadow:0 4px 16px rgba(0,0,0,0.15); border-radius:12px;"> | ||
| + | [[File:Image 1757556413952.png|900x600px|Image 1757556413952.png]] | ||
</div> | </div> | ||
| − | + | == Using GenAI Assistant Mode == | |
| − | + | ||
| − | [[File: | + | '''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:larger;">'' | + | *<span style="font-size:larger;">Click '''User'''.</span> |
| − | </ | + | *<span style="font-size:larger;">Select '''Admin Panel'''.</span> |
| − | [[File: | + | *<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> | ||
| + | |||
| + | '''2. Start GenAI Assistant Mode''' | ||
| + | |||
| + | *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;"> | ||
| + | [[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;"> | ||
| + | [[File:Ai-agent-3 1757558242087.png|900x600px|Ai-agent-3 1757558242087.png]] | ||
</div> | </div> | ||
| − | + | | |
| − | + | ||
| − | [[File: | + | '''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> | </div> | ||
| + | *<span style="font-size:larger;">Change Suggested Content on the Agent Page.</span> | ||
| + | |||
| + | = Example = | ||
| + | |||
| + | == 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;"> </div> | ||
| + | === <span style="font-size:large;">2. [[#Create_a_new_Knowledge|Create a Knowledge]]</span> === | ||
| + | |||
| + | | ||
| + | |||
| + | === <span style="font-size:large;">3. [[#Create_a_Chatbot_Assistant_with_RAG_.28_Knowledge_.29|Create a Chatbot Assistant with RAG ( Knowledge )]]</span> === | ||
| + | |||
| + | | ||
| + | |||
| + | === <span style="font-size:large;">4. </span>Start a voice chatbot assistant with RAG === | ||
| + | <div style="margin-left: 2em;"> | ||
| | ||
| − | + | </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 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 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- | ||
| − | </div> | ||
| − | <span style="font-size: | ||
| − | </ | ||
| − | |||
| − | |||
| − | <span style="font-size:larger;"> | ||
| − | </ | ||
| − | |||
| − | |||
| − | <span style="font-size:larger;"> | ||
| − | |||
| − | |||
| − | </ | ||
| − | <span style="font-size:larger;"> | ||
| − | |||
| − | |||
| − | |||
| − | |||
</div> | </div> | ||
| − | + | == Add new mcp server on the Genai-Chatbot == | |
| − | + | [https://github.com/ADVANTECH-Corp/EdgeAI_Workflow/blob/main/ai_system/amd/aimb-2210/create_mcp_server.md Link]<br/> | |
Latest revision as of 03:42, 26 September 2025
Contents
- 1 Introduction
- 2 How To
- 2.1 Download Models from Ollama (Support Device: Nvidia)
- 2.2 Delete Models on GenAI-Chatbot (Support Device: Nvidia)
- 2.3 Download SLM Models from GenAI Studio
- 2.4 Create a new Knowledge
- 2.5 Create a Chatbot Assistant with RAG ( Knowledge )
- 2.6 Configuring TTS with Azure AI Speech API
- 2.7 Evaluate the Benchmark of Each Chatbot Response
- 2.8 Using MCP tools
- 2.9 Using GenAI Assistant Mode
- 3 Example
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)
- 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.
- 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.
- 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.
- After clicking the download button, a notification will pop up.
- After the download is complete, a notification will appear confirming the completion.
- Next, you'll be able to find the model you downloaded in the model selection menu.
Delete Models on GenAI-Chatbot (Support Device: Nvidia)
- 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.
- 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."
- Click "Confirm".
- A notification will pop up after a successful operation.
Download SLM Models from GenAI Studio
- 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.
- After the download is complete, a notification will appear, and the icon will change to a completion icon.
- After the model has downloaded, you can select this LLM Model in new Chat
Create a new Knowledge
- 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
- Enter the title.
- Enter the goal or description.
- Click the "Create Knowledge" button to finish.
- Click the "+" icon.
- Click the "Upload files" to upload files.
- Select the files you want to use.
- After the upload, the files will be displayed and a success notification will appear.
Create a Chatbot Assistant with RAG ( Knowledge )
- Go to the Models tab.
- Click the "+" icon, to add a new model.
- 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.
Continuing from the previous page,
- Click the "Select Knowledge" to select the Knowledge you just created,
- Click the "Save & Create" to save and create.
- 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.
- The chat window will display that the model in use is the Knowledge model you created.
- 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
- Get started with Azure’s free account: new users receive $200 credit for 30 days and free access to popular services.
- AI Speech – Text-to-Speech: 500,000 neural characters per month for free accounts
2. Set Up the Azure Speech Service
- In the Azure Portal, click on "Create a resource".
- Click on icon 1: "AI + Machine Learning"
- Then, click on icon 2: "Speech"
- Click on “Start” at the position marked by the red box.
- 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"
- After confirming the information, click the “Create” button.
- After entering the overview page, click on the name link of the resource you created under "Resource."
- 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
- Click the"Admin Panel."
- Click the Audio
- Select the "Text-to-Speech Engine" with "Azure AI Speech".
- 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
- 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
- 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
- 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?”
4. Review the MCP server APIs and available functions
- MCP - System-Info-Server: http://localhost:23952/mcp-system-info/docs
Using GenAI Assistant Mode
1. Configure Agent Settings
- 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.
Change Suggest content
- Change Suggested Content on the Agent Page.
Example
Creating an Audio + RAG Chatbot for Medication Assistant
1. Configuring TTS with Azure AI Speech API
2. Create a Knowledge
3. Create a Chatbot Assistant with RAG ( Knowledge )
4. Start a voice chatbot assistant with RAG
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.