{"id":27970,"date":"2025-06-25T10:44:03","date_gmt":"2025-06-25T17:44:03","guid":{"rendered":"https:\/\/www.pingcap.com\/?post_type=article&#038;p=27970"},"modified":"2025-06-25T11:29:18","modified_gmt":"2025-06-25T18:29:18","slug":"building-a-rag-application-from-scratch-retrieval-and-generation-components","status":"publish","type":"article","link":"https:\/\/www.pingcap.com\/ko\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/","title":{"rendered":"Building a RAG Application from Scratch: Retrieval and Generation Components"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Before_We_Dive_In\"><\/span>Before We Dive In<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential for more effective and human-like interactions.&nbsp;<\/p>\n\n\n\n<p>In Part 1, we covered the fundamentals of RAG and how to prepare your data. Now, we&#8217;ll focus on constructing the retrieval system that fetches relevant information from your knowledge base and integrating it with a language model to generate accurate and context-aware responses.<\/p>\n\n\n\n<p><strong>New here?<\/strong>\u00a0<a href=\"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-understanding-rag-and-preparing-your-data\/\">Start with Part 1: Understanding RAG and Preparing Your Data \u2192<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Building_the_Retrieval_Component\"><\/span>Building the Retrieval Component<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The retrieval component is the backbone of any Retrieval-Augmented Generation (RAG) application. It ensures that the most relevant information is fetched from your knowledge base to support the generation of accurate and contextually appropriate responses. This section will guide you through implementing a search engine and optimizing its performance for your RAG application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Implementing a Search Engine<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Choosing the Right Search Algorithm<\/h4>\n\n\n\n<p>Selecting the appropriate search algorithm is crucial for the efficiency and accuracy of your retrieval component. Here are some popular search algorithms and their key features:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Term-Based Matching<\/strong>: This traditional method involves matching query terms with indexed terms in the knowledge base. It\u2019s straightforward but may not capture the semantic meaning of queries.<\/li>\n\n\n\n<li><strong>Vector Similarity Search<\/strong>: This advanced technique converts data into high-dimensional vectors and uses algorithms like k-nearest neighbors (k-NN) to find similar items. It excels in capturing semantic similarities, making it ideal for applications requiring nuanced understanding.<\/li>\n\n\n\n<li><strong>Hybrid Search<\/strong>: Combining term-based matching with vector similarity search can offer the best of both worlds, ensuring both precision and relevance.<\/li>\n<\/ul>\n\n\n\n<p>For instance, using TiDB database\u2019s advanced vector indexing features can significantly enhance the performance of your RAG application, especially when dealing with large-scale data.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Integrating the Search Engine with Your Application<\/h4>\n\n\n\n<p>Once you\u2019ve chosen the right search algorithm, the next step is to integrate the search engine with your RAG application. Here\u2019s a step-by-step guide:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Set Up Your Search Engine<\/strong>: <code>from langchain import LangChainfrom langchain.search import VectorSearch# Initialize your search enginesearch_engine = VectorSearch()<\/code><\/li>\n\n\n\n<li><strong>Index Your Data<\/strong>: # Assuming you have a list of documents documents = [&#8220;Document 1&#8221;, &#8220;Document 2&#8221;, &#8220;Document 3&#8221;]search_engine.index_documents(documents)<\/li>\n\n\n\n<li><strong>Perform Searches<\/strong>: query = &#8220;Your search query&#8221;results = search_engine.search(query)print(results)<\/li>\n\n\n\n<li><strong>Integrate with FastAPI<\/strong>: from fastapi import FastAPIapp = FastAPI()@app.get(&#8220;\/search&#8221;)def search(query: str): results = search_engine.search(query) return {&#8220;results&#8221;: results}<\/li>\n<\/ol>\n\n\n\n<p>By following these steps, you ensure that your search engine is seamlessly integrated with your application, providing fast and accurate retrieval of relevant information.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Optimizing_Retrieval_Performance\"><\/span>Optimizing Retrieval Performance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To deliver fast, scalable responses in a Retrieval-Augmented Generation (RAG) application, optimizing both search speed and data handling is essential. The following techniques can help maintain high performance even with growing datasets and user demand.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Improving Search Speed<\/h3>\n\n\n\n<p>Efficient retrieval is paramount for a responsive RAG application. Here are some techniques to enhance search speed:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Index Optimization<\/strong>: Regularly update and optimize your indexes to ensure quick lookups. This can involve re-indexing data periodically and using efficient data structures.<\/li>\n\n\n\n<li><strong>Caching<\/strong>: Implement caching mechanisms to store frequently accessed data, reducing the need for repeated searches.<\/li>\n\n\n\n<li><strong>Parallel Processing<\/strong>: Utilize parallel processing to handle multiple search queries simultaneously, thereby improving overall throughput.<\/li>\n<\/ul>\n\n\n\n<p>For example, leveraging TiDB database\u2019s horizontal scalability can help distribute the search load across multiple nodes, significantly boosting performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Handling Large Datasets<\/h3>\n\n\n\n<p>Managing large datasets can be challenging, but with the right strategies, you can ensure efficient retrieval:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Sharding<\/strong>: Divide your dataset into smaller, more manageable shards. This allows for parallel processing and reduces the load on individual nodes.<\/li>\n\n\n\n<li><strong>Compression<\/strong>: Use data compression techniques to reduce the storage footprint and speed up data transfer.<\/li>\n\n\n\n<li><strong>Distributed Systems<\/strong>: Employ distributed systems like TiDB database, which supports horizontal scalability and high availability, making it easier to handle large volumes of data.<\/li>\n<\/ul>\n\n\n\n<p>By implementing these techniques, you can ensure that your RAG application remains performant and scalable, even as the size of your dataset grows.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Building_the_Generation_Component\"><\/span>Building the Generation Component<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The generation component is a crucial part of any Retrieval-Augmented Generation (RAG) application. It ensures that the information retrieved is transformed into coherent and contextually relevant responses. This section will guide you through training a language model and integrating retrieval with generation to create a seamless RAG system.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Selecting a Pre-Trained Model<\/h3>\n\n\n\n<p>Choosing the right pre-trained model is the first step in building an effective generation component. Pre-trained models like GPT-3, BERT, and T5 have been trained on vast amounts of data and can serve as a robust foundation for your RAG application. Here\u2019s how to select a suitable model:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Evaluate Your Needs<\/strong>: Determine the specific requirements of your application. For instance, if your focus is on generating conversational responses, models like GPT-3 are highly effective.<\/li>\n\n\n\n<li><strong>Consider Model Size<\/strong>: Larger models generally provide better performance but require more computational resources. Balance your need for accuracy with available resources.<\/li>\n\n\n\n<li><strong>Check Compatibility<\/strong>: Ensure the model is compatible with the tools and frameworks you\u2019re using, such as LangChain.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Fine-Tuning the Model for Your Application<\/h3>\n\n\n\n<p>Fine-tuning a pre-trained model tailors it to your specific use case, enhancing its performance. Here\u2019s a step-by-step guide:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Prepare Your Dataset<\/strong>: Use the cleaned and structured data from your knowledge base.<\/li>\n\n\n\n<li><strong>Set Up Your Environment<\/strong>: Ensure you have the necessary libraries installed, such as&nbsp;<code>transformers<\/code>&nbsp;and&nbsp;<code>datasets<\/code>.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install transformers datasets<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Fine-Tune the Model<\/strong>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code><code>from transformers import Trainer, TrainingArguments, GPT2LMHeadModel, GPT2Tokenizermodel = GPT2LMHeadModel.from_pretrained('gpt2')tokenizer = GPT2Tokenizer.from_pretrained('gpt2')# Prepare datasettrain_dataset = ...  # Your training data heretraining_args = TrainingArguments(    output_dir='.\/results',    num_train_epochs=3,    per_device_train_batch_size=4,    save_steps=10_000,    save_total_limit=2,)trainer = Trainer(    model=model,    args=training_args,    train_dataset=train_dataset,)trainer.train()<\/code><\/code><\/pre>\n\n\n\n<p>Fine-tuning allows your model to adapt to the specific language and context of your application, ensuring more accurate and relevant outputs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Integrating_Retrieval_and_Generation\"><\/span>Integrating Retrieval and Generation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Combining Search Results with Generated Content<\/h3>\n\n\n\n<p>The essence of a RAG application lies in effectively combining retrieved information with generated content. This integration ensures that the responses are not only contextually relevant but also grounded in real data.<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Retrieve Relevant Information<\/strong>: search_results = search_engine.search(query)<\/li>\n\n\n\n<li><strong>Generate Response Using Retrieved Data<\/strong>: input_text = &#8221; &#8220;.join(search_results) + &#8221; &#8221; + queryinputs = tokenizer.encode(input_text, return_tensors=&#8217;pt&#8217;)outputs = model.generate(inputs, max_length=100, num_return_sequences=1)response = tokenizer.decode(outputs[0], skip_special_tokens=True)print(response)<\/li>\n<\/ol>\n\n\n\n<p>By combining search results with the generated content, you ensure that the response is both accurate and contextually appropriate.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Ensuring Coherence and Relevance<\/h3>\n\n\n\n<p>Maintaining coherence and relevance in the generated responses is critical for user satisfaction. Here are some best practices:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Contextual Embedding<\/strong>: Use contextual embeddings to ensure that the generated text aligns with the retrieved information.<\/li>\n\n\n\n<li><strong>Post-Processing<\/strong>: Implement post-processing steps to refine the generated text, ensuring it is grammatically correct and contextually relevant.<\/li>\n\n\n\n<li><strong>Feedback Loops<\/strong>: Incorporate feedback mechanisms to continuously improve the model\u2019s performance based on user interactions.<\/li>\n<\/ul>\n\n\n\n<p>By following these practices, you can build a generation component that produces high-quality, reliable, and contextually relevant responses, making your RAG application more effective and user-friendly.<\/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 successfully integrating retrieval and generation components, your RAG application can now provide accurate and contextually relevant responses. In the final part, we&#8217;ll explore how to evaluate your application&#8217;s performance, iterate for improvements, and deploy it at scale.<\/p>\n\n\n\n<p><strong>Continue to Part 3:\u00a0<\/strong><a href=\"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-evaluation-and-deployment\/\" target=\"_blank\" rel=\"noreferrer noopener\">Evaluating and Deploying Your RAG Application<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before We Dive In In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential for more effective and human-like interactions.&nbsp; In Part 1, we covered the fundamentals of RAG and how to prepare your data. Now, we&#8217;ll focus on constructing the retrieval system that [&hellip;]<\/p>\n","protected":false},"author":305,"featured_media":0,"template":"","class_list":["post-27970","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>Building a RAG Application from Scratch: Retrieval and Generation Components | TiDB<\/title>\n<meta name=\"description\" content=\"Before We Dive In In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential Explore how to implement retrieval and generation components in a RAG pipeline. See how TiDB supports hybrid search and real-time context retrieval for generative AI apps.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building a RAG Application from Scratch: Retrieval and Generation Components | TiDB\" \/>\n<meta property=\"og:description\" content=\"Before We Dive In In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential Explore how to implement retrieval and generation components in a RAG pipeline. See how TiDB supports hybrid search and real-time context retrieval for generative AI apps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/\" \/>\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=\"2025-06-25T18:29:18+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=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/\",\"url\":\"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/\",\"name\":\"Building a RAG Application from Scratch: Retrieval and Generation Components | TiDB\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"datePublished\":\"2025-06-25T17:44:03+00:00\",\"dateModified\":\"2025-06-25T18:29:18+00:00\",\"description\":\"Before We Dive In In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential Explore how to implement retrieval and generation components in a RAG pipeline. See how TiDB supports hybrid search and real-time context retrieval for generative AI apps.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/#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\":\"Building a RAG Application from Scratch: Retrieval and Generation Components\"}]},{\"@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":"Building a RAG Application from Scratch: Retrieval and Generation Components | TiDB","description":"Before We Dive In In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential Explore how to implement retrieval and generation components in a RAG pipeline. See how TiDB supports hybrid search and real-time context retrieval for generative AI apps.","robots":{"index":"noindex","follow":"follow"},"og_locale":"ko_KR","og_type":"article","og_title":"Building a RAG Application from Scratch: Retrieval and Generation Components | TiDB","og_description":"Before We Dive In In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential Explore how to implement retrieval and generation components in a RAG pipeline. See how TiDB supports hybrid search and real-time context retrieval for generative AI apps.","og_url":"https:\/\/www.pingcap.com\/ko\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_modified_time":"2025-06-25T18:29:18+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":{"Est. reading time":"6\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/","url":"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/","name":"Building a RAG Application from Scratch: Retrieval and Generation Components | TiDB","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"datePublished":"2025-06-25T17:44:03+00:00","dateModified":"2025-06-25T18:29:18+00:00","description":"Before We Dive In In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential Explore how to implement retrieval and generation components in a RAG pipeline. See how TiDB supports hybrid search and real-time context retrieval for generative AI apps.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/article\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/#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":"Building a RAG Application from Scratch: Retrieval and Generation Components"}]},{"@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\/building-a-rag-application-from-scratch-retrieval-and-generation-components\/\">            <h3>Building a RAG Application from Scratch: Retrieval and Generation Components<\/h3>            <p>Before We Dive In In this RAG Application Guide, we\u2019ll walk you through building a RAG application from scratch, empowering you to harness its potential for more effective and human-like interactions.&nbsp; In Part 1, we covered the fundamentals of RAG and how to prepare your data. Now, we&#8217;ll focus on constructing the retrieval system that [&hellip;]<\/p>        <\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/article\/27970","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\/305"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=27970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}