{"id":17771,"date":"2024-06-23T16:59:18","date_gmt":"2024-06-23T23:59:18","guid":{"rendered":"https:\/\/www.pingcap.com\/?post_type=article&#038;p=17771"},"modified":"2024-06-23T16:59:23","modified_gmt":"2024-06-23T23:59:23","slug":"build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb","status":"publish","type":"article","link":"https:\/\/www.pingcap.com\/ko\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/","title":{"rendered":"Build a RAG-based Chatbot with AWS Bedrock, Streamlit, and TiDB Serverless: A MySQL-Compatible Database"},"content":{"rendered":"<p>Creating a Retrieval-Augmented Generation (RAG) based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless can significantly enhance the user experience by providing efficient and accurate responses. This tutorial will guide you through the process of building this robust chatbot step-by-step.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Introduction\"><\/span>Introduction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Combining AWS Bedrock for model management, Streamlit for the frontend interface, and TiDB Serverless for vector storage creates a powerful and scalable RAG-based chatbot. This tutorial assumes you have basic knowledge of Python and database management.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before you begin, ensure you have the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <a href=\"https:\/\/tidb.cloud\/ai\">TiDB Serverless<\/a> cluster with vector search enabled.<\/li>\n\n\n\n<li>Python 3.8 or higher.<\/li>\n\n\n\n<li>An AWS account with access to Amazon Bedrock.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Setting_Up_Your_Environment\"><\/span>Step 1: Setting Up Your Environment<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>First, clone the GitHub repository containing the necessary files for this project:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/Yoshiitaka\/TiDB-Bedrock.git<\/code><\/pre>\n\n\n\n<p>Next, create and activate a virtual environment:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m venv .venv\nsource .venv\/bin\/activate<\/code><\/pre>\n\n\n\n<p>Install the required libraries and packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -r requirements.txt<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Configure_Environment_Variables\"><\/span>Step 2: Configure Environment Variables<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Create a <code>.env<\/code> file in the root directory with your TiDB and AWS credentials. Use the provided <code>sample-env<\/code> file as a reference:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TIDB_HOSTNAME='your_tidb_hostname'\nTIDB_USERNAME='your_tidb_username'\nTIDB_PASSWORD='your_tidb_password'\nTIDB_DATABASE_NAME='your_tidb_database_name'<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Preparing_the_Database\"><\/span>Step 3: Preparing the Database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before running the chatbot, you need to prepare the TiDB database by embedding vector data. This step ensures the chatbot can retrieve relevant information efficiently.<\/p>\n\n\n\n<p>Run the preparation script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python prepare.py<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Developing_the_Chatbot\"><\/span>Step 4: Developing the Chatbot<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here&#8217;s the complete code to develop the RAG-based chatbot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import logging\nimport sys\nimport streamlit as st\nfrom sqlalchemy import URL\nfrom llama_index.core import VectorStoreIndex\nfrom llama_index.core.settings import Settings\nfrom llama_index.llms.bedrock import Bedrock\nfrom llama_index.vector_stores.tidbvector import TiDBVectorStore\nfrom llama_index.embeddings.bedrock import BedrockEmbedding\nimport os\nfrom dotenv import load_dotenv\nlogging.basicConfig(stream=sys.stdout, level=logging.INFO)\nlogger = logging.getLogger()\n\n# Load environment variables\nload_dotenv()\ntidb_username = os.environ&#91;'TIDB_USERNAME']\ntidb_password = os.environ&#91;'TIDB_PASSWORD']\ntidb_host = os.environ&#91;'TIDB_HOSTNAME']\ntidb_database = os.environ&#91;'TIDB_DATABASE_NAME']\n\n# Initialize LlamaIndex with Amazon Bedrock\nllm = Bedrock(model=\"anthropic.claude-3-sonnet-20240229-v1:0\")\nembed_model = BedrockEmbedding(model=\"amazon.titan-embed-text-v1\")\n\nSettings.llm = llm\nSettings.embed_model = embed_model\n\n# Initialize TiDB Vector Store\nif 'tidb_vec_index' not in st.session_state:\n    tidb_connection_url = URL(\n        \"mysql+pymysql\",\n        username=tidb_username,\n        password=tidb_password,\n        host=tidb_host,\n        port=4000,\n        database=tidb_database,\n        query={\"ssl_verify_cert\": True, \"ssl_verify_identity\": True},\n    )\n\n    tidbvec = TiDBVectorStore(\n        connection_string=tidb_connection_url,\n        table_name=\"llama_index_rag\",\n        distance_strategy=\"cosine\",\n        vector_dimension=1536,\n        drop_existing_table=False,\n    )\n\n    tidb_vec_index = VectorStoreIndex.from_vector_store(tidbvec)\n    st.session_state&#91;'tidb_vec_index'] = tidb_vec_index\n\nquery_engine = st.session_state&#91;'tidb_vec_index'].as_query_engine(streaming=True)\n\n# Streamlit UI Configuration\nst.set_page_config(page_title='TiDB &amp; Bedrock DEMO')\n\ndef clear_screen():\n    st.session_state.messages = &#91;{\"role\": \"assistant\", \"content\": \"I'm learning about TiDB. Feel free to ask me anything!\"}]\n\nwith st.sidebar:\n    st.title('RAG Application with TiDB and Bedrock \ud83e\udd16')\n    st.divider()\n    st.image('public\/tidb-logo-with-text.png', caption='TiDB')\n    st.image('public\/bedrock.png', caption='Amazon Bedrock')\n    st.button('Clear Screen', on_click=clear_screen)\n\nif \"messages\" not in st.session_state.keys():\n    st.session_state.messages = &#91;{\"role\": \"assistant\", \"content\": \"I'm learning about TiDB. Feel free to ask me anything!\"}]\n\nfor message in st.session_state.messages:\n    with st.chat_message(message&#91;\"role\"]):\n        st.write(message&#91;\"content\"])\n\nif prompt := st.chat_input():\n    with st.chat_message(\"user\"):\n        st.markdown(prompt)\n        st.session_state.messages.append({\"role\": \"user\", \"content\": prompt})\n\n    with st.chat_message(\"assistant\"):\n        placeholder = st.empty()\n        full_response = ''\n        streaming_response = query_engine.query(prompt)\n        for chunk in streaming_response.response_gen:\n            full_response += chunk\n            placeholder.markdown(full_response)\n        placeholder.markdown(full_response)\n        st.session_state.messages.append({\"role\": \"assistant\", \"content\": full_response})<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Running_the_Application\"><\/span>Step 5: Running the Application<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Start the Streamlit server to interact with the chatbot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>streamlit run main.py<\/code><\/pre>\n\n\n\n<p>Open your browser and navigate to <code>http:\/\/localhost:8501\/<\/code> to start using the chatbot.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>By following this tutorial, you have successfully built a RAG-based chatbot leveraging AWS Bedrock, Streamlit, and TiDB Serverless. This powerful combination provides an efficient and scalable solution for various applications. Explore further by integrating additional features and fine-tuning the models to fit your specific needs.<\/p>\n\n\n\n<p>Feel free to experiment and expand this setup to suit your requirements. Happy coding!<\/p>\n\n\n\n<p>You can also follow tutorials to learn how to build AI apps and how to use TiDB as vector store:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/pingcap\/tidb-vector-python\/blob\/main\/examples\/openai_embedding\/README.md\">OpenAI Embedding<\/a>: use the OpenAI embedding model to generate vectors for text data.<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/pingcap\/tidb-vector-python\/blob\/main\/examples\/image_search\/README.md\">Image Search<\/a>: use the OpenAI CLIP model to generate vectors for image and text.<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/pingcap\/tidb-vector-python\/blob\/main\/examples\/llamaindex-tidb-vector-with-ui\/README.md\">LlamaIndex RAG with UI<\/a>: use the LlamaIndex to build an <a href=\"https:\/\/docs.llamaindex.ai\/en\/latest\/getting_started\/concepts\/\">RAG(Retrieval-Augmented Generation)<\/a> application.<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/pingcap\/tidb-vector-python\/blob\/main\/examples\/llamaindex-tidb-vector\/README.md\">Chat with URL<\/a>: use LlamaIndex to build an <a href=\"https:\/\/docs.llamaindex.ai\/en\/latest\/getting_started\/concepts\/\">RAG(Retrieval-Augmented Generation)<\/a> application that can chat with a URL.<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/pingcap\/tidb-vector-python\/blob\/main\/examples\/graphrag-demo\/README.md\">GraphRAG<\/a>: 20 lines code of using TiDB Serverless to build a Knowledge Graph based RAG application.<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/pingcap\/tidb-vector-python\/blob\/main\/examples\/graphrag-step-by-step-tutorial\/README.md\">GraphRAG Step by Step Tutorial<\/a>: Step by step tutorial to build a Knowledge Graph based RAG application with Colab notebook. In this tutorial, you will learn how to extract knowledge from a text corpus, build a Knowledge Graph, store the Knowledge Graph in TiDB Serverless, and search from the Knowledge Graph.<\/li>\n\n\n\n<li><a href=\"https:\/\/colab.research.google.com\/drive\/1LuJn4mtKsjr3lHbzMa2RM-oroUvpy83y?usp=sharing\">Vector Search Notebook with SQLAlchemy<\/a>: use <a href=\"https:\/\/www.sqlalchemy.org\/\">SQLAlchemy<\/a> to interact with TiDB Serverless: connect db, index&amp;store data and then search vectors.<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/pingcap\/tidb-vector-python\/blob\/main\/examples\/jina-ai-embeddings-demo\/README.md\">Build RAG with Jina AI Embeddings<\/a>: use Jina AI to generate embeddings for text data, store the embeddings in TiDB Vector Storage, and search for similar embeddings.<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Creating a Retrieval-Augmented Generation (RAG) based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless can significantly enhance the user experience by providing efficient and accurate responses. This tutorial will guide you through the process of building this robust chatbot step-by-step. Introduction Combining AWS Bedrock for model management, Streamlit for the frontend interface, and TiDB Serverless [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"template":"","class_list":["post-17771","article","type-article","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Build a RAG-based Chatbot with AWS Bedrock, Streamlit and TiDB<\/title>\n<meta name=\"description\" content=\"Creating a RAG based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless step-by-step, with MySQL skills\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pingcap.com\/ko\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build a RAG-based Chatbot with AWS Bedrock, Streamlit and TiDB\" \/>\n<meta property=\"og:description\" content=\"Creating a RAG based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless step-by-step, with MySQL skills\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-23T23:59:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2024\/09\/11005522\/Homepage-Ad.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1440\" \/>\n\t<meta property=\"og:image:height\" content=\"714\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data1\" content=\"5\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/\",\"url\":\"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/\",\"name\":\"Build a RAG-based Chatbot with AWS Bedrock, Streamlit and TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"datePublished\":\"2024-06-23T23:59:18+00:00\",\"dateModified\":\"2024-06-23T23:59:23+00:00\",\"description\":\"Creating a RAG based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless step-by-step, with MySQL skills\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Articles\",\"item\":\"https:\/\/www.pingcap.com\/article\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Build a RAG-based Chatbot with AWS Bedrock, Streamlit, and TiDB Serverless: A MySQL-Compatible Database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pingcap.com\/#website\",\"url\":\"https:\/\/www.pingcap.com\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pingcap.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pingcap.com\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\/\/www.pingcap.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pingcap2015\",\"https:\/\/x.com\/PingCAP\",\"https:\/\/linkedin.com\/company\/pingcap\",\"https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Build a RAG-based Chatbot with AWS Bedrock, Streamlit and TiDB","description":"Creating a RAG based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless step-by-step, with MySQL skills","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pingcap.com\/ko\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/","og_locale":"ko_KR","og_type":"article","og_title":"Build a RAG-based Chatbot with AWS Bedrock, Streamlit and TiDB","og_description":"Creating a RAG based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless step-by-step, with MySQL skills","og_url":"https:\/\/www.pingcap.com\/ko\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_modified_time":"2024-06-23T23:59:23+00:00","og_image":[{"width":1440,"height":714,"url":"https:\/\/static.pingcap.com\/files\/2024\/09\/11005522\/Homepage-Ad.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@PingCAP","twitter_misc":{"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"5\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/","url":"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/","name":"Build a RAG-based Chatbot with AWS Bedrock, Streamlit and TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"datePublished":"2024-06-23T23:59:18+00:00","dateModified":"2024-06-23T23:59:23+00:00","description":"Creating a RAG based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless step-by-step, with MySQL skills","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Articles","item":"https:\/\/www.pingcap.com\/article\/"},{"@type":"ListItem","position":3,"name":"Build a RAG-based Chatbot with AWS Bedrock, Streamlit, and TiDB Serverless: A MySQL-Compatible Database"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]}]}},"card_markup":"        <a class=\"card-article\" href=\"https:\/\/www.pingcap.com\/ko\/article\/build-a-rag-based-chatbot-with-aws-bedrock-streamlit-and-tidb\/\">            <h3>Build a RAG-based Chatbot with AWS Bedrock, Streamlit, and TiDB Serverless: A MySQL-Compatible Database<\/h3>            <p>Creating a Retrieval-Augmented Generation (RAG) based chatbot using AWS Bedrock, Streamlit, and TiDB Serverless can significantly enhance the user experience by providing efficient and accurate responses. This tutorial will guide you through the process of building this robust chatbot step-by-step. Introduction Combining AWS Bedrock for model management, Streamlit for the frontend interface, and TiDB Serverless [&hellip;]<\/p>        <\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article\/17771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/8"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=17771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}