{"id":4150,"date":"2025-12-18T22:28:51","date_gmt":"2025-12-18T14:28:51","guid":{"rendered":"http:\/\/viplao.com\/?p=4150"},"modified":"2025-12-18T22:28:53","modified_gmt":"2025-12-18T14:28:53","slug":"rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86","status":"publish","type":"post","link":"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/","title":{"rendered":"RAG\u67b6\u6784\u6f14\u8fdb\u68b3\u7406"},"content":{"rendered":"\n<p>\u5bfc\u8bed\uff1a\u672c\u6587\u7cfb\u7edf\u68b3\u7406\u4e86\u68c0\u7d22\u589e\u5f3a\u751f\u6210\uff08RAG\uff09\u67b6\u6784\u7684\u6f14\u8fdb\u5386\u7a0b\uff0c\u4ece\u57fa\u7840\u67b6\u6784\u5230\u667a\u80fd\u5316\u89e3\u51b3\u65b9\u6848\u7684\u8fed\u4ee3\u8def\u5f84\u3002\u6587\u7ae0\u901a\u8fc7\u5bf9\u6bd4Naive RAG\u3001Advanced RAG\u3001Modular RAG\u548cAgentic RAG\u56db\u4ee3\u67b6\u6784\u7684\u6838\u5fc3\u7279\u70b9\u4e0e\u6280\u672f\u7a81\u7834\uff0c\u63ed\u793a\u4e86RAG\u6280\u672f\u5982\u4f55\u901a\u8fc7\u6a21\u5757\u5316\u8bbe\u8ba1\u3001\u667a\u80fd\u4f53\u534f\u540c\u7b49\u521b\u65b0\u89e3\u51b3\u77e5\u8bc6\u66f4\u65b0\u3001\u8bed\u4e49\u5bf9\u9f50\u548c\u590d\u6742\u4efb\u52a1\u5904\u7406\u7b49\u5173\u952e\u95ee\u9898\uff0c\u4e3a<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=262598654&amp;content_type=Article&amp;match_order=1&amp;q=LLM&amp;zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NjU4OTAyMTcsInEiOiJMTE0iLCJ6aGlkYV9zb3VyY2UiOiJlbnRpdHkiLCJjb250ZW50X2lkIjoyNjI1OTg2NTQsImNvbnRlbnRfdHlwZSI6IkFydGljbGUiLCJtYXRjaF9vcmRlciI6MSwiemRfdG9rZW4iOm51bGx9.Gn6gxPsVTjZcId-h53rrdPpFKziyzeqlODKM8Tmgh2k&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">LLM<\/a>\u5e94\u7528\u843d\u5730\u63d0\u4f9b\u91cd\u8981\u53c2\u8003\u3002\u7531\u4e8e\u4f5c\u8005\u6c34\u5e73\u6709\u9650\uff0c\u82e5\u76f8\u5173\u7406\u89e3\u6709\u8bef\u8bf7\u4ee5\u5b9e\u9645\u4e3a\u51c6\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_71 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u6587\u7ae0\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#1%E5%BC%95%E8%A8%80\" title=\"1.\u5f15\u8a00\">1.\u5f15\u8a00<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#11_%E4%BB%80%E4%B9%88%E6%98%AFRAG%EF%BC%88%E7%BB%B4%E5%9F%BA%EF%BC%89\" title=\"1.1 \u4ec0\u4e48\u662fRAG\uff08\u7ef4\u57fa\uff09\">1.1 \u4ec0\u4e48\u662fRAG\uff08\u7ef4\u57fa\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#12_%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81RAG\" title=\"1.2 \u4e3a\u4ec0\u4e48\u9700\u8981RAG\">1.2 \u4e3a\u4ec0\u4e48\u9700\u8981RAG<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#2_RAG%E6%BC%94%E5%8F%98%E6%B5%81%E7%A8%8B\" title=\"2. RAG\u6f14\u53d8\u6d41\u7a0b\">2. RAG\u6f14\u53d8\u6d41\u7a0b<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#21_Navie_RAG\" title=\"2.1 Navie RAG\">2.1 Navie RAG<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#22_Advanced_RAG\" title=\"2.2 Advanced RAG\">2.2 Advanced RAG<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#23_Modular_RAG\" title=\"2.3 Modular RAG\">2.3 Modular RAG<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#24_Agentic_RAG\" title=\"2.4 Agentic RAG\">2.4 Agentic RAG<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#%E6%80%BB%E7%BB%93\" title=\"\u603b\u7ed3\">\u603b\u7ed3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#%E4%B8%80%E4%BA%9B%E6%80%9D%E8%80%83\" title=\"\u4e00\u4e9b\u601d\u8003\">\u4e00\u4e9b\u601d\u8003<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/#Reference\" title=\"Reference\">Reference<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h_1946578410617930310_0\"><span class=\"ez-toc-section\" id=\"1%E5%BC%95%E8%A8%80\"><\/span><strong>1.\u5f15\u8a00<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h_1946578410617930310_1\"><span class=\"ez-toc-section\" id=\"11_%E4%BB%80%E4%B9%88%E6%98%AFRAG%EF%BC%88%E7%BB%B4%E5%9F%BA%EF%BC%89\"><\/span>1.1 \u4ec0\u4e48\u662fRAG\uff08\u7ef4\u57fa\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>\u68c0\u7d22\u589e\u5f3a\u751f\u6210\uff08\u82f1\u8bed\uff1aRetrieval-augmented generation, RAG ) \u662f\u8d4b\u4e88\u751f\u6210\u5f0f\u4eba\u5de5\u667a\u80fd\u6a21\u578b\u4fe1\u606f\u68c0\u7d22\u80fd\u529b\u7684\u6280\u672f\u3002\u68c0\u7d22\u589e\u5f3a\u751f\u6210\u4f18\u5316\u5927\u578b\u8bed\u8a00\u6a21\u578b(LLM) \u7684\u4ea4\u4e92\u65b9\u5f0f\uff0c\u8ba9\u6a21\u578b\u6839\u636e\u6307\u5b9a\u7684\u4e00\u7ec4\u6587\u4ef6\u56de\u5e94\u7528\u6237\u7684\u67e5\u8be2\uff0c\u5e76\u4f7f\u7528\u8fd9\u4e9b\u4fe1\u606f\u589e\u5f3a\u6a21\u578b\u4ece\u81ea\u8eab\u5e9e\u5927\u7684\u9759\u6001\u8bad\u7ec3\u6570\u636e\u4e2d\u63d0\u53d6\u7684\u4fe1\u606f\u3002\u68c0\u7d22\u589e\u5f3a\u751f\u6210\u6280\u672f\u4fc3\u4f7f\u5927\u578b\u8bed\u8a00\u6a21\u578b\u80fd\u591f\u4f7f\u7528\u7279\u5b9a\u9886\u57df\u6216\u66f4\u65b0\u540e\u7684\u4fe1\u606f\u3002\u5e94\u7528\u6848\u4f8b\uff0c\u5305\u62ec\u8ba9\u804a\u5929\u673a\u5668\u4eba\u8bbf\u95ee\u516c\u53f8\u5185\u90e8\u8d44\u6599\uff0c\u6216\u6765\u81ea\u6743\u5a01\u6765\u6e90\u7684\u4e8b\u5b9e\u4fe1\u606f\u3002<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic2.zhimg.com\/v2-0f21c9af62e21158e75e1781aa15afd3_1440w.jpg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">\u7b80\u6613RAG\u6d41\u7a0b<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pica.zhimg.com\/v2-62833fc40d4c78b0231d154a9b35ce06_1440w.jpg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">\u5143\u5b9d RAG\u793a\u4f8b<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h_1946578410617930310_2\"><span class=\"ez-toc-section\" id=\"12_%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81RAG\"><\/span>1.2 \u4e3a\u4ec0\u4e48\u9700\u8981RAG<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>1\u3001LLM\u7684\u5df2\u77e5\u95ee\u9898<\/strong><\/p>\n\n\n\n<ul>\n<li>\u77e5\u8bc6\u6709\u9650\uff1aLLM\u8bad\u7ec3\u662f\u79bb\u7ebf\u7684\uff0c\u5176\u6a21\u578b\u77e5\u8bc6\u4ec5\u9650\u4e8e\u8bad\u7ec3\u6570\u636e\u6240\u8986\u76d6\u7684\u77e5\u8bc6\u8303\u56f4\uff0c\u6a21\u578b\u4e0d\u5177\u5907\u65b0\u77e5\u8bc6\u6216\u672a\u8bad\u7ec3\u77e5\u8bc6\uff0c\u5982\u6ca1\u6709\u5b9e\u65f6\u6570\u636e\u6216\u79c1\u6709\u6570\u636e\u3002<\/li>\n\n\n\n<li>\u5bb9\u6613\u4ea7\u751f\u5e7b\u89c9\uff1a\u6ca1\u6709\u7b54\u6848\u7684\u60c5\u51b5\u4e0b\u53ef\u80fd\u4f1a\u63d0\u4f9b\u865a\u5047\u4fe1\u606f\u3002<\/li>\n<\/ul>\n\n\n\n<p>RAG\u662f\u89e3\u51b3\u4e0a\u8ff0\u95ee\u9898\u7684\u4e00\u79cd\u6bd4\u8f83\u8f7b\u91cf\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n\n\n\n<p><strong>2\u3001RAG\u4f18\u70b9<\/strong><\/p>\n\n\n\n<ul>\n<li>\u8f7b\u91cf\uff0c\u6210\u672c\u66f4\u4f4e\uff0c\u7075\u6d3b\uff1a\u76f8\u6bd4\u7ec4\u7ec7\u7279\u5b9a\u9886\u57df\u4fe1\u606f\u91cd\u65b0\u8bad\u7ec3\u57fa\u7840\u6a21\u578b\uff0cRAG\u662f\u5c06\u65b0\u6570\u636e\u5f15\u5165LLM\u6210\u672c\u66f4\u4f4e\u7684\u65b9\u6cd5\u3002<\/li>\n\n\n\n<li>\u652f\u6301\u5b9e\u65f6\u6570\u636e\u66f4\u65b0\uff1a\u53ef\u4ee5\u901a\u8fc7\u5de5\u5177\u5b9e\u65f6\u68c0\u7d22\u6700\u65b0\u4fe1\u606f\uff0c\u5e76\u5229\u7528LLM\u7684\u6574\u5408\u63a8\u7406\u80fd\u529b\u66f4\u51c6\u786e\u56de\u7b54\u5b9e\u65f6\u95ee\u9898\u3002<\/li>\n\n\n\n<li>\u53ef\u89e3\u91ca\u6027\uff0c\u53ef\u6eaf\u6e90\uff1a\u7b54\u6848\u6765\u6e90\u53ef\u8ffd\u6eaf\u5230\u5177\u4f53\u68c0\u7d22\u5e93\u4ee5\u53ca\u68c0\u7d22\u5185\u5bb9\uff0c\u7528\u6237\u53ef\u9a8c\u8bc1\u51c6\u786e\u6027\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>3\u3001RAG\u7f3a\u70b9<\/strong><\/p>\n\n\n\n<ul>\n<li>\u4f9d\u8d56\u77e5\u8bc6\u5e93\u8d28\u91cf\u53ca\u7cfb\u7edf\u8bbe\u8ba1\uff1a\u7cfb\u7edf\u56de\u7b54\u7684\u6548\u679c\u4e0e\u5916\u90e8\u77e5\u8bc6\u5e93\u8d28\u91cf\u548c\u6574\u4f53\u7cfb\u7edf\u8bbe\u8ba1\u6709\u8f83\u5927\u5173\u7cfb\uff0c\u82e5\u8bbe\u8ba1\u4e0d\u5408\u7406\u53ef\u80fd\u5bfc\u81f4\u7b54\u6848\u504f\u5dee\u3002<\/li>\n\n\n\n<li>\u7cfb\u7edf\u590d\u6742\u5ea6\u589e\u52a0\uff0c\u589e\u52a0\u8ba1\u7b97\u5f00\u9500\uff1a\u5927\u89c4\u6a21\u7684\u77e5\u8bc6\u5e93\u68c0\u7d22\u4f1a\u8ba9\u6574\u4f53\u7cfb\u7edf\u66f4\u52a0\u590d\u6742\uff0c\u5e76\u4e14\u4f1a\u5ef6\u957f\u7cfb\u7edf\u6027\u54cd\u5e94\u65f6\u95f4\uff0c\u5bf9\u8017\u65f6\u654f\u611f\u7684\u4e1a\u52a1\u53ef\u80fd\u4ea7\u751f\u6027\u80fd\u74f6\u9888\u3002\u7814\u7a76\u8868\u660e\uff0c\u68c0\u7d22\u73af\u8282\u5360RAG\u603b\u8017\u65f6\u768460%\u4ee5\u4e0a\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h_1946578410617930310_3\"><span class=\"ez-toc-section\" id=\"2_RAG%E6%BC%94%E5%8F%98%E6%B5%81%E7%A8%8B\"><\/span><strong>2. RAG\u6f14\u53d8\u6d41\u7a0b<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Navie RAG -&gt; Advanced RAG -&gt; Modular RAG -&gt; Agentic RAG<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h_1946578410617930310_4\"><span class=\"ez-toc-section\" id=\"21_Navie_RAG\"><\/span>2.1 Navie RAG<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>2.1.1 \u6765\u6e90<\/strong><\/p>\n\n\n\n<p>\u6700\u65e9\u7531meta\u5728\u8bba\u6587\u300aRetrieval-Augmented Generation for Knowledge-Intensive NLP Tasks\u300b\u4e2d\u63d0\u51fa\uff0c\u63d0\u51fa\u7684\u539f\u56e0\u4e3a: \u5927\u89c4\u6a21\u9884\u8bad\u7ec3\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\u867d\u5728\u4e0b\u6e38\u4efb\u52a1\u4e0a\u8868\u73b0\u4f18\u5f02\uff0c\u4f46\u7531\u4e8e\u77e5\u8bc6\u5b58\u50a8\u5728\u53c2\u6570\u4e2d\uff0c\u65e0\u6cd5\u53ca\u65f6\u66f4\u65b0\u4e14\u6613\u51fa\u73b0\u201c\u5e7b\u89c9\u201d\uff08hallucination\uff09\uff1b\u4e3a\u6b64\uff0c\u5f15\u5165\u5916\u90e8\u53ef\u68c0\u7d22\u7684\u975e\u53c2\u6570\u5316\u8bb0\u5fc6\uff08\u5982 Wikipedia \u5411\u91cf\u7d22\u5f15\uff09\uff0c\u5e76\u5c06\u68c0\u7d22\u7ed3\u679c\u4e0e\u751f\u6210\u6a21\u578b\u7ed3\u5408\uff0c\u4ece\u800c\u63d0\u5347\u77e5\u8bc6\u5bc6\u96c6\u578b\u4efb\u52a1\u7684\u51c6\u786e\u6027\u4e0e\u53ef\u8ffd\u6eaf\u6027\u3002<\/p>\n\n\n\n<p><strong>2.1.2 \u4ecb\u7ecd<\/strong><\/p>\n\n\n\n<p>\u6700\u7b80\u5355\u7684\u67b6\u6784\uff0c\u53ea\u5305\u542b3\u4e2a\u9636\u6bb5\uff1aIndexing -&gt; Retrieval -&gt; Generation.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/v2-08d149d30e0069f3cf71b4451a92f9f1_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>\u6d41\u7a0b<\/strong><\/p>\n\n\n\n<p>1\u3001\u7d22\u5f15\u6784\u5efa(\u79bb\u7ebf)<\/p>\n\n\n\n<ul>\n<li>\u6570\u636e\u52a0\u8f7d\uff1a\u4ece\u5404\u4e2a\u6765\u6e90\u6574\u5408\u6570\u636e\u3002<\/li>\n\n\n\n<li>\u6587\u6863\u5207\u5757\uff1a\u6309\u7167\u4e00\u5b9a\u7b56\u7565\u5207\u5757\u6587\u6863\uff0c\u5982\u56fa\u5b9a\u5927\u5c0f\uff0c\u8bed\u4e49\u5206\u5757\u7b49\u3002<\/li>\n\n\n\n<li>\u5411\u91cf\u5316\u4e0e\u5b58\u50a8\uff1a\u4f7f\u7528<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=262598654&amp;content_type=Article&amp;match_order=1&amp;q=Embedding%E6%A8%A1%E5%9E%8B&amp;zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NjU4OTAyMTcsInEiOiJFbWJlZGRpbmfmqKHlnosiLCJ6aGlkYV9zb3VyY2UiOiJlbnRpdHkiLCJjb250ZW50X2lkIjoyNjI1OTg2NTQsImNvbnRlbnRfdHlwZSI6IkFydGljbGUiLCJtYXRjaF9vcmRlciI6MSwiemRfdG9rZW4iOm51bGx9.4u51gK_GPYnFgXcoUizE4qIdGvxQV0Fv07_y4gDwHTQ&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">Embedding\u6a21\u578b<\/a>\uff08bge\u7cfb\u5217\u7b49\uff09\u5c06\u6587\u6863\u8f6c\u6362\u6210\u5411\u91cf\uff0c\u5c06\u5411\u91cf\u5373\u6587\u6863\u4fe1\u606f\u5b58\u50a8\u5230<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=262598654&amp;content_type=Article&amp;match_order=1&amp;q=%E5%90%91%E9%87%8F%E6%95%B0%E6%8D%AE%E5%BA%93&amp;zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NjU4OTAyMTcsInEiOiLlkJHph4_mlbDmja7lupMiLCJ6aGlkYV9zb3VyY2UiOiJlbnRpdHkiLCJjb250ZW50X2lkIjoyNjI1OTg2NTQsImNvbnRlbnRfdHlwZSI6IkFydGljbGUiLCJtYXRjaF9vcmRlciI6MSwiemRfdG9rZW4iOm51bGx9.pcj-SB8OqH6BVliYJeOLeT5OvMA9D98Kh118Aw982yo&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">\u5411\u91cf\u6570\u636e\u5e93<\/a>\uff08\u817e\u8baf\u4e91\uff0cMilvus\uff0cFaiss\uff09\u7b49\u3002<\/li>\n<\/ul>\n\n\n\n<p>2\u3001\u5728\u7ebf\u68c0\u7d22\uff08\u5728\u7ebf\uff09<\/p>\n\n\n\n<ul>\n<li>\u68c0\u7d22\uff1a\u4f7f\u7528\u76f8\u540cEmbedding\u6a21\u578b\u8f6c\u6362\u7528\u6237\u8f93\u5165\uff0c\u5e76\u4ece\u5411\u91cf\u6570\u636e\u5e93\u68c0\u7d22\u76f8\u4f3cTopK\u6587\u6863\uff08\u4f59\u5f26\u76f8\u4f3c\u5ea6\u6216\u8005\u6b27\u6c0f\u8ddd\u79bb\uff09\u3002<\/li>\n\n\n\n<li>\u751f\u6210\uff1a\u5c06\u7528\u6237\u8f93\u5165\u4e0e\u68c0\u7d22\u5230\u7684toK\u6587\u6863\u7ec4\u7ec7\u6210Prompt\uff0c\u8f93\u5165LLM\u751f\u6210\u56de\u7b54\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u7f3a\u70b9<\/strong><\/p>\n\n\n\n<ul>\n<li>\u68c0\u7d22\u8d28\u91cf\u4e0d\u4f73\uff1a\u5b58\u5728\u68c0\u7d22\u7cbe\u5ea6\u4f4e\u548c\u53ec\u56de\u7387\u4f4e\u7684\u95ee\u9898\uff0c\u53ef\u80fd\u5bfc\u81f4\u65e0\u5173\u6216\u8fc7\u65f6\u4fe1\u606f\u88ab\u53ec\u56de\uff0c\u5f71\u54cd\u751f\u6210\u7b54\u6848\u7684\u51c6\u786e\u6027\u3002<\/li>\n\n\n\n<li>\u751f\u6210\u5185\u5bb9\u7f3a\u9677\uff1a\u6a21\u578b\u5bb9\u6613\u4ea7\u751f\u5e7b\u89c9\uff08\u4fe1\u606f\u4e0d\u8db3\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h_1946578410617930310_5\"><span class=\"ez-toc-section\" id=\"22_Advanced_RAG\"><\/span>2.2 Advanced RAG<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>2.2.1 \u6765\u6e90<\/strong><\/p>\n\n\n\n<p>\u6ca1\u6709\u660e\u786e\u7684\u63d0\u51fa\u8005\uff0c\u5728Navie RAG\u67b6\u6784\u4e4b\u540e\u7531\u591a\u65b9\u9010\u6b65\u6f14\u8fdb\u5f97\u5230\uff0c\u5982\u5fae\u8f6f\u7814\u7a76\u9662\u63d0\u51fa<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=262598654&amp;content_type=Article&amp;match_order=1&amp;q=HyDE&amp;zd_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ6aGlkYV9zZXJ2ZXIiLCJleHAiOjE3NjU4OTAyMTcsInEiOiJIeURFIiwiemhpZGFfc291cmNlIjoiZW50aXR5IiwiY29udGVudF9pZCI6MjYyNTk4NjU0LCJjb250ZW50X3R5cGUiOiJBcnRpY2xlIiwibWF0Y2hfb3JkZXIiOjEsInpkX3Rva2VuIjpudWxsfQ.8jTF3BSIPhm_J5FDooimj7bupa-tIFZWmOVVacA8oF0&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">HyDE<\/a>\uff0c\u8c37\u6b4c\u5f15\u5165Rerank\uff0c\u4ee5\u53ca\u5982Elastic\u548cCohere\u516c\u53f8\u63d0\u51fa\u7684\u5404\u79cd\u4f18\u5316\u6280\u672f\u7b49\uff0c\u7531\u591a\u65b9\u5171\u540c\u6784\u6210Advanced RAG\u6280\u672f\u4f53\u7cfb. \u8fd9\u4e9b\u4f18\u5316\u6280\u672f\u63d0\u51fa\u7684\u52a8\u56e0\uff0c\u4e3b\u8981\u662f\u7531\u4e8eNavie RAG\u4ecd\u5b58\u5728\u4e00\u7cfb\u5217\u95ee\u9898\uff0c\u5982<\/p>\n\n\n\n<ul>\n<li>\u68c0\u7d22\u7cbe\u5ea6\u4e0d\u8db3\uff1aNavie RAG\u4f9d\u8d56\u5173\u952e\u8bcd\u5339\u914d\uff08\u5982BM25\uff09\u6216\u7b80\u5355\u5411\u91cf\u68c0\u7d22\uff0c\u5bfc\u81f4\u8bed\u4e49\u504f\u5dee\u95ee\u9898\u3002<\/li>\n\n\n\n<li>\u591a\u4e0a\u4e0b\u6587\u5272\u88c2\uff1aNavie RAG\u76f4\u63a5\u5c06\u68c0\u7d22\u5230\u7684\u4e0a\u4e0b\u6587\u76f4\u63a5\u62fc\u63a5Prompt\u8f93\u5165LLM\uff0c\u6ca1\u6709\u505apost-retrieval\u5904\u7406\uff0c\u6587\u6863\u5bb9\u6613\u51fa\u73b0\u5197\u4f59\u6216\u77db\u76fe\u3002<\/li>\n\n\n\n<li>\u65e0\u6cd5\u5904\u7406\u590d\u6742\u573a\u666f\uff1aNavie RAG\u5de5\u4f5c\u6d41\u6bd4\u8f83\u7b80\u5355\uff0c\u6ca1\u6709\u9488\u5bf9\u6027\u4f18\u5316\uff0c\u7cfb\u7edf\u8868\u73b0\u4e0a\u9650\u6709\u9650\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>2.2.2 \u4ecb\u7ecd<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic1.zhimg.com\/v2-a380fc1937b3175fd380fdf5b91e0a0c_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u57fa\u4e8eNavie Rag\u589e\u52a0\u4e24\u4e2a\u6b65\u9aa4\uff0c\u5305\u542b5\u4e2a\u9636\u6bb5\uff1aIndexing -&gt; Pre Retrieval -&gt; Retrievel -&gt; Post Retrievel -&gt; Generation\uff0c\u65e8\u5728\u89e3\u51b3\u6587\u6863\u53ec\u56de\u7684\u8d28\u91cf\u548c\u51c6\u786e\u7387\u3002Navie RAG\u5c5e\u4e8eAdvanced Rag\u7684\u4e00\u4e2a\u7279\u5316\uff0c\u5373Pre Retrievel\u548cPost Retrievel\u4e3a\u7a7a\u3002<\/p>\n\n\n\n<p><strong>1\u3001Pre-Retrieval<\/strong><\/p>\n\n\n\n<p>\u9884\u68c0\u7d22\u5904\u7406: \u4fa7\u91cd\u6570\u636e\u7d22\u5f15\u4f18\u5316\u3002<\/p>\n\n\n\n<ul>\n<li><strong>\u7d22\u5f15\u6570\u636e\u4f18\u5316<\/strong>\n<ul>\n<li><strong>\u589e\u5f3a\u6570\u636e\u5bc6\u5ea6\uff1a<\/strong>\u5982\u5229\u7528LLM\u6e05\u6d17\u5197\u4f59\u4fe1\u606f\uff0c\u5143\u6570\u636e\u589e\u5f3a\uff08\u6761\u4ef6\u8fc7\u6ee4\u7b49\uff09\u3002<\/li>\n\n\n\n<li><strong>\u589e\u5f3a\u7d22\u5f15\u8bed\u4e49:&nbsp;<\/strong>\u5982\u9884\u751f\u6210chunk\u5feb\u7684\u5047\u8bbe\u6027\u95ee\u9898\uff0c\u63d0\u5347\u68c0\u7d22\u5bf9\u79f0\u6027\uff0c\u5efa\u7acb\u5982\u5173\u952e\u8bcd\u641c\u7d22\uff08BM25\uff09\uff0c\u5411\u91cf\u68c0\u7d22\u6216\u56fe\u6570\u636e\u5e93\u3002\u5c1d\u8bd5\u591a\u79cdchunk\u5206\u5757\u7b56\u7565\uff08\u56fa\u5b9a\u5927\u5c0f\uff0c\u9012\u5f52\uff0c\u8bed\u4e49\u5206\u5757\uff09\u3002<\/li>\n\n\n\n<li><strong>Embeddings\u6a21\u578b\u4f18\u5316:&nbsp;<\/strong>\u9488\u5bf9\u7279\u5b9a\u9886\u57df\u6570\u636e\u5bf9\u6a21\u578b\u8fdb\u884c\u5fae\u8c03\uff0c\u63d0\u5347\u8bed\u4e49\u5339\u914d\u7cbe\u5ea6\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Query\u589e\u5f3a<\/strong>\n<ul>\n<li><strong>Query translation:&nbsp;<\/strong>query\u8f6c\u6362\uff0c\u7528\u4e8e\u7528\u6237\u7684\u4e0d\u786e\u5b9a\u6027\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u8f93\u5165\u6a21\u7cca\u8868\u8fbe\uff0c\u6216query\u4e0eindex\u6587\u6863\u4e0d\u5728\u4e00\u4e2a\u8bed\u4e49\u7a7a\u95f4\uff0c\u6216query\u8fc7\u4e8e\u590d\u6742\u7684\u60c5\u51b5\uff0c\u56e0\u6b64\u9700\u8981query\u8f6c\u6362\u3002\u5982query-rewrite,query-expansion\u7b49\u3002<\/li>\n\n\n\n<li><strong>Query enhancement:&nbsp;<\/strong>query\u589e\u5f3a\uff0c\u589e\u5f3a\u6216\u8005\u6269\u5927\u7528\u6237\u8f93\u5165\u7684query\u8bed\u4e49\uff0c\u5982: HyDE(\u5047\u8bbe\u6587\u6863\u589e\u5f3a)\uff0cStep-Back Prompting(\u56de\u9000\u4e00\u6b65prompt)\u3002<\/li>\n\n\n\n<li><strong>Query decomposition:&nbsp;<\/strong>query\u5206\u89e3\uff0c\u628a\u7528\u6237\u7684\u590d\u6742query\u5206\u89e3\u6210\u591a\u4e2a\u53ef\u7ba1\u7406\u7684\u5b50\u95ee\u9898\uff0c\u5f15\u5bfc\u6a21\u578b\u9010\u6b65\u89e3\u51b3\u5404\u4e2a\u5b50\u95ee\u9898\u3002\u5982Answer Recursively\uff08\u9012\u5f52\u56de\u7b54\uff0c\u8fed\u4ee3\uff09\uff0cAnswer Individually\uff08\u72ec\u7acb\u56de\u7b54\uff0c\u5206\u89e3\u540e\u5e76\u884c\u56de\u7b54\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>2\u3001Post-Retrievel<\/strong><\/p>\n\n\n\n<p>\u540e\u68c0\u7d22\u5904\u7406: \u4fa7\u91cd\u6570\u636e\u7ed3\u679c\u7684\u4e8c\u6b21\u52a0\u5de5&amp;\u8fc7\u6ee4<\/p>\n\n\n\n<ul>\n<li><strong>\u91cd\u6392\u5e8fRerank<\/strong><br>\u5bf9\u68c0\u7d22\u51fa\u7684\u6587\u6863\u505a\u66f4\u7cbe\u7ec6\u7684\u8bc4\u4f30\uff0c\u5c06\u771f\u6b63\u6700\u5339\u914d\u610f\u56fe\u7684\u6587\u6863\u6392\u5217\u5230\u524d\u9762\uff0c\u5c3d\u53ef\u80fd\u51cf\u5c11\u566a\u58f0<\/li>\n\n\n\n<li><strong>\u4e0a\u4e0b\u6587\u538b\u7f29Prompt Compression<\/strong><br>\u82e5\u68c0\u7d22\u51fa\u5927\u91cf\u6587\u6863\uff0c\u5728\u8f93\u9001\u7ed9LLM\u4e4b\u524d\u53ef\u80fd\u8fd8\u9700\u8981\u5bf9\u6587\u6863\u505a\u88c1\u5207\uff0c\u4ec5\u4fdd\u7559\u6700\u5173\u952e\u6838\u5fc3\u7684\u5185\u5bb9<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h_1946578410617930310_6\"><span class=\"ez-toc-section\" id=\"23_Modular_RAG\"><\/span>2.3 Modular RAG<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>2.3.1 \u6765\u6e90<\/strong><\/p>\n\n\n\n<p>Modular RAG \u6700\u65e9\u7531 Yunfan Gao \u7b49\u4eba\u5728 2024 \u5e74 7 \u6708\u7684\u8bba\u6587\u300aModular RAG: Transforming RAG Systems into LEGO-like Reconfigurable Frameworks\u300b\u4e2d\u9996\u6b21\u7cfb\u7edf\u5316\u63d0\u51fa\u3002\u63d0\u51fa\u7684\u52a8\u56e0\u6709:<\/p>\n\n\n\n<ol>\n<li>RAG\u7cfb\u7edf\u65e5\u6e10\u590d\u6742\uff1a\u4f20\u7edfRAG\u7ebf\u6027\u7ed3\u6784\u96be\u4ee5\u5e94\u5bf9\u66f4\u590d\u6742\u7684\u9700\u6c42\uff0c\u9700\u8981\u5408\u7406\u62bd\u8c61\u53ca\u89c4\u5212\uff0c\u5426\u5219\u7cfb\u7edf\u7ef4\u62a4\u56f0\u96be\u3002<\/li>\n\n\n\n<li>\u63d0\u5347\u53ef\u91cd\u7528\u6027\u53ca\u7ef4\u62a4\uff0c\u5feb\u901f\u8fed\u4ee3\uff1a\u5c06\u5404\u4e2a\u73af\u8282\u62bd\u8c61\u6210\u4e00\u4e2a\u4e2a\u7684\u53ef\u63d2\u62d4\u6a21\u5757\uff0c\u4fbf\u4e8eRAG\u7cfb\u7edf\u5f15\u5165\u65b0\u7684\u7b97\u6cd5\u6216\u8ba1\u7b97\u7b56\u7565\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u5bf9\u6bd4Advanced RAG\u67b6\u6784\uff0c\u8be5\u6846\u67b6\u5c06\u7cfb\u7edf\u5404\u4e2a\u90e8\u5206\u62bd\u8c61\u5355\u72ec\u7684\u6a21\u5757\u4e0e\u7b97\u5b50\uff0c\u5b9e\u73b0\u6a21\u5757\u53ef\u590d\u7528\uff0c\u6613\u6269\u5c55\u53ca\u7ef4\u62a4\u7684RAG\u67b6\u6784\u3002<\/p>\n\n\n\n<p><strong>2.3.2 \u4ecb\u7ecd<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>Modular RAG: Transforming RAG Systems into LEGO-like Reconfigurable Frameworks<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic1.zhimg.com\/v2-f3ed53f351fc9cb9d47dc38c159cafb6_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>\u6a21\u5757\u5316RAG<\/strong>\uff0c\u5c06 RAG \u7cfb\u7edf\u5206\u4e3a&nbsp;<strong>Module Type\u3001Module<\/strong>&nbsp;\u548c&nbsp;<strong>Operators&nbsp;<\/strong>\u4e09\u5c42\u7ed3\u6784\u3002\u6bcf\u4e2a Module Type \u4ee3\u8868 RAG \u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u6838\u5fc3\u6d41\u7a0b\uff0c\u5305\u542b\u591a\u4e2a\u529f\u80fd\u6a21\u5757\u3002\u6bcf\u4e2a\u529f\u80fd\u6a21\u5757\u53cd\u8fc7\u6765\u90fd\u5305\u542b\u591a\u4e2a\u7279\u5b9a\u7684\u8fd0\u7b97\u7b26\u3002\u6574\u4e2a RAG \u7cfb\u7edf\u53d8\u6210\u4e86\u591a\u4e2a\u6a21\u5757\u548c\u76f8\u5e94\u8fd0\u7b97\u7b26\u7684\u6392\u5217\u7ec4\u5408\uff0c\u5f62\u6210\u4e86\u6211\u4eec\u6240\u8bf4\u7684 RAG Flow\u3002\u6574\u4f53\u67097\u4e2a\u90e8\u5206\uff1aIndexing, Pre Retrieval, Retrievel, Post Retrievel, Memory, Generation,&nbsp;<strong>Orchestration<\/strong>.\u8fd9\u79cd\u8303\u5f0f\u5728\u57fa\u4e8eAdvanced RAG\u7684\u6a2a\u5411\u67b6\u6784\u4e0a\u5f15\u5165\u4e86\u7eb5\u5411\u7684\u7ed3\u6784\uff0c\u5373Module\u548cOperators\u3002<\/p>\n\n\n\n<p><strong>Orchestration\u662fModular RAG\u533a\u5206Advanced RAG\u7684\u4e00\u4e2a\u91cd\u8981\u90e8\u5206\uff0c<\/strong>\u800cMemory\u6a21\u5757\u867d\u7136\u5728\u539f\u8bba\u6587\u6ca1\u6709\u63d0\u53ca\uff0c\u4f46\u7b14\u8005\u8ba4\u4e3a\u4e5f\u662fModular RAG\u7684\u4e00\u4e2a\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u7528\u4e8e\u8d4b\u4e88RAG\u7cfb\u7edf\u7684\u957f\u671f\u8bb0\u5fc6\u80fd\u529b<\/p>\n\n\n\n<ul>\n<li>Module Type: RAG\u7cfb\u7edf\u4e2d\u7684\u6a21\u5757\u5206\u7c7b\uff0c\u5373Indexing, Pre Retrieval, Retrievel, Post Retrievel, Memory, Generation, Orchestration\u6a21\u5757\uff0c\u53ef\u4ee5\u7406\u89e3\u662f\u51fd\u6570\u63a5\u53e3\u3002<\/li>\n\n\n\n<li>Module: RAG\u7cfb\u7edf\u4e2d\u7684\u5177\u4f53\u529f\u80fd\u7ec4\u4ef6\uff0c\u6bcf\u4e2a\u6a21\u5757\u8d1f\u8d23\u5b8c\u6210\u67d0\u4e2a\u5b50\u4efb\u52a1\uff0c\u5982Retrievel\u4e2d\u53ef\u4ee5\u662fVectorRetriever\uff08\u5411\u91cf\u68c0\u7d22\uff09\uff0cHybridRetriever\uff08\u6df7\u5408\u68c0\u7d22\uff09\u3002\u53ef\u4ee5\u7406\u89e3\u662f\u51fd\u6570\u63a5\u53e3\u7684\u5b9e\u73b0\u7c7b<\/li>\n\n\n\n<li>Operators: \u6bcf\u4e2a\u6a21\u5757\u7684\u5177\u4f53\u5b9e\u73b0\uff0c\u53ef\u4ee5\u7406\u89e3\u662f\u63a5\u53e3\u5b9e\u73b0\u7c7b\u5185\u90e8\u7684\u6838\u5fc3\u7b97\u6cd5\u5b8c\u6574\u529f\u80fd\u7684\u4ee3\u7801\u7247\u6bb5\uff0c\u5982VectorRetriever\u91cc\u6709\u5982\u4e0b\u4f59\u5f26\u76f8\u4f3c\u5ea6\u7b97\u6cd5<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>def _cosine_similarity(query_vec, doc_vec):  # \u64cd\u4f5c\u7b26\n    return np.dot(query_vec, doc_vec) \/ (np.linalg.norm(query_vec)*np.linalg.norm(doc_vec))<\/code><\/pre>\n\n\n\n<p><strong>\u5173\u952e\u533a\u522b<\/strong><\/p>\n\n\n\n<ul>\n<li>Modular RAG\u7684\u6a21\u5757\u95f4\u901a\u8fc7\u6570\u636e\u6d41\u800c\u975e\u5355\u7eaf\u51fd\u6570\u8c03\u7528\u4ea4\u4e92\uff08\u5982\u68c0\u7d22\u6a21\u5757\u8f93\u51fa\u6587\u6863\u5217\u8868\u7ed9\u751f\u6210\u6a21\u5757\uff09\u3002<\/li>\n\n\n\n<li>\u64cd\u4f5c\u7b26\u53ef\u4ee5\u8de8\u6a21\u5757\u590d\u7528\uff08\u5982\u76f8\u4f3c\u5ea6\u8ba1\u7b97\u64cd\u4f5c\u7b26\u53ef\u80fd\u88ab\u591a\u4e2a\u68c0\u7d22\u6a21\u5757\u5171\u4eab\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>Modular Rag \u4e3e\u4e2a\u4f8b\u5b50<\/strong><\/p>\n\n\n\n<p>1\u3001\u4ee3\u7801\u793a\u4f8b\uff0c\u4f7f\u7528haystack\u5b98\u65b9\u793a\u4f8b\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>Haystack\u662f\u4e00\u4e2a\u5f00\u6e90\u6846\u67b6\uff0c\u7528\u4e8e\u8fb9\u754c\u6784\u5efaLLM\u5e94\u7528\u7a0b\u5e8f\uff0c\u6846\u67b6\u6574\u4f53\u91c7\u7528\u201c\u8282\u70b9+\u6d41\u6c34\u7ebf\u201d\u67b6\u6784\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u901a\u8fc7\u81ea\u7531\u7ec4\u5408\u9884\u6784\u5efa\u7ec4\u4ef6\uff08\u5982\u68c0\u7d22\u5668\u3001\u751f\u6210\u5668\u3001\u8bc4\u4f30\u5668\uff09\u6784\u5efa\u5b9a\u5236\u5316\u7ba1\u9053\u5de5\u4f5c\u6d41\u3002<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>##################\n### 0. \u7ec4\u4ef6\u5b9a\u4e49 ###\n##################\nfrom haystack import Document, Pipeline\nfrom haystack.document_stores.in_memory import InMemoryDocumentStore\nfrom haystack.components.embedders import SentenceTransformersTextEmbedder\nfrom haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever\ndocument_store = InMemoryDocumentStore(embedding_similarity_function=\"cosine\")\ntext_embedder = SentenceTransformersTextEmbedder()\nretriever = InMemoryEmbeddingRetriever(document_store=document_store)\n##################\n### 1. \u6dfb\u52a0\u7ec4\u4ef6 ###\n##################\nquery_pipeline = Pipeline()\nquery_pipeline.add_component(\"component_name\", component_type)\n# Here is an example of how you'd add the components initialized in step 2 above:\nquery_pipeline.add_component(\"text_embedder\", text_embedder)\nquery_pipeline.add_component(\"retriever\", retriever)\n# You could also add components without initializing them before:\nquery_pipeline.add_component(\"text_embedder\", SentenceTransformersTextEmbedder())\nquery_pipeline.add_component(\"retriever\", InMemoryEmbeddingRetriever(document_store=document_store))\n##################\n### 2. \u8fde\u63a5\u7ec4\u4ef6 ###\n##################\n# This is the syntax to connect components. Here you're connecting output1 of component1 to input1 of component2:\npipeline.connect(\"component1.output1\", \"component2.input1\")\n# If both components have only one output and input, you can just pass their names:\npipeline.connect(\"component1\", \"component2\")\n# If one of the components has only one output but the other has multiple inputs,\n# you can pass just the name of the component with a single output, but for the component with\n# multiple inputs, you must specify which input you want to connect\n# Here, component1 has only one output, but component2 has mulitiple inputs:\npipeline.connect(\"component1\", \"component2.input1\")\n# And here's how it should look like for the semantic document search pipeline we're using as an example:\npipeline.connect(\"text_embedder.embedding\", \"retriever.query_embedding\")\n# Because the InMemoryEmbeddingRetriever only has one input, this is also correct:\npipeline.connect(\"text_embedder.embedding\", \"retriever\")<\/code><\/pre>\n\n\n\n<p>2\u3001\u53ef\u89c6\u5316\u793a\u4f8b\uff0c\u4f7f\u7528LangFlow\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic3.zhimg.com\/v2-38d821923d744f66087e8f830c514390_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Modular RAG\u4e0b\u7684RAG\u6d41<\/strong><\/p>\n\n\n\n<p><strong>\u5404\u4e2a\u6a21\u5757\u4e4b\u95f4\u7684\u534f\u4f5c\uff0c\u53ef\u4ee5\u6709\u7c7b\u4f3c\u4ee5\u4e0b\u7684\u5de5\u4f5c\u6d41\u6a21\u5f0f\u4e32\u8054<\/strong><\/p>\n\n\n\n<p><strong>1\u3001\u7ebf\u6027\u7f16\u6392(Linear Pattern)<\/strong><\/p>\n\n\n\n<p>\u6574\u4e2aRAG\u6d41\u7531\u5404\u4e2aModule\u7ebf\u6027\u4e32\u8054\u8d77\u6765\uff0c\u4e3a\u6700\u7b80\u5355\u7684\u6a21\u5f0f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pica.zhimg.com\/v2-3ba8d8bc40ede634703c7bfde5edfd9e_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>2\u3001\u6761\u4ef6\u7f16\u6392(Conditional Pattern)<\/strong><\/p>\n\n\n\n<p>RAG\u6d41\u4e2d\u4f1a\u6dfb\u52a0\u4e00\u4e9bRoute\u6761\u4ef6\u5224\u65ad\uff0c\u589e\u5f3a\u7cfb\u7edf\u7684\u7075\u6d3b\u6027\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic2.zhimg.com\/v2-f4abd44b9b7dc34f8b3836d49c3cb0ad_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>3\u3001\u5206\u652f(\u5e76\u884c)\u7f16\u6392(Branching)<\/strong><\/p>\n\n\n\n<p>RAG\u6d41\u4e2d\u5b58\u5728\u591a\u4e2a\u5e76\u884c\u7684\u5206\u652f\uff0c\u5404\u81ea\u5904\u7406\u540e\u968f\u4e4b\u5408\u5e76\u5230\u4e00\u8d77\uff0c\u8fd9\u79cd\u60c5\u51b5\u591a\u7528\u4e8e\u8981\u589e\u52a0\u751f\u6210\u7ed3\u679c\u7684\u591a\u6837\u6027\u800c\u5f15\u5165<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic1.zhimg.com\/v2-530c4b67d61227fc85f4582448591254_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>4\u3001\u5faa\u73af\u7f16\u6392(Loop Pattern)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/v2-4e52d63b37ddd00e6c21b4229749fa0b_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li><strong>Interative retrieval(\u5faa\u73af\u68c0\u7d22):&nbsp;<\/strong>\u5355\u6b21\u68c0\u7d22\u548c\u751f\u6210\u65e0\u6cd5\u6709\u6548\u89e3\u51b3\u9700\u8981\u5927\u91cf\u77e5\u8bc6\u7684\u590d\u6742\u95ee\u9898\uff0c\u6bcf\u6b21\u5faa\u73af\u540e\u4f1a\u628a\u5f53\u524dGenerate\u7684\u8f93\u51fa\u4f5c\u4e3a\u5339\u914d\u6e90\u518d\u53bb\u68c0\u7d22\u5185\u5bb9,\u76f4\u5230\u5faa\u73af\u7ed3\u675f\uff0c\u6574\u4f53\u7c7b\u4f3cHyDE\u68c0\u7d22\u589e\u5f3a\u65b9\u6cd5\u3002ITER-RETGEN\u662f\u4e00\u79cd\u5b9e\u73b0\u5faa\u73af\u68c0\u7d22\u7684\u67b6\u6784\u3002<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>\u6838\u5fc3: \u5728\u6bcf\u6b21\u8fed\u4ee3\u4e2d\uff0cITER-RETGEN \u5229\u7528\u4e0a\u4e00\u6b21\u8fed\u4ee3\u7684\u6a21\u578b\u8f93\u51fa\u4f5c\u4e3a\u7279\u5b9a\u4e0a\u4e0b\u6587\u6765\u5e2e\u52a9\u68c0\u7d22\u66f4\u591a\u76f8\u5173\u77e5\u8bc6\u3002<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic3.zhimg.com\/v2-07eb65cce39086c810fc4cbbd2571d1a_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>HyDE(Hypothetical Document Embeddings), \u5373\u9884\u5148\u8ba9LLM\u751f\u6210\u7528\u6237\u95ee\u9898\u7684\u7b54\u6848\uff0c\u7136\u540e\u518d\u7528\u7b54\u6848\u53bb\u77e5\u8bc6\u5e93\u68c0\u7d22\u66f4\u5927\u8303\u56f4\u5185\u7684\u5185\u5bb9\uff0c\u5373\u63d0\u5347query\u7684\u6cdb\u5316\u6027<br>\u5982: query: \u5982\u4f55\u63d0\u9ad8\u7761\u7720\u8d28\u91cf, \u4f46\u77e5\u8bc6\u5e93\u4e3a\u201c\u4e0d\u559d\u5496\u5561\uff0c\u7761\u524d\u4e0d\u73a9\u624b\u673a\u7b49\u201d\u5185\u5bb9\uff0c\u6b64\u65f6\u53ef\u4ee5\u7528LLM\u5148\u751f\u6210\u7b80\u5355\u7684\u7b54\u6848\uff0c\u53ef\u80fd\u672a\u201c\u63d0\u5347\u7761\u7720\u8d28\u91cf\u8981\u907f\u514d\u5496\u5561\u56e0\u548c\u7535\u5b50\u8bbe\u5907\u7b49\u2026\u201d\uff0c\u6b64\u65f6\u53ef\u4ee5\u68c0\u7d22\u5230\u5bf9\u5e94\u6587\u6863<\/p>\n<\/blockquote>\n\n\n\n<ul>\n<li><strong>rescursive retrieval(\u9012\u5f52\u68c0\u7d22):&nbsp;<\/strong>\u4e0e\u5faa\u73af\u68c0\u7d22\u7c7b\u4f3c\uff0c\u4f46\u66f4\u660e\u786e\u7684\u6307\u51fa\u4f9d\u8d56\u524d\u4e00\u6b65\u7684\u5404\u4e2a\u5185\u5bb9\uff08\u5982\u5229\u7528\u4e0a\u4e00\u6b21\u7684query\u6539\u5199\u5185\u5bb9\uff09\uff0c\u4e0d\u65ad\u6df1\u5316\u68c0\u7d22\uff0c\u4e0d\u65ad\u660e\u786e\u7528\u6237\u67e5\u8be2\uff08\u6d88\u9664\u6b67\u4e49\uff09\uff0c\u6709\u66f4\u660e\u786e\u7684\u9000\u51fa\u5faa\u73af\u7684\u6761\u4ef6\u3002TOC RAG\u6d41\u662f\u4e00\u79cd\u5b9e\u73b0\uff0c\u5173\u952e\u5728Tree of Clarification\u4e2d\uff0c\u901a\u8fc7\u6f84\u6e05\u6811\u7ed3\u6784\uff0c\u5728\u4e0d\u65ad\u8fed\u4ee3\u4e2d\u6d88\u9664\u7528\u6237\u8f93\u5165\u7684\u6b67\u4e49\u3002<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p><strong>\u6f84\u6e05\u6811: \u5f53\u521d\u59cb\u67e5\u8be2\u4e0d\u660e\u786e\u65f6\uff0c\u901a\u8fc7\u9012\u5f52\u8fed\u4ee3\u4e0d\u65ad\u751f\u6210\u591a\u5c42\u5b50\u95ee\u9898\u3002<\/strong><br><strong>\u6bcf\u6b21\u8fed\u4ee3\u68c0\u7d22\uff0c\u4f1a\u57fa\u4e8e\u4e0a\u4e00\u6b21\u8fed\u4ee3\u7684\u8f93\u5165\uff0c\u68c0\u7d22\u7ed3\u679c\u548c\u751f\u6210\u5185\u5bb9\uff0c\u91cd\u65b0\u6587\u6863rerank\uff0c\u751f\u6210\u65b0\u7684\u8282\u70b9\u63d2\u5165\u5230\u6811\u4e2d\uff0c\u8fbe\u5230\u4e00\u5b9a\u6df1\u5ea6\u6216\u8005\u8282\u70b9\u6811\u540e\u5408\u5e76\u6210\u4e00\u4e2a\u5168\u9762\u7684\u7b54\u6848\u3002<\/strong><\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/picx.zhimg.com\/v2-b12c7078eb408d5cf920f3e136864c7f_1440w.jpg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">TOC RAG\u6d41\uff0c\u4e00\u79cdrescursive retrieval\u7684\u5b9e\u73b0<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic2.zhimg.com\/v2-2726d3980486733ee38c062ea97ef293_1440w.jpg\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Tree of Clarification<\/figcaption><\/figure>\n\n\n\n<p><strong>Interative\u548crescursive\u7684\u6bd4\u8f83:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u7ef4\u5ea6<\/td><td>Interative<\/td><td>rescursive<\/td><\/tr><tr><td>\u6838\u5fc3<\/td><td>\u5728\u68c0\u7d22\u548c\u751f\u6210\u4e4b\u95f4\u4ea4\u66ff\u6267\u884c\uff0c\u591a\u6b21\u5faa\u73af\u9010\u6b65\u8fed\u4ee3\u51fa\u66f4\u4f18\u7ed3\u679c<\/td><td>\u4e0d\u65ad\u5c06\u590d\u6742\u95ee\u9898\u62c6\u89e3\u6210\u7b80\u5355\u5b50\u95ee\u9898\uff0c\u5e76\u9010\u5c42\u6574\u5408\u5b50\u7b54\u6848\u751f\u6210\u6700\u7ec8\u7ed3\u679c<\/td><\/tr><tr><td>\u573a\u666f<\/td><td>\u9700\u8981\u9010\u6b65\u7ec6\u5316\u7b54\u6848\u7684\u5f00\u653e\u6027\u95ee\u9898\uff08\u5982\u6a21\u7cca\u67e5\u8be2\u3001\u591a\u610f\u56fe\u6df7\u5408\u95ee\u9898\uff09<\/td><td>\u9700\u591a\u8df3\u63a8\u7406\u7684\u590d\u6742\u95ee\u9898\uff08\u5982\u6280\u672f\u6587\u6863\u5206\u6790\u3001\u6cd5\u5f8b\u6761\u6b3e\u8ffd\u6eaf\uff09<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul>\n<li><strong>Adaptive retrieval(\u81ea\u9002\u5e94\u68c0\u7d22)<\/strong>: \u5f15\u5165LLM Agent\u6982\u5ff5\uff0c\u5728\u7cfb\u7edf\u5173\u952e\u73af\u8282\u4f7f\u7528LLM\u5224\u65ad\u662f\u5426\u5e94\u8be5\u600e\u4e48\u884c\u52a8\u3002\u5982\u53ef\u4ee5\u5728pre-retrieval\u73af\u8282\u4f7f\u7528LLM\u5224\u65ad\u662f\u5426\u9700\u8981\u53bb\u68c0\u7d22\u5916\u90e8\u77e5\u8bc6.\u540cAdaptive Agentic RAG<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic3.zhimg.com\/v2-328a317f2a697e18f36096634efdbd28_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/picx.zhimg.com\/v2-4958dae9e1276012a4500275bfe71aef_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li><strong>tuning\u6a21\u5f0f<\/strong><br>RAG\u7cfb\u7edf\u5728\u5404\u4e2aModule\u90fd\u53ef\u80fd\u4f7f\u7528\u4e86LLM\u6280\u672f\uff0c\u4f7f\u7528\u6570\u636e\u5fae\u8c03\u4ee5\u4f18\u5316\u5404\u4e2aLLM\u7ec4\u4ef6\u7684\u8868\u73b0\uff0c\u5305\u62ec\n<ul>\n<li>retriever fine-tuning: \u68c0\u7d22\u5668\u5fae\u8c03<\/li>\n\n\n\n<li>generator fine-tuning: \u751f\u6210\u5668\u5fae\u8c03<\/li>\n\n\n\n<li>dual fine-tuning: \u5373\u68c0\u7d22\u5668+\u751f\u6210\u5668\u5fae\u8c03<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h_1946578410617930310_7\"><span class=\"ez-toc-section\" id=\"24_Agentic_RAG\"><\/span>2.4 Agentic RAG<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>2.4.1 \u6765\u6e90<\/strong><\/p>\n\n\n\n<p>\u6700\u65e9Chidaksh Ravuru \u7b49\u4eba\u4e8e 2024 \u5e74 8 \u6708 18 \u65e5\u5728 arXiv \u4e0a\u53d1\u8868\u7684\u8bba\u6587\u300aAgentic Retrieval-Augmented Generation for Time Series Analysis\u300b\u4e2d\u6b63\u5f0f\u63d0\u51fa\u3002 \u63d0\u51fa\u52a8\u56e0\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>\u591a\u5c42\u6b21\u4f9d\u8d56\u96be\u4ee5\u6355\u6349\uff1a<\/strong>\u4f20\u7edf RAG \u5c06\u68c0\u7d22\u548c\u751f\u6210\u89c6\u4e3a\u7ebf\u6027\u6d41\u6c34\u7ebf\uff0c\u5bf9\u4e8e\u5177\u6709\u5b63\u8282\u6027\u3001\u8d8b\u52bf\u6027\u53ca\u7a81\u53d1\u4e8b\u4ef6\u7684\u65f6\u5e8f\u6570\u636e\uff0c\u5355\u4e00\u5411\u91cf\u68c0\u7d22\u5668\u96be\u4ee5\u517c\u987e\u5404\u7c7b\u6a21\u5f0f\uff0c\u5bfc\u81f4\u9884\u6d4b\u51c6\u786e\u6027\u4e0d\u8db3\u3002<\/li>\n\n\n\n<li><strong>\u5206\u5e03\u6f02\u79fb\u4e0e\u6a21\u578b\u5931\u6548\uff1a<\/strong>\u5386\u53f2\u8bad\u7ec3\u6570\u636e\u4e0e\u5b9e\u65f6\u6570\u636e\u5206\u5e03\u5e38\u51fa\u73b0\u504f\u5dee\uff0c\u82e5\u4f9d\u8d56\u9759\u6001\u6587\u6863\u5e93\uff0c\u5bb9\u6613\u9677\u5165\u201c\u4fe1\u606f\u5b64\u5c9b\u201d\uff0c\u964d\u4f4e\u65f6\u5e8f\u5206\u6790\u7684\u53ef\u9760\u6027\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5bf9\u6bd4\u4f20\u7edfRAG, Agentic RAG\u5c06\u80fd\u529b\u4f9d\u6258\u4e8e\u667a\u80fd\u4f53\uff0c\u63d0\u5347\u4e86RAG\u7cfb\u7edf\u7684\u7075\u6d3b\u6027\u53ca\u6269\u5c55\u5176\u5e94\u7528\u8fb9\u754c\u3002<\/p>\n\n\n\n<p><strong>2.4.2 \u4ecb\u7ecd<\/strong><\/p>\n\n\n\n<p><strong>Agentic RAG\uff1a<\/strong>\u67b6\u6784\u4e0a\u5f15\u5165Agent\u7684\u601d\u8def\uff0c\u5b9e\u73b0\u52a8\u6001\u51b3\u7b56\uff08\u5982\u662f\u5426\u68c0\u7d22\u3001\u5de5\u5177\u8c03\u7528\uff09\u548c\u591a\u8f6e\u8fed\u4ee3\u4f18\u5316\u3002\u76f8\u6bd4\u4e0a\u8ff0\u63d0\u5230\u7684\u51e0\u79cdRAG\uff0cAgentic RAG\u5c06\u5b9e\u9645\u8f93\u5165\u5904\u7406\u7684\u591a\u6837\u6027\u4ea4\u7ed9LLM\u5904\u7406\uff0c\u53ef\u4ee5\u89e3\u51b3\u66f4\u590d\u6742\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<p>Agent\u7684\u6838\u5fc3\u90e8\u4ef6\uff1a<strong>LLM + Memory + Planning + Tools<\/strong><\/p>\n\n\n\n<p><strong>\u5982\u4f55\u8fd0\u4f5c?<\/strong><\/p>\n\n\n\n<p>\u4eceModular RAG\u7684\u67b6\u6784\u6765\u770b\uff0c\u53ea\u8981\u662f\u6d89\u53caLLM\u7684\u6a21\u5757\u7406\u8bba\u4e0a\u90fd\u53ef\u4ee5\u4f7f\u7528Agent\u6765\u589e\u5f3a\uff0c\u4f46\u5728\u8be5Agentic RAG\u67b6\u6784\u4e2d\u66f4\u591a\u5f3a\u8c03\u7684\u662f\u5728retrievel\u6a21\u5757\u4e2d\u4f7f\u7528\u3002 \u5728\u68c0\u7d22\u9636\u6bb5\uff0c\u4e0d\u540c\u6570\u636e\u6e90\u53ef\u4ee5\u89c6\u4f5c\u4e0d\u540c\u7684tool\uff0c\u7136\u540e\u7531\u68c0\u7d22Agent\u96c6\u6210\u8fd9\u4e9btool\u52a8\u6001\u68c0\u7d22\u5185\u5bb9<\/p>\n\n\n\n<p><strong>\u4e00\u4e9bAgent Agentic RAG\u67b6\u6784<\/strong><\/p>\n\n\n\n<ul>\n<li><strong>Single-Agent Agentic RAG<\/strong><br>\u8be5\u6846\u67b6\u6838\u5fc3\u662f\u4e00\u4e2a\u7cfb\u7edf\u51b3\u7b56\u4e2d\u5fc3\u7684Router Agent\uff0c\u8be5Agent\u52a8\u6001\u5904\u7406\u4fe1\u606f\u68c0\u7d22\uff0c\u96c6\u6210\u64cd\u4f5c\uff0c\u7c7b\u4f3c\u4e0a\u8ff0Modular RAG\u4e2d\u63d0\u5230\u7684\u6761\u4ef6\u7f16\u6392\u7684Agent\u4ee3\u7406\u7248\u672c\uff0c\u6bd4\u8f83\u9002\u7528\u4e8e\u591a\u68c0\u7d22\u6e90\u7684\u7b80\u5355\u95ee\u7b54\u573a\u666f\u3002<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/picx.zhimg.com\/v2-47a6d00bdb18cb6e22c7fac6c3fb8f7f_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>Multi-Agent Agentic RAG<\/strong><\/p>\n\n\n\n<p>\u4e3aSingle-Agent Agentic RAG\u67b6\u6784\u7684\u6f14\u8fdb\u7248\u672c\uff0c\u7528\u591a\u4e2a\u4e13\u7528\u4ee3\u7406\u6765\u7ec6\u5316\u66f4\u590d\u6742\u7684\u5de5\u4f5c\u6d41\u548c\u4e0d\u540c\u7684\u67e5\u8be2\u7c7b\u578b\u3002\u6838\u5fc3Router Agent\u4e0b\u53c8\u6302\u63a5\u4e86\u591a\u4e2a\u68c0\u7d22Agent, \u5982Agent1\u7528\u4e8e\u67e5\u8be2\u7ed3\u6784\u5316\u6570\u636e(Mysql)\uff0cAgent2\u7528\u4e8e\u67e5\u8be2\u975e\u7ed3\u6784\u5316\u6570\u636e\uff0cAgent3\u7528\u4e8eWeb\u67e5\u8be2\u6216\u4e13\u7528API\u67e5\u8be2\u7b49\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/v2-f1c2e5009f0d27429cd05782bf4c057f_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li><strong>Hierarchical Agentic RAG<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u5206\u5c42\u4ee3\u7406RAG\uff0c\u4e3aMulti-Agent Agentic RAG\u67b6\u6784\u7684\u62d3\u5c55\uff0c\u5c06\u6574\u4e2a\u7cfb\u7edf\u5206\u4e3a\u591a\u4e2a\u5c42\u7ea7\u7684Agent\uff0c\u7531\u9876\u7ea7Agent\u9a71\u52a8\u5b50Agent\uff0c\u5e76\u805a\u5408\u5b50Agent\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/v2-90f873e4d83488b16cecad075a4111b1_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li><strong>Agentic Corrective RAG<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Corrective RAG\u7684\u6838\u5fc3\u662f\u4ed6\u53ef\u4ee5\u52a8\u6001\u8bc4\u4f30\u68c0\u7d22\u5230\u7684\u6587\u6863\u5e76\u7ea0\u6b63\u67e5\u8be2\uff0c\u63d0\u5347\u68c0\u7d22\u6587\u6863\u7684\u8d28\u91cf\u3002<\/p>\n\n\n\n<p>Agentic Corrective RAG\u7cfb\u7edf\u5efa\u7acb\u57285\u4e2a\u5173\u952eAgent\u4e0a\u3002<\/p>\n\n\n\n<ol>\n<li><strong>Context Retrieval Agent:<\/strong>&nbsp;\u8d1f\u8d23\u4ece\u6570\u636e\u5e93\u4e2d\u68c0\u7d22\u76f8\u5173\u4e0a\u4e0b\u6587\u3002<\/li>\n\n\n\n<li><strong>Relevance Evaluation Agent:&nbsp;<\/strong>\u8d1f\u8d23\u8bc4\u4f30\u68c0\u7d22\u5230\u7684\u6587\u6863\u7684\u76f8\u5173\u6027\uff0c\u5e76\u6807\u8bb0\u51fa\u4e0d\u76f8\u5173\u6216\u4e0d\u660e\u786e\u6587\u6863\u5e76\u91c7\u53d6\u7ea0\u6b63\u63aa\u65bd\u3002<\/li>\n\n\n\n<li><strong>Query Refinement Agent:&nbsp;<\/strong>\u91cd\u5199query\u589e\u5f3a\u68c0\u7d22\u7684Agent\u3002<\/li>\n\n\n\n<li><strong>External Knowledge Retrieval Agent:&nbsp;<\/strong>\u5f53Context Retrieval Agent\u68c0\u7d22\u7684\u4e0a\u4e0b\u6587\u4e0d\u8db3\u65f6\uff0c\u4ece\u5176\u4ed6\u5907\u7528\u6570\u636e\u6e90\u68c0\u7d22\u6570\u636e(\u5982Web \u68c0\u7d22)\u3002<\/li>\n\n\n\n<li><strong>Response Synthesis Agent:&nbsp;<\/strong>\u7ec4\u7ec7\u54cd\u5e94Agent\u3002<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pica.zhimg.com\/v2-8c5ec7ddccf2afe3a1633452dc367ee2_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li><strong>Adaptive Agentic RAG<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u81ea\u9002\u5e94Agent RAG, \u4e0e\u4e0a\u8ff0Modular RAG\u4e2d\u7684Adaptive retrieval\u4e00\u6837\uff0c\u8bed\u4e49\u4e0a\u90fd\u662f\u5728\u5404\u4e2a\u73af\u8282\u5f15\u5165\u4e86LLM\u5224\u65ad\uff0c\u5e76\u5728\u5f15\u5165LLM\u8bc4\u6d4b\u5b9e\u73b0Loop\u81ea\u8fed\u4ee3\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic1.zhimg.com\/v2-2f130b4dfa8bf0b0a55bc70eb2a6311a_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<ul>\n<li><strong>Graph-Based Agentic RAG<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Graph-Based Agentic RAG\u5728\u68c0\u7d22\u4e2d\u5f15\u5165\u4e86\u56fe\u68c0\u7d22\uff0c\u5408\u5e76\u56fe\u6570\u636e\u53ca\u5176\u4ed6\u68c0\u7d22\u6570\u636e\u589e\u5f3a\u68c0\u7d22\u6548\u679c<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/pic4.zhimg.com\/v2-13526b23db1510d6b1e86091bc5e631f_1440w.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h_1946578410617930310_8\"><span class=\"ez-toc-section\" id=\"%E6%80%BB%E7%BB%93\"><\/span><strong>\u603b\u7ed3<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u67b6\u6784<\/th><th>\u63d0\u51fa\u52a8\u56e0<\/th><th>\u4e3b\u8981\u7279\u70b9<\/th><\/tr><tr><td>\u200bNaive RAG\u200b<\/td><td>LLM \u5bb9\u6613\u201c\u5e7b\u89c9\u201d\uff0c\u53c2\u6570\u5316\u77e5\u8bc6\u96be\u66f4\u65b0\uff1b\u9700\u5916\u90e8\u68c0\u7d22\u8865\u5145\u77e5\u8bc6\u5e76\u63d0\u4f9b\u53ef\u8ffd\u6eaf\u7684\u8bc1\u636e\u3002<\/td><td>&#8211; \u4e09\u6b65\u6d41\u7a0b\uff1a\u6587\u6863\u5207\u5757 \u2192 \u5411\u91cf\u68c0\u7d22 \u2192 \u62fc\u63a5\u63d0\u793a\u751f\u6210- \u4e00\u4f53\u5316\u7aef\u5230\u7aef\u5fae\u8c03\uff08RAG-Sequence &amp; RAG-Token\uff09- \u51cf\u5c11\u53c2\u6570\u5316\u6a21\u578b\u7684\u5e7b\u89c9\uff0c\u63d0\u5347\u5f00\u653e\u57df QA \u51c6\u786e\u7387<\/td><\/tr><tr><td>\u200bAdvanced RAG\u200b<\/td><td>\u7528\u6237\u67e5\u8be2\u4e0e\u77e5\u8bc6\u5e93\u8bed\u4e49\u4e0d\u5bf9\u9f50\uff1bNaive RAG \u68c0\u7d22\u566a\u58f0\u591a\u3001\u751f\u6210\u8d28\u91cf\u6709\u9650\u3002<\/td><td>&#8211; \u9884\u68c0\u7d22(Pre Retrieval)\uff1a\u67e5\u8be2\u91cd\u5199\/\u6269\u5c55 (Rewrite)- \u68c0\u7d22(Retrieval)\uff1a\u8bed\u4e49\u5411\u91cf\u68c0\u7d22- \u540e\u68c0\u7d22(Post Retrieval)\uff1a\u7ed3\u679c\u91cd\u6392\u5e8f\u3001\u6458\u8981\u538b\u7f29<\/td><\/tr><tr><td>\u200bModular RAG\u200b<\/td><td>\u968f\u7740\u68c0\u7d22\u5668\u3001LLM \u7b49\u7ec4\u4ef6\u98de\u901f\u8fed\u4ee3\uff0c\u4f20\u7edf\u7ba1\u9053\u96be\u5feb\u901f\u96c6\u6210\u65b0\u529f\u80fd\u3001\u7ef4\u62a4\u6210\u672c\u9ad8\u3002<\/td><td>&#8211; \u4e03\u5927\u6a21\u5757: Indexing, Pre Retrieval, Retrievel, Post Retrievel, Memory, Generation, Orchestration- \u5c06\u68c0\u7d22\u3001\u91cd\u6392\u5e8f\u3001\u538b\u7f29\u3001\u751f\u6210\u7b49\u62c6\u5206\u4e3a\u53ef\u63d2\u62d4\u6a21\u5757- \u5f15\u5165\u8def\u7531\u3001\u8c03\u5ea6\u3001\u878d\u5408\u7b97\u5b50- \u6a21\u5757\u5316\u8bbe\u8ba1\uff0c\u7075\u6d3b\u6269\u5c55\uff0c\u652f\u6301\u591a\u79cd RAG \u6a21\u5f0f\uff08\u7ebf\u6027\u3001\u6761\u4ef6\u3001\u5206\u652f\u3001\u5faa\u73af\uff09<\/td><\/tr><tr><td>\u200bAgentic RAG\u200b<\/td><td>\u9700\u5904\u7406\u590d\u6742\u591a\u6b65\u4efb\u52a1\u3001\u591a\u8f6e\u51b3\u7b56\uff0c\u5355\u8f6e\u9759\u6001\u6d41\u7a0b\u4e0d\u591f\uff1b\u5e0c\u671b\u7ed3\u5408\u68c0\u7d22\u4e0e\u89c4\u5212\u80fd\u529b\u3002<\/td><td>&#8211; \u591a\u667a\u80fd\u4f53\u67b6\u6784\uff1a\u4e3b\u667a\u80fd\u4f53\u534f\u8c03\u5b50\u667a\u80fd\u4f53- \u52a8\u6001\u51b3\u7b56\uff1a\u81ea\u4e3b\u5224\u65ad\u4f55\u65f6\u68c0\u7d22\u3001\u4f55\u65f6\u751f\u6210- \u652f\u6301\u591a\u8f6e\u8fed\u4ee3\u3001\u4efb\u52a1\u81ea\u6821\u6b63\uff0c\u63d0\u9ad8\u590d\u6742\u4efb\u52a1\u7684\u9002\u5e94\u6027\u4e0e\u9c81\u68d2\u6027<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h_1946578410617930310_9\"><span class=\"ez-toc-section\" id=\"%E4%B8%80%E4%BA%9B%E6%80%9D%E8%80%83\"><\/span><strong>\u4e00\u4e9b\u601d\u8003<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><strong>Generation\u6a21\u5757(LLM\u56de\u7b54)\u7684\u524d\u540e\u5904\u7406<\/strong><br>\u5728Advanced RAG\u4e2d\uff0c\u4e3a\u4e86\u63d0\u5347\u6700\u7ec8\u56de\u7b54\u6548\u679c\u4ece\u800c\u5f15\u5165\u4e86Pre-Retrieval\u548cPost-Retrieval\u4e24\u4e2a\u6d41\u7a0b\uff0c\u6216\u5bf9\u56de\u7b54LLM\u8fdb\u884c\u5fae\u8c03\u3002\u4ece \u201cgarbage in garbage out\u201d\u7406\u8bba\u6765\u770b\uff0c\u5b9e\u9645\u843d\u5730\u65f6\uff0c\u9700\u8981\u5145\u5206\u8003\u8651\u4e1a\u52a1\u5c5e\u6027\uff0c\u63d0\u5347\u8f93\u5165LLM\u7684\u6570\u636e\u8d28\u91cf\u3002<\/li>\n\n\n\n<li><strong>RAG\u7cfb\u7edf\u8bbe\u8ba1\u7684\u6a21\u5757\u5316&amp;\u53ef\u63d2\u62d4<\/strong><br>\u7531\u4e8eRAG\u7cfb\u7edf\u7684\u4e0d\u786e\u5b9a\u6027\uff08\u5f15\u5165LLM\uff09\uff0c\u5728\u6784\u5efa\u81ea\u5df1\u7684RAG\u7cfb\u7edf\u65f6\uff0c\u53ef\u53c2\u8003Modular RAG\u601d\u7ef4\u4f7f\u7528\u6a21\u5757\u5316\u8bbe\u8ba1\uff0c\u4fbf\u4e8e\u5feb\u901f\u5207\u6362\u67d0\u73af\u8282\u4e2d\u7684Module\u540e\u9a8c\u8bc1\u6574\u4f53\u7cfb\u7edf\u6548\u679c\u3002<\/li>\n\n\n\n<li><strong>Agent\u7684\u4e0d\u7a33\u5b9a\uff0c\u5b9e\u9645\u4e1a\u52a1\u843d\u5730\u5b58\u5728\u4e0d\u786e\u5b9a\u6027<\/strong><br>\u5f53\u524d\u7531\u4e8e\u6a21\u578b\u80fd\u529b\u7684\u74f6\u9888\uff0cAgent\u7cfb\u7edf\u5b58\u5728\u6781\u5927\u7684\u4e0d\u786e\u5b9a\u6027\uff0c\u5728Agentic RAG\u7cfb\u7edf\u4e2d\uff0c\u5728\u5927\u7684\u5c42\u9762\u5f15\u5165Agent\u5bf9\u5b9e\u9645\u4e1a\u52a1\u843d\u5730\u4e0d\u592a\u53ef\u53d6\uff0c\u53ef\u8003\u8651\u5728\u67d0\u4e2a\u5c0f\u73af\u8282\u4e2d\u5f15\u5165\uff0c\u5982Generation\u95ee\u7b54\u8865\u5145\uff08\u5728\u57fa\u4e8e\u68c0\u7d22\u51fa\u7684\u6587\u6863\u540e\uff0c\u52a8\u6001\u7ed9\u5b9a\u4e00\u4e9btools\u8ba9\u5176\u4f18\u5316\u56de\u7b54\u6548\u679c\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h_1946578410617930310_10\"><span class=\"ez-toc-section\" id=\"Reference\"><\/span>Reference<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul>\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/en.wikipedia.org\/wiki\/Retrieval-augmented_generation\" target=\"_blank\" rel=\"noreferrer noopener\">en.wikipedia.org\/wik&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/aws.amazon.com\/cn\/what-is\/retrieval-augmented-generation\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u4ec0\u4e48\u662f RAG\uff1f\u2014 \u68c0\u7d22\u589e\u5f3a\u751f\u6210 AI \u8be6\u89e3 \u2014 AWS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/arxiv.org\/pdf\/2312.10997\" target=\"_blank\" rel=\"noreferrer noopener\">arxiv.org\/pdf\/2312.1&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/arxiv.org\/pdf\/2407.21059\" target=\"_blank\" rel=\"noreferrer noopener\">arxiv.org\/pdf\/2407.2&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/arxiv.org\/pdf\/2310.14696\" target=\"_blank\" rel=\"noreferrer noopener\">arxiv.org\/pdf\/2310.1&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/arxiv.org\/abs\/2501.09136\" target=\"_blank\" rel=\"noreferrer noopener\">[2501.09136] Agentic Retrieval-Augmented Generation: A Survey on Agentic RAG<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/medium.com\/%40OpenRAG\/modular-rag-and-rag-flow-part-%25E2%2585%25B0-e69b32dc13a3\" target=\"_blank\" rel=\"noreferrer noopener\">medium.com\/@OpenRAG\/&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/medium.com\/%40OpenRAG\/modular-rag-and-rag-flow-part-ii-77b62bf8a5d3\" target=\"_blank\" rel=\"noreferrer noopener\">medium.com\/@OpenRAG\/&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/medium.com\/data-science\/implementing-modular-rag-with-haystack-and-hypster-d2f0ecc88b8f\" target=\"_blank\" rel=\"noreferrer noopener\">medium.com\/data-scie&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/docs.haystack.deepset.ai\/reference\/routers-api\" target=\"_blank\" rel=\"noreferrer noopener\">docs.haystack.deepse&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/github.com\/gilad-rubin\/modular-rag\" target=\"_blank\" rel=\"noreferrer noopener\">github.com\/gilad-rub&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/arxiv.org\/pdf\/2501.09136\" target=\"_blank\" rel=\"noreferrer noopener\">arxiv.org\/pdf\/2501.0&#8230;<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/link.zhihu.com\/?target=https%3A\/\/weaviate.io\/blog\/what-is-agentic-rag\" target=\"_blank\" rel=\"noreferrer noopener\">What is Agentic RAG | Weaviate<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5bfc\u8bed\uff1a\u672c\u6587\u7cfb\u7edf\u68b3\u7406\u4e86\u68c0\u7d22\u589e\u5f3a\u751f\u6210\uff08RAG\uff09\u67b6\u6784\u7684\u6f14\u8fdb\u5386\u7a0b\uff0c\u4ece\u57fa\u7840\u67b6\u6784\u5230\u667a\u80fd\u5316\u89e3\u51b3\u65b9\u6848\u7684\u8fed\u4ee3\u8def\u5f84\u3002\u6587\u7ae0&hellip; <a href=\"http:\/\/viplao.com\/index.php\/2025\/12\/18\/rag%e6%9e%b6%e6%9e%84%e6%bc%94%e8%bf%9b%e6%a2%b3%e7%90%86\/\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">RAG\u67b6\u6784\u6f14\u8fdb\u68b3\u7406<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[38,10],"views":852,"_links":{"self":[{"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/posts\/4150"}],"collection":[{"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/comments?post=4150"}],"version-history":[{"count":1,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/posts\/4150\/revisions"}],"predecessor-version":[{"id":4151,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/posts\/4150\/revisions\/4151"}],"wp:attachment":[{"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/media?parent=4150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/categories?post=4150"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/viplao.com\/index.php\/wp-json\/wp\/v2\/tags?post=4150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}