{"id":101959,"date":"2026-09-07T22:09:19","date_gmt":"2026-09-07T14:09:19","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/101959.html"},"modified":"2026-09-07T22:09:19","modified_gmt":"2026-09-07T14:09:19","slug":"%e3%80%90llmai%e5%ba%94%e7%94%a8%e5%bc%80%e5%8f%91-%e5%85%ab%e8%82%a1%e6%96%87%e3%80%91-3-1-rag%e6%a3%80%e7%b4%a2%e5%a2%9e%e5%bc%ba%ef%bc%88%e4%b8%8a%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/101959.html","title":{"rendered":"\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011--3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09"},"content":{"rendered":"<p id=\"\u4e3a\u4ec0\u4e48\u6709\u4e86\u5927\u6a21\u578b\u8fd8\u9700\u8981rag-\u5e7b\u89c9\u3001\u79c1\u6709\u77e5\u8bc6\u3001\u65f6\u6548\u6027\u56db\u5927\u95ee\u9898\">\u4e3a\u4ec0\u4e48\u6709\u4e86\u5927\u6a21\u578b\u8fd8\u9700\u8981RAG&#xff1f;\u5e7b\u89c9\u3001\u79c1\u6709\u77e5\u8bc6\u3001\u65f6\u6548\u6027\u56db\u5927\u95ee\u9898<\/p>\n<p>\u5047\u8bbe\u4f60\u4eec\u516c\u53f8\u6709\u51e0\u5343\u4efd\u5185\u90e8\u6587\u6863&#xff1a;\u4ea7\u54c1\u624b\u518c\u3001\u64cd\u4f5c\u89c4\u8303\u3001\u5386\u53f2\u9879\u76ee\u7ecf\u9a8c\u3001\u5ba2\u6237\u5408\u540c\u2026\u2026\u9886\u5bfc\u60f3\u505a\u4e00\u4e2a AI \u95ee\u7b54\u7cfb\u7edf&#xff0c;\u8ba9\u5458\u5de5\u968f\u65f6\u53ef\u4ee5\u95ee&#034;\u6211\u4eec\u7684\u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48&#034;\u3001&#034;\u8fd9\u4e2a\u5ba2\u6237\u7b7e\u4e86\u54ea\u4e9b\u6761\u6b3e&#034;&#xff0c;\u7cfb\u7edf\u80fd\u76f4\u63a5\u7ed9\u51fa\u51c6\u786e\u7b54\u6848\u3002<\/p>\n<p>\u4f60\u76f4\u63a5\u7528\u5927\u6a21\u578b\u6765\u505a&#xff0c;\u7b2c\u4e00\u8f6e\u6d4b\u8bd5\u6548\u679c\u8fd8\u4e0d\u9519\u2014\u2014\u4f46\u5f88\u5feb\u53d1\u73b0\u51e0\u4e2a\u7ed5\u4e0d\u5f00\u7684\u95ee\u9898&#xff1a;<\/p>\n<ul>\n<li>\u6a21\u578b\u5bf9\u516c\u53f8\u5185\u90e8\u6587\u6863\u4e00\u65e0\u6240\u77e5&#xff0c;\u56de\u7b54\u5168\u9760&#034;\u7f16&#034;<\/li>\n<li>\u4ea7\u54c1\u6587\u6863\u4e0a\u5468\u521a\u66f4\u65b0&#xff0c;\u4f46\u6a21\u578b\u8bf4\u7684\u8fd8\u662f\u8001\u7248\u672c\u7684\u5185\u5bb9<\/li>\n<li>\u6a21\u578b\u56de\u7b54\u7684\u5f88\u6d41\u7545&#xff0c;\u4f46\u6839\u672c\u65e0\u6cd5\u77e5\u9053\u5b83\u8bf4\u7684\u662f\u771f\u662f\u5047&#xff0c;\u4e5f\u65e0\u6cd5\u8ffd\u6eaf\u6765\u6e90<\/li>\n<li>\u6587\u6863\u52a0\u8f7d\u5230 Prompt \u91cc&#xff0c;token \u6210\u672c\u9ad8\u5230\u65e0\u6cd5\u63a5\u53d7<\/li>\n<\/ul>\n<p>\u8fd9\u4e0d\u662f\u6a21\u578b\u80fd\u529b\u4e0d\u591f\u7684\u95ee\u9898&#xff0c;\u800c\u662f\u5927\u6a21\u578b\u4f5c\u4e3a\u4e00\u79cd\u6280\u672f&#xff0c;\u6709\u51e0\u4e2a\u6839\u672c\u6027\u7684\u5929\u82b1\u677f\u2014\u2014\u800c RAG \u5c31\u662f\u4e3a\u4e86\u7a81\u7834\u8fd9\u4e9b\u5929\u82b1\u677f\u800c\u8bde\u751f\u7684\u3002<\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"1.RAG--%E5%AE%9A%E4%B9%89-toc\" style=\"margin-left:0px\">1.RAG&#8211;\u5b9a\u4e49<\/p>\n<p id=\"1.1.%E9%80%82%E5%90%88%E7%9A%84%E5%9C%BA%E6%99%AF-toc\" style=\"margin-left:40px\">1.1.\u9002\u5408\u7684\u573a\u666f<\/p>\n<p id=\"1.2.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE-toc\" style=\"margin-left:40px\">1.2.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/p>\n<p id=\"2.RAG--%E5%AE%8C%E6%95%B4%E9%93%BE%E8%B7%AF-toc\" style=\"margin-left:0px\">2.RAG&#8211;\u5b8c\u6574\u94fe\u8def<\/p>\n<p id=\"2.1.%E7%A6%BB%E7%BA%BF%E9%98%B6%E6%AE%B5-toc\" style=\"margin-left:40px\">2.1.\u79bb\u7ebf\u9636\u6bb5<\/p>\n<p id=\"2.2.%E5%9C%A8%E7%BA%BF%E9%98%B6%E6%AE%B5-toc\" style=\"margin-left:40px\">2.2.\u5728\u7ebf\u9636\u6bb5<\/p>\n<p id=\"\u56db\u3001\u8fd9\u6761\u94fe\u8def\u7684\u6838\u5fc3\u8ba4\u77e5-toc\" style=\"margin-left:40px\">2.3.\u6838\u5fc3\u8ba4\u77e5<\/p>\n<p id=\"2.4.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE-toc\" style=\"margin-left:40px\">2.4.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/p>\n<p id=\"3.Embedding%20%E6%98%AF%E4%BB%80%E4%B9%88-toc\" style=\"margin-left:0px\">3.Embedding \u662f\u4ec0\u4e48<\/p>\n<p id=\"3.1.Embedding%20--%E5%8E%8B%E7%BC%A9%E8%AF%AD%E4%B9%89-toc\" style=\"margin-left:40px\">3.1.Embedding &#8211;\u538b\u7f29\u8bed\u4e49<\/p>\n<p id=\"3.2.Embedding%20%E6%A8%A1%E5%9E%8B%E6%80%8E%E4%B9%88%E9%80%89%EF%BC%9F-toc\" style=\"margin-left:40px\">3.2.Embedding \u6a21\u578b\u600e\u4e48\u9009&#xff1f;<\/p>\n<p id=\"3.3.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE-toc\" style=\"margin-left:40px\">3.3.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/p>\n<p id=\"4.%E5%90%91%E9%87%8F%E6%95%B0%E6%8D%AE%E5%BA%93-toc\" style=\"margin-left:0px\">4.\u5411\u91cf\u6570\u636e\u5e93<\/p>\n<p id=\"4.1.MySQL%20%E4%B8%8D%E8%A1%8C-toc\" style=\"margin-left:40px\">4.1.MySQL \u4e0d\u884c<\/p>\n<p id=\"4.2.%E5%90%91%E9%87%8F%E7%B4%A2%E5%BC%95%EF%BC%9AANN%E5%BE%88%E5%BF%AB-toc\" style=\"margin-left:40px\">4.2.\u5411\u91cf\u7d22\u5f15&#xff1a;ANN\u5f88\u5feb<\/p>\n<p id=\"4.3.%E5%90%91%E9%87%8F%E6%95%B0%E6%8D%AE%E5%BA%93%E5%8A%9F%E8%83%BD-toc\" style=\"margin-left:40px\">4.3.\u5411\u91cf\u6570\u636e\u5e93\u529f\u80fd<\/p>\n<p id=\"4.4.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE-toc\" style=\"margin-left:40px\">4.4.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/p>\n<p id=\"5.RAG%20%E5%88%87%E7%89%87%E7%AD%96%E7%95%A5-toc\" style=\"margin-left:0px\">5.RAG \u5207\u7247\u7b56\u7565<\/p>\n<p id=\"5.1.Overlap-toc\" style=\"margin-left:40px\">5.1.Overlap<\/p>\n<p id=\"5.2.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE-toc\" style=\"margin-left:40px\">5.2.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/p>\n<hr id=\"hr-toc\" \/>\n<h2 id=\"1.RAG--%E5%AE%9A%E4%B9%89\" style=\"background-color:transparent\">1.RAG&#8211;\u5b9a\u4e49<\/h2>\n<p>RAG \u7684\u5168\u79f0\u662f Retrieval-Augmented Generation&#xff0c;\u68c0\u7d22\u589e\u5f3a\u751f\u6210\u3002\u5b83\u7684\u6838\u5fc3\u601d\u8def\u975e\u5e38\u76f4\u89c9&#xff1a;\u5728\u8ba9\u6a21\u578b\u56de\u7b54\u4e4b\u524d&#xff0c;\u5148\u53bb\u77e5\u8bc6\u5e93\u91cc\u68c0\u7d22\u51fa\u6700\u76f8\u5173\u7684\u5185\u5bb9&#xff0c;\u628a\u8fd9\u4e9b\u5185\u5bb9\u4f5c\u4e3a\u4e0a\u4e0b\u6587\u4e00\u8d77\u5582\u7ed9\u6a21\u578b&#xff0c;\u8ba9\u6a21\u578b&#034;\u770b\u7740\u8d44\u6599&#034;\u6765\u56de\u7b54\u3002<\/p>\n<p>\u4e0b\u9762\u8fd9\u5f20\u56fe\u5c55\u793a\u4e86 RAG \u5982\u4f55\u5bf9\u5e94\u5730\u89e3\u51b3\u4e0a\u9762\u56db\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"447\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140916-6a9ec58c0d182.png\" width=\"1078\" \/><\/p>\n<p>RAG \u9488\u5bf9\u56db\u4e2a\u95ee\u9898\u5404\u6709\u5e94\u5bf9&#xff1a;<\/p>\n<p>\u5bf9\u5e7b\u89c9\u95ee\u9898&#xff1a;\u00a0\u68c0\u7d22\u5230\u7684\u539f\u6587\u7247\u6bb5\u4f5c\u4e3a\u4e0a\u4e0b\u6587\u4f20\u5165\u6a21\u578b&#xff0c;\u6a21\u578b\u88ab\u8981\u6c42&#034;\u6839\u636e\u4ee5\u4e0b\u8d44\u6599\u56de\u7b54&#034;&#xff0c;\u800c\u4e0d\u662f\u51ed\u7a7a\u751f\u6210\u3002\u6709\u4e86\u4e8b\u5b9e\u4f9d\u636e\u7684\u7ea6\u675f&#xff0c;\u5e7b\u89c9\u6982\u7387\u5927\u5e45\u964d\u4f4e\u2014\u2014\u4f46\u6ce8\u610f&#xff0c;\u4e0d\u662f\u5f52\u96f6&#xff0c;\u8fd9\u4e2a\u540e\u9762\u4f1a\u8bb2\u3002<\/p>\n<p>\u5bf9\u79c1\u6709\u77e5\u8bc6\u95ee\u9898&#xff1a;\u00a0\u77e5\u8bc6\u5e93\u5b8c\u5168\u7531\u4f60\u81ea\u5df1\u6784\u5efa\u548c\u7ef4\u62a4&#xff0c;\u53ef\u4ee5\u5305\u542b\u4efb\u4f55\u5185\u90e8\u6587\u6863\u3002\u6a21\u578b\u4e0d\u9700\u8981\u77e5\u9053\u8fd9\u4e9b\u5185\u5bb9&#xff0c;\u53ea\u9700\u8981\u5728\u88ab\u68c0\u7d22\u5230\u7684\u7247\u6bb5\u57fa\u7840\u4e0a\u8fdb\u884c\u63a8\u7406\u548c\u7ec4\u7ec7\u8bed\u8a00\u3002<\/p>\n<p>\u5bf9\u77e5\u8bc6\u66f4\u65b0\u95ee\u9898&#xff1a;\u00a0\u66f4\u65b0\u77e5\u8bc6\u5e93\u4e0d\u9700\u8981\u91cd\u65b0\u8bad\u7ec3\u6a21\u578b&#xff0c;\u53ea\u9700\u8981\u66f4\u65b0\u6587\u6863\u3001\u91cd\u65b0\u505a\u5411\u91cf\u5316\u7d22\u5f15\u5373\u53ef\u3002\u77e5\u8bc6\u7684\u65b0\u9c9c\u5ea6\u5b8c\u5168\u7531\u77e5\u8bc6\u5e93\u51b3\u5b9a&#xff0c;\u548c\u6a21\u578b\u8bad\u7ec3\u622a\u6b62\u65e5\u671f\u89e3\u8026\u3002<\/p>\n<p>\u5bf9\u53ef\u8ffd\u6eaf\u6027\u95ee\u9898&#xff1a;\u00a0\u6bcf\u6b21\u68c0\u7d22\u90fd\u80fd\u77e5\u9053\u5177\u4f53\u547d\u4e2d\u4e86\u54ea\u4efd\u6587\u6863\u7684\u54ea\u4e2a\u7247\u6bb5&#xff0c;\u53ef\u4ee5\u5728\u7b54\u6848\u91cc\u9644\u4e0a\u5f15\u7528\u6765\u6e90&#xff0c;\u7528\u6237\u53ef\u4ee5\u81ea\u884c\u6838\u67e5\u3002<\/p>\n<h3 id=\"1.1.%E9%80%82%E5%90%88%E7%9A%84%E5%9C%BA%E6%99%AF\">1.1.\u9002\u5408\u7684\u573a\u666f<\/h3>\n<p>\u5f88\u591a\u4eba\u770b\u5230 RAG \u7684\u601d\u8def\u540e&#xff0c;\u4ea7\u751f\u4e86\u4e00\u4e2a\u8bef\u533a&#xff1a;\u662f\u4e0d\u662f\u6240\u6709\u5927\u6a21\u578b\u5e94\u7528\u90fd\u5e94\u8be5\u52a0 RAG&#xff1f;\u4e0d\u662f\u7684\u3002<\/p>\n<p>\u9002\u5408 RAG \u7684\u573a\u666f&#xff1a;<\/p>\n<p>\u77e5\u8bc6\u5bc6\u96c6\u578b\u7684\u95ee\u7b54\u7cfb\u7edf&#xff0c;\u6bd4\u5982<span style=\"color:#fe2c24\">\u4f01\u4e1a\u5185\u90e8\u77e5\u8bc6\u5e93\u3001\u4ea7\u54c1\u624b\u518c\u95ee\u7b54\u3001\u6cd5\u5f8b\u6cd5\u89c4\u67e5\u8be2<\/span>\u2014\u2014\u8fd9\u7c7b\u573a\u666f\u5bf9\u4e8b\u5b9e\u51c6\u786e\u6027\u8981\u6c42\u9ad8&#xff0c;\u5185\u5bb9\u91cf\u5927&#xff0c;\u4e14\u9700\u8981\u660e\u786e\u7684\u6765\u6e90\u8ffd\u6eaf\u3002<\/p>\n<p>\u5185\u5bb9\u9891\u7e41\u66f4\u65b0\u7684\u4e1a\u52a1&#xff0c;\u6bd4\u5982\u65b0\u95fb\u6458\u8981\u3001\u7ade\u54c1\u5206\u6790\u3001\u653f\u7b56\u89e3\u8bfb\u2014\u2014\u8fd9\u7c7b\u573a\u666f\u4e0b\u77e5\u8bc6\u5e93\u53ef\u4ee5\u6301\u7eed\u63a5\u5165\u5b9e\u65f6\u6570\u636e&#xff0c;\u800c\u6a21\u578b\u672c\u8eab\u4e0d\u9700\u8981\u52a8\u3002<\/p>\n<p>\u957f\u5c3e\u4e8b\u5b9e\u67e5\u8be2&#xff0c;\u6bd4\u5982&#034;\u6211\u4eec\u516c\u53f8\u5728\u4e0a\u6d77\u7684\u529e\u516c\u5730\u5740\u662f\u4ec0\u4e48&#034;&#034;\u8fd9\u4e2a\u5408\u540c\u7684\u7532\u65b9\u662f\u8c01&#034;\u2014\u2014\u8fd9\u7c7b\u95ee\u9898\u7684\u7b54\u6848\u85cf\u5728\u7279\u5b9a\u6587\u6863\u91cc&#xff0c;\u5fc5\u987b\u68c0\u7d22\u624d\u80fd\u627e\u5230\u3002<\/p>\n<h3 id=\"1.2.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE\" style=\"background-color:transparent\">1.2.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/h3>\n<p>Q&#xff1a;\u4e3a\u4ec0\u4e48\u6709\u4e86\u5927\u6a21\u578b\u8fd8\u9700\u8981 RAG&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;\u5927\u6a21\u578b\u6709\u51e0\u4e2a\u5c40\u9650\u6027\u2014\u2014<span style=\"color:#fe2c24\">\u5e7b\u89c9\u3001\u79c1\u6709\u77e5\u8bc6\u76f2\u533a\u3001\u77e5\u8bc6\u65f6\u6548\u6027\u3001\u65e0\u6cd5\u6eaf\u6e90<\/span>\u3002RAG \u901a\u8fc7\u5728\u56de\u7b54\u524d\u5148\u68c0\u7d22\u5916\u90e8\u77e5\u8bc6\u5e93&#xff0c;\u628a\u76f8\u5173\u6587\u6863\u7247\u6bb5\u6ce8\u5165\u4e0a\u4e0b\u6587&#xff0c;\u8ba9\u6a21\u578b&#034;\u770b\u8d44\u6599\u56de\u7b54&#034;&#xff0c;\u4ece\u800c\u6709\u9488\u5bf9\u6027\u5730\u7f13\u89e3\u4ee5\u4e0a\u95ee\u9898\u3002<\/p>\n<p>Q&#xff1a;RAG \u80fd\u89e3\u51b3\u5e7b\u89c9\u95ee\u9898\u5417&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;\u80fd\u663e\u8457\u7f13\u89e3&#xff0c;\u4f46\u65e0\u6cd5\u6839\u6cbb\u3002\u6709\u4e86\u68c0\u7d22\u5230\u7684\u4e8b\u5b9e\u4f5c\u4e3a\u951a\u70b9&#xff0c;\u6a21\u578b\u4e71\u7f16\u7684\u6982\u7387\u5927\u5e45\u964d\u4f4e&#xff0c;\u4e14\u7b54\u6848\u53ef\u4ee5\u9644\u4e0a\u6765\u6e90\u4f9b\u6838\u67e5\u3002\u4f46\u6a21\u578b\u4ecd\u7136\u53ef\u80fd\u5728\u68c0\u7d22\u7ed3\u679c\u4e0a\u505a\u51fa\u9519\u8bef\u63a8\u7406&#xff0c;\u6216\u8005\u5728\u68c0\u7d22\u8d28\u91cf\u5dee\u65f6\u8fdb\u884c&#034;\u8865\u5145\u751f\u6210&#034;\u3002RAG \u964d\u4f4e\u5e7b\u89c9\u6982\u7387&#xff0c;\u4e0d\u6d88\u706d\u5e7b\u89c9\u6839\u56e0\u3002<\/p>\n<p>Q&#xff1a;\u4ec0\u4e48\u573a\u666f\u4e0b\u4f60\u4f1a\u63a8\u8350\u7528 RAG&#xff0c;\u4ec0\u4e48\u573a\u666f\u4e0b\u4e0d\u7528&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;\u9002\u5408 RAG \u7684\u662f\u77e5\u8bc6\u5bc6\u96c6\u3001\u5185\u5bb9\u9891\u7e41\u66f4\u65b0\u3001\u9700\u8981\u6eaf\u6e90\u7684\u573a\u666f&#xff0c;\u6bd4\u5982\u4f01\u4e1a\u77e5\u8bc6\u5e93\u95ee\u7b54\u3001\u6cd5\u89c4\u67e5\u8be2\u3002\u4e0d\u9002\u5408\u7684\u662f\u521b\u610f\u751f\u6210\u3001\u5f3a\u63a8\u7406\u4efb\u52a1\u3001\u4ee5\u53ca\u6a21\u578b\u8bad\u7ec3\u6570\u636e\u5df2\u826f\u597d\u8986\u76d6\u7684\u7a33\u5b9a\u9886\u57df\u2014\u2014\u5728\u8fd9\u4e9b\u573a\u666f\u4e0b&#xff0c;RAG \u53ea\u662f\u589e\u52a0\u5ef6\u8fdf\u548c\u6210\u672c&#xff0c;\u6ca1\u6709\u5b9e\u8d28\u6536\u76ca\u3002<\/p>\n<h2 id=\"2.RAG--%E5%AE%8C%E6%95%B4%E9%93%BE%E8%B7%AF\" style=\"background-color:transparent\">2.RAG&#8211;\u5b8c\u6574\u94fe\u8def<\/h2>\n<p>\u5148\u7528\u4e00\u5f20\u56fe\u628a\u6574\u6761\u94fe\u8def\u5efa\u7acb\u8d77\u6765&#xff0c;\u518d\u9010\u6bb5\u62c6\u89e3&#xff1a;\u73b0\u5728\u9010\u6bb5\u62c6\u89e3\u8fd9\u6761\u94fe\u8def\u4e0a\u7684\u6bcf\u4e2a\u73af\u8282\u3002<\/p>\n<p>\u6574\u6761\u94fe\u8def\u5206\u4e24\u6bb5&#xff1a;\u79bb\u7ebf\u4fa7\u8d1f\u8d23&#034;\u628a\u77e5\u8bc6\u5b58\u8fdb\u53bb&#034;&#xff0c;\u5728\u7ebf\u4fa7\u8d1f\u8d23&#034;\u628a\u76f8\u5173\u77e5\u8bc6\u627e\u51fa\u6765\u3001\u7ec4\u5408\u51fa\u7b54\u6848&#034;\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"466\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140916-6a9ec58c76a56.png\" width=\"486\" \/><\/p>\n<h3 id=\"2.1.%E7%A6%BB%E7%BA%BF%E9%98%B6%E6%AE%B5\">2.1.\u79bb\u7ebf\u9636\u6bb5<\/h3>\n<p>1.\u539f\u59cb\u6587\u6863&#xff08;\u89e3\u6790&#xff09;<\/p>\n<p>RAG \u7cfb\u7edf\u7684\u77e5\u8bc6\u6765\u6e90\u53ef\u4ee5\u591a\u79cd\u591a\u6837&#xff1a;PDF \u62a5\u544a\u3001Word \u6587\u6863\u3001\u7f51\u9875\u3001Markdown \u6587\u4ef6\u3001\u6570\u636e\u5e93\u8bb0\u5f55\u3001\u90ae\u4ef6\u2026\u2026\u4e0d\u540c\u683c\u5f0f\u7684\u6587\u6863\u9700\u8981\u4e0d\u540c\u7684\u89e3\u6790\u65b9\u5f0f&#xff0c;\u8fd9\u4e00\u6b65\u901a\u5e38\u53eb\u505a\u00a0\u6587\u6863\u52a0\u8f7d&#xff08;Document Loading&#xff09;\u3002<\/p>\n<p>\u503c\u5f97\u6ce8\u610f\u7684\u662f&#xff0c;\u8fd9\u4e00\u6b65\u7684\u8d28\u91cf\u76f4\u63a5\u5f71\u54cd\u6574\u4e2a\u7cfb\u7edf\u7684\u4e0a\u9650\u3002\u5982\u679c\u539f\u59cb\u6587\u6863\u672c\u8eab\u662f\u626b\u63cf\u4ef6\u6216\u6392\u7248\u6df7\u4e71\u7684 PDF&#xff0c;\u89e3\u6790\u51fa\u6765\u7684\u6587\u672c\u5c31\u4f1a\u5145\u6ee1\u566a\u58f0&#xff0c;\u540e\u7eed\u6240\u6709\u73af\u8282\u90fd\u4f1a\u53d7\u635f\u3002&#034;\u5783\u573e\u8fdb&#xff0c;\u5783\u573e\u51fa&#034;\u5728 RAG \u91cc\u4f53\u73b0\u5f97\u975e\u5e38\u660e\u663e\u3002<\/p>\n<p>2.\u6587\u6863\u5904\u7406&#xff08;\u6e05\u6d17\u4e0e\u9884\u5904\u7406&#xff09;<\/p>\n<p>\u89e3\u6790\u51fa\u6765\u7684\u539f\u59cb\u6587\u672c\u5f80\u5f80\u4e0d\u80fd\u76f4\u63a5\u7528&#xff0c;\u9700\u8981\u505a\u4e00\u8f6e\u6e05\u6d17&#xff1a;\u53bb\u6389\u9875\u7709\u9875\u811a\u3001\u65e0\u610f\u4e49\u7684\u683c\u5f0f\u7b26\u53f7\u3001\u91cd\u590d\u5185\u5bb9&#xff1b;\u8bc6\u522b\u5e76\u4fdd\u7559\u6587\u6863\u7684\u6807\u9898\u7ed3\u6784&#xff1b;\u8fc7\u6ee4\u6389\u8868\u683c\u4e71\u7801\u3001\u56fe\u7247\u5360\u4f4d\u7b26\u7b49\u3002<\/p>\n<p>\u8fd9\u4e00\u6b65\u770b\u8d77\u6765\u7410\u788e&#xff0c;\u4f46\u5728\u5b9e\u9645\u9879\u76ee\u91cc&#xff0c;\u6587\u6863\u9884\u5904\u7406\u5f80\u5f80\u662f\u5de5\u7a0b\u91cf\u6700\u5927\u3001\u6700\u5bb9\u6613\u88ab\u4f4e\u4f30\u7684\u90e8\u5206\u3002<\/p>\n<p>3.\u5207\u7247&#xff08;Chunking&#xff09;<\/p>\n<p>\u6e05\u6d17\u597d\u7684\u6587\u6863\u4e0d\u80fd\u6574\u7bc7\u585e\u8fdb\u5411\u91cf\u5e93&#xff0c;\u9700\u8981\u5207\u6210\u66f4\u5c0f\u7684\u7247\u6bb5&#xff08;chunk&#xff09;\u3002\u8fd9\u662f RAG \u7cfb\u7edf\u91cc\u8bbe\u8ba1\u51b3\u7b56\u6700\u591a\u7684\u4e00\u4e2a\u73af\u8282&#xff0c;\u76f4\u63a5\u5f71\u54cd\u540e\u7eed\u68c0\u7d22\u7684\u7cbe\u51c6\u5ea6\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u5207&#xff1f;\u539f\u56e0\u5f88\u76f4\u63a5&#xff1a;\u4e00\u7bc7 20 \u9875\u7684\u6587\u6863&#xff0c;\u7528\u6237\u7684\u95ee\u9898\u53ef\u80fd\u53ea\u548c\u5176\u4e2d\u7684\u67d0\u4e00\u6bb5\u76f8\u5173\u3002\u5982\u679c\u628a\u6574\u7bc7\u6587\u6863\u4f5c\u4e3a\u4e00\u4e2a\u5355\u5143\u5b58\u50a8\u548c\u68c0\u7d22&#xff0c;\u8981\u4e48\u68c0\u7d22\u7c92\u5ea6\u592a\u7c97&#xff08;\u547d\u4e2d\u4e86\u6574\u7bc7\u4f46\u76f8\u5173\u5185\u5bb9\u88ab\u6df9\u6ca1&#xff09;&#xff0c;\u8981\u4e48\u4e0a\u4e0b\u6587\u592a\u957f&#xff08;\u653e\u4e0d\u8fdb\u6a21\u578b\u6216\u8005\u6ce8\u610f\u529b\u88ab\u7a00\u91ca&#xff09;\u3002<\/p>\n<p>\u5207\u591a\u5927\u5408\u9002&#xff1f;\u8fd9\u6ca1\u6709\u901a\u7528\u7b54\u6848&#xff0c;\u9700\u8981\u6839\u636e\u6587\u6863\u7c7b\u578b\u3001\u6a21\u578b\u7684\u4e0a\u4e0b\u6587\u7a97\u53e3\u3001\u4e1a\u52a1\u95ee\u9898\u7684\u9897\u7c92\u5ea6\u6765\u51b3\u5b9a\u3002<\/p>\n<p>4.\u5411\u91cf\u5316&#xff08;Embedding&#xff09;<\/p>\n<p>\u5207\u597d\u7684\u6bcf\u4e2a chunk&#xff0c;\u90fd\u9700\u8981\u901a\u8fc7 Embedding \u6a21\u578b\u8f6c\u6362\u6210\u4e00\u4e2a\u5411\u91cf&#xff08;\u4e00\u4e2a\u9ad8\u7ef4\u6d6e\u70b9\u6570\u6570\u7ec4&#xff09;&#xff0c;\u8fd9\u4e2a\u5411\u91cf\u4ee3\u8868\u4e86\u8fd9\u6bb5\u6587\u5b57\u7684&#034;\u8bed\u4e49&#034;\u3002<\/p>\n<p>\u5411\u91cf\u5316\u7684\u5173\u952e\u70b9\u662f&#xff1a;\u7528\u6237\u95ee\u9898\u548c\u6587\u6863 chunk \u5fc5\u987b\u7528\u540c\u4e00\u4e2a Embedding \u6a21\u578b\u6765\u5904\u7406&#xff0c;\u8fd9\u6837\u4e24\u8005\u7684\u5411\u91cf\u624d\u5904\u4e8e\u540c\u4e00\u4e2a\u8bed\u4e49\u7a7a\u95f4&#xff0c;\u76f8\u4f3c\u5ea6\u8ba1\u7b97\u624d\u6709\u610f\u4e49\u3002<\/p>\n<p>\u540c\u65f6\u8fd8\u9700\u8981\u5b58\u50a8\u5bf9\u5e94\u7684\u5143\u6570\u636e&#xff1a;\u8fd9\u4e2a chunk \u6765\u81ea\u54ea\u4efd\u6587\u6863\u3001\u539f\u6587\u5728\u54ea\u4e00\u9875\u3001\u6587\u6863\u7684\u521b\u5efa\u65f6\u95f4\u7b49\u3002\u5143\u6570\u636e\u5728\u8fc7\u6ee4\u68c0\u7d22\u7ed3\u679c\u65f6\u975e\u5e38\u91cd\u8981&#xff0c;\u6bd4\u5982&#034;\u53ea\u770b\u6700\u8fd1\u4e09\u4e2a\u6708\u7684\u6587\u6863&#034;\u8fd9\u7c7b\u9700\u6c42&#xff0c;\u5c31\u9700\u8981\u4f9d\u8d56\u5143\u6570\u636e\u6765\u5b9e\u73b0\u3002<\/p>\n<p>5.\u5b58\u5165\u5411\u91cf\u6570\u636e\u5e93<\/p>\n<p>\u5411\u91cf\u548c\u5143\u6570\u636e\u5206\u522b\u5b58\u5165\u5411\u91cf\u6570\u636e\u5e93&#xff08;\u5982 Milvus\u3001Weaviate\u3001Chroma\u3001Pinecone \u7b49&#xff09;\u548c\u666e\u901a\u6570\u636e\u5e93\/\u6587\u6863\u5b58\u50a8\u3002\u5411\u91cf\u6570\u636e\u5e93\u7684\u6838\u5fc3\u80fd\u529b\u662f\u8fd1\u4f3c\u6700\u8fd1\u90bb\u641c\u7d22&#xff08;ANN&#xff09;&#xff0c;\u80fd\u5728\u6570\u767e\u4e07\u5411\u91cf\u4e2d\u6beb\u79d2\u7ea7\u627e\u5230\u4e0e\u67e5\u8be2\u5411\u91cf\u6700\u76f8\u4f3c\u7684 top-K \u7ed3\u679c\u3002<\/p>\n<p><span style=\"color:#0d0016\">\u6587\u6863\u89e3\u6790 &#8211;&gt;\u6587\u6863\u5904\u7406 &#8211;&gt; \u5207\u7247 &#8211;&gt;\u5411\u91cf\u5316 &#8211;&gt;\u5b58\u5165\u5411\u91cf\u6570\u636e\u5e93<\/span><\/p>\n<h3 id=\"2.2.%E5%9C%A8%E7%BA%BF%E9%98%B6%E6%AE%B5\" style=\"background-color:transparent\">2.2.\u5728\u7ebf\u9636\u6bb5<\/h3>\n<p>\u4e0b\u9762\u8fd9\u5f20\u56fe\u5355\u72ec\u5c55\u793a\u5728\u7ebf\u68c0\u7d22\u94fe\u8def\u7684\u5404\u4e2a\u73af\u8282&#xff0c;\u4ee5\u53ca\u5e38\u89c1\u7684\u4f18\u5316\u5206\u53c9\u70b9&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"535\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140916-6a9ec58ccda22.png\" width=\"373\" \/><\/p>\n<p style=\"background-color:transparent\">1. Query \u5904\u7406&#xff08;\u6539\u5199\/\u62d3\u5c55\/\u4f18\u5316&#xff09;<\/p>\n<p>\u8f93\u5165&#xff1a;\u7528\u6237\u539f\u59cb\u81ea\u7136\u8bed\u8a00\u95ee\u9898 \u8f93\u51fa&#xff1a;\u7528\u4e8e\u68c0\u7d22\u7684\u67e5\u8be2\u5b57\u7b26\u4e32 \/ \u591a\u6761\u5b50 query<\/p>\n<p>Query \u6539\u5199<\/p>\n<ul>\n<li>\u4f5c\u7528&#xff1a;\u53e3\u8bed\u8f6c\u4e66\u9762\u3001\u6d88\u6b67\u4e49\u3001\u590d\u6742\u95ee\u9898\u62c6\u5206\u5b50\u95ee\u9898<\/li>\n<li>\u793a\u4f8b&#xff1a; \u539f\u59cb&#xff1a;\u516c\u53f8\u62a5\u9500\u600e\u4e48\u5f04&#xff0c;\u6700\u591a\u80fd\u62a5\u591a\u5c11&#xff1f; \u6539\u5199\u62c6\u5206&#xff1a;<\/li>\n<\/ul>\n<li>\u516c\u53f8\u62a5\u9500\u6d41\u7a0b<\/li>\n<li>\u516c\u53f8\u62a5\u9500\u989d\u5ea6\u4e0a\u9650<\/li>\n<ul>\n<li>\u9002\u7528\u573a\u666f&#xff1a;\u7528\u6237\u95ee\u53e5\u957f\u3001\u591a\u610f\u56fe\u3001\u53e3\u8bed\u5316&#xff1b;\u57fa\u7840\u7248\u672c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u539f query \u8df3\u8fc7\u3002<\/li>\n<\/ul>\n<p>Query \u6269\u5c55<\/p>\n<ul>\n<li>\u4f5c\u7528&#xff1a;\u540c\u4e49\u8bcd\u3001\u76f8\u5173\u672f\u8bed\u6269\u5145 query&#xff0c;\u89e3\u51b3\u7528\u6237\u7528\u8bcd\u548c\u6587\u6863\u7528\u8bcd\u4e0d\u4e00\u81f4\u5bfc\u81f4\u53ec\u56de\u5931\u8d25<\/li>\n<li>\u793a\u4f8b&#xff1a;\u79bb\u804c\u8865\u507f \u2192 \u6269\u5c55\u79bb\u804c\u8d54\u507f\u91d1\u3001\u8f9e\u9000\u8865\u507f<\/li>\n<li>\u5b9e\u73b0\u65b9\u5f0f&#xff1a;\u5927\u6a21\u578b\u751f\u6210\u6269\u5c55\u3001\u540c\u4e49\u8bcd\u8bcd\u5178&#xff1b;\u5c0f\u4f53\u91cf\u77e5\u8bc6\u5e93\u53ef\u4ee5\u4e0d\u5f00\u542f&#xff0c;\u907f\u514d\u5f15\u5165\u65e0\u5173\u68c0\u7d22\u65b9\u5411\u3002<\/li>\n<\/ul>\n<p>\u6ce8\u610f&#xff1a;\u6539\u5199 \/ \u6269\u5c55\u662f\u53ef\u9009&#xff0c;\u8fc7\u5ea6\u6269\u5c55\u4f1a\u5f15\u5165\u566a\u58f0&#xff0c;\u53cd\u800c\u964d\u4f4e\u68c0\u7d22\u8d28\u91cf\u3002<\/p>\n<p>2. Retrieval \u68c0\u7d22<\/p>\n<p>\u8f93\u5165&#xff1a;\u5904\u7406\u540e\u7684 Query \u8f93\u51fa&#xff1a;\u7c97\u6392\u5019\u9009 chunk \u5217\u8868 (top\u2011K)<\/p>\n<p>\u65b9\u6cd5\u4e00 &#xff1a;\u7eaf\u5411\u91cf\u68c0\u7d22<\/p>\n<li>Query \u7ecf\u8fc7 Embedding \u6a21\u578b\u5411\u91cf\u5316<\/li>\n<li>\u548c\u5411\u91cf\u5e93\u5185\u5168\u90e8\u6587\u6863\u5757 (chunk) \u8ba1\u7b97\u4f59\u5f26\u76f8\u4f3c\u5ea6<\/li>\n<li>\u8fd4\u56de\u76f8\u4f3c\u5ea6\u6700\u9ad8\u7684 top\u2011K&#xff0c;K \u4e00\u822c\u53d6 3~10<\/li>\n<ul>\n<li>\u4f18\u70b9&#xff1a;\u6293\u8bed\u4e49&#xff0c;\u540c\u4e49\u8bcd\u4e5f\u80fd\u53ec\u56de<\/li>\n<li>\u7f3a\u70b9&#xff1a;\u5173\u952e\u8bcd\u7cbe\u786e\u5339\u914d\u5f31&#xff0c;\u4e13\u6709\u540d\u8bcd\u3001\u7f16\u53f7\u5bb9\u6613\u6f0f\u3002<\/li>\n<\/ul>\n<p style=\"background-color:transparent\">\u65b9\u6cd5\u4e8c &#xff1a;\u6df7\u5408\u68c0\u7d22 Hybrid Search&#xff08;\u5de5\u4e1a\u5e38\u7528&#xff09;<\/p>\n<p>\u4e24\u8def\u5e76\u884c\u68c0\u7d22&#xff1a;<\/p>\n<li>\u5411\u91cf\u68c0\u7d22&#xff1a;\u8bed\u4e49\u5339\u914d<\/li>\n<li>BM25 \u5173\u952e\u8bcd\u68c0\u7d22&#xff1a;\u5b57\u9762\u5173\u952e\u8bcd\u7cbe\u786e\u5339\u914d \u518d\u505a\u7ed3\u679c\u878d\u5408&#xff08;\u5206\u6570\u52a0\u6743\u3001Reciprocal Rank Fusion RRF&#xff09;\u5408\u5e76\u5019\u9009\u96c6\u5408\u3002<\/li>\n<p>\u4f18\u52bf&#xff1a;\u517c\u987e\u8bed\u4e49\u7406\u89e3 &#043; \u5173\u952e\u8bcd\u7cbe\u51c6\u547d\u4e2d&#xff0c;\u89e3\u51b3\u7eaf\u5411\u91cf\u5bb9\u6613\u4e22\u5931\u4e13\u6709\u540d\u8bcd\u7684\u95ee\u9898\u3002<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50&#xff1a;<\/p>\n<p>pip install rank-bm25 jieba<\/p>\n<p>import jieba<br \/>\nfrom rank_bm25 import BM25Okapi<\/p>\n<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 1. \u51c6\u5907\u77e5\u8bc6\u5e93 chunk &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\ncorpus &#061; [<br \/>\n    &#034;\u56fd\u5185\u51fa\u5dee\u4f4f\u5bbf\u6807\u51c6&#xff1a;\u4e00\u7ebf\u57ce\u5e02\u5355\u4eba\u4e0a\u9650600\u5143\/\u665a&#xff0c;\u4e8c\u7ebf\u57ce\u5e02450\u5143\/\u665a\u3002\u51fa\u5dee\u673a\u7968\u4f18\u5148\u7ecf\u6d4e\u8231\u3002&#034;,<br \/>\n    &#034;\u516c\u53f8\u4e3a\u5f02\u5730\u5458\u5de5\u63d0\u4f9b\u4f4f\u623f\u8865\u8d34&#xff0c;\u4e00\u7ebf\u57ce\u5e02\u6bcf\u6708\u8865\u8d341500\u5143&#xff0c;\u4e8c\u7ebf\u57ce\u5e021000\u5143\u3002&#034;,<br \/>\n    &#034;\u4f9b\u5e94\u5546\u4f4f\u5bbf\u63a5\u5f85\u6807\u51c6&#xff0c;\u4e00\u7c7b\u57ce\u5e02\u4e0d\u8d85\u8fc7800\u5143\u6bcf\u665a\u3002&#034;,<br \/>\n    &#034;\u51fa\u5dee\u62a5\u9500\u9700\u8981\u53d1\u7968\u3001\u884c\u7a0b\u5355&#xff0c;\u63d0\u4ea4OA\u6d41\u7a0b\u5ba1\u6279\u3002&#034;,<br \/>\n]<\/p>\n<p># \u7ed9\u6bcf\u4e2achunk\u6807\u8bb0\u6765\u6e90id<br \/>\nchunk_ids &#061; [0, 1, 2, 3]<\/p>\n<p># \u4e2d\u6587\u5206\u8bcd&#xff1a;BM25\u9700\u8981\u5206\u8bcd\u540e\u7684\u8bcd\u5217\u8868<br \/>\ntokenized_corpus &#061; [list(jieba.cut(doc)) for doc in corpus]<\/p>\n<p># \u6784\u5efaBM25\u7d22\u5f15&#xff08;\u7eaf\u5185\u5b58\u5012\u6392\u7d22\u5f15&#xff0c;\u65e0\u8bad\u7ec3&#xff09;<br \/>\nbm25 &#061; BM25Okapi(tokenized_corpus)<\/p>\n<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 2. BM25\u68c0\u7d22\u51fd\u6570 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\ndef bm25_search(query: str, top_n&#061;3):<br \/>\n    query_tokens &#061; list(jieba.cut(query))<br \/>\n    scores &#061; bm25.get_scores(query_tokens)<br \/>\n    # (score, chunk_id, text)<br \/>\n    scored &#061; [(scores[i], chunk_ids[i], corpus[i]) for i in range(len(scores))]<br \/>\n    scored.sort(key&#061;lambda x: x[0], reverse&#061;True)<br \/>\n    return scored[:top_n]<\/p>\n<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 3. \u6a21\u62df\u5411\u91cf\u68c0\u7d22&#xff08;\u771f\u5b9e\u573a\u666f\u8c03\u7528Embedding&#043;\u5411\u91cf\u5e93&#xff0c;\u8fd9\u91cc\u6a21\u62df\u8f93\u51fa\u6392\u540d&#xff09; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\ndef mock_vector_search(query: str, top_n&#061;3):<br \/>\n    &#034;&#034;&#034;\u6a21\u62df\u5411\u91cf\u68c0\u7d22\u8fd4\u56de\u7ed3\u679c&#xff0c;\u683c\u5f0f&#xff1a;(sim_score, chunk_id, text)<br \/>\n    \u5bf9\u5e94\u524d\u9762\u4f8b\u5b50&#xff1a;\u5411\u91cf\u53ec\u56de\u987a\u5e8f 0,1,2<br \/>\n    &#034;&#034;&#034;<br \/>\n    # \u6a21\u62df\u5411\u91cf\u76f8\u4f3c\u5ea6\u5206\u6570<br \/>\n    mock_ret &#061; [<br \/>\n        (0.92, 0, corpus[0]),<br \/>\n        (0.78, 1, corpus[1]),<br \/>\n        (0.71, 2, corpus[2]),<br \/>\n    ]<br \/>\n    return mock_ret[:top_n]<\/p>\n<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 4. RRF \u6392\u540d\u878d\u5408\u7b97\u6cd5 Reciprocal Rank Fusion &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\ndef rrf_fuse(list_a, list_b, k&#061;6):<br \/>\n    &#034;&#034;&#034;<br \/>\n    list_a \/ list_b: [(score, chunk_id, text), &#8230;]<br \/>\n    k: RRF\u5e38\u6570&#xff0c;\u4e00\u822c\u53d66<br \/>\n    return: \u878d\u5408\u540e\u6392\u5e8f\u5217\u8868 [(rrf_score, chunk_id, text)]<br \/>\n    &#034;&#034;&#034;<br \/>\n    rrf_dict &#061; {}<\/p>\n<p>    # \u5904\u7406\u7b2c\u4e00\u8def\u7ed3\u679c<br \/>\n    for rank, item in enumerate(list_a):<br \/>\n        _, cid, text &#061; item<br \/>\n        rrf_score &#061; 1.0 \/ (rank &#043; 1 &#043; k)<br \/>\n        if cid not in rrf_dict:<br \/>\n            rrf_dict[cid] &#061; {&#034;score&#034;: 0.0, &#034;text&#034;: text}<br \/>\n        rrf_dict[cid][&#034;score&#034;] &#043;&#061; rrf_score<\/p>\n<p>    # \u5904\u7406\u7b2c\u4e8c\u8def\u7ed3\u679c<br \/>\n    for rank, item in enumerate(list_b):<br \/>\n        _, cid, text &#061; item<br \/>\n        rrf_score &#061; 1.0 \/ (rank &#043; 1 &#043; k)<br \/>\n        if cid not in rrf_dict:<br \/>\n            rrf_dict[cid] &#061; {&#034;score&#034;: 0.0, &#034;text&#034;: text}<br \/>\n        rrf_dict[cid][&#034;score&#034;] &#043;&#061; rrf_score<\/p>\n<p>    # \u964d\u5e8f\u6392\u5e8f<br \/>\n    fused &#061; sorted(rrf_dict.items(), key&#061;lambda x: x[1][&#034;score&#034;], reverse&#061;True)<br \/>\n    out &#061; [(v[&#034;score&#034;], cid, v[&#034;text&#034;]) for cid, v in fused]<br \/>\n    return out<\/p>\n<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 5. \u8fd0\u884c\u6d4b\u8bd5 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nif __name__ &#061;&#061; &#034;__main__&#034;:<br \/>\n    user_query &#061; &#034;\u56fd\u5185\u51fa\u5dee\u4e00\u7ebf\u57ce\u5e02\u4f4f\u5bbf\u62a5\u9500\u6807\u51c6\u662f\u591a\u5c11&#xff1f;&#034;<\/p>\n<p>    bm25_res &#061; bm25_search(user_query, top_n&#061;3)<br \/>\n    vec_res &#061; mock_vector_search(user_query, top_n&#061;3)<\/p>\n<p>    print(&#034;&#061;&#061;&#061;&#061; BM25\u68c0\u7d22\u7ed3\u679c &#061;&#061;&#061;&#061;&#034;)<br \/>\n    for s, cid, txt in bm25_res:<br \/>\n        print(f&#034;score&#061;{s:.3f}, id&#061;{cid}: {txt}&#034;)<\/p>\n<p>    print(&#034;\\\\n&#061;&#061;&#061;&#061; \u6a21\u62df\u5411\u91cf\u68c0\u7d22\u7ed3\u679c &#061;&#061;&#061;&#061;&#034;)<br \/>\n    for s, cid, txt in vec_res:<br \/>\n        print(f&#034;sim&#061;{s:.3f}, id&#061;{cid}: {txt}&#034;)<\/p>\n<p>    fused_result &#061; rrf_fuse(bm25_res, vec_res, k&#061;6)<br \/>\n    print(&#034;\\\\n&#061;&#061;&#061;&#061; RRF\u6df7\u5408\u68c0\u7d22\u878d\u5408\u7ed3\u679c &#061;&#061;&#061;&#061;&#034;)<br \/>\n    for s, cid, txt in fused_result:<br \/>\n        print(f&#034;rrf&#061;{s:.3f}, id&#061;{cid}: {txt}&#034;)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"496\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140916-6a9ec58cea58a.png\" width=\"1081\" \/><\/p>\n<p style=\"background-color:transparent\">3. Rerank \u7cbe\u6392&#xff08;\u53ec\u56de\u540e&#xff0c;\u53ef\u9009\u4f46\u6027\u4ef7\u6bd4\u6781\u9ad8&#xff09;<\/p>\n<p>\u8f93\u5165&#xff1a;\u7c97\u6392\u5f97\u5230\u7684 top\u2011K \u5019\u9009 chunk \u8f93\u51fa&#xff1a;\u91cd\u65b0\u6253\u5206\u6392\u5e8f\u540e\u7684\u77ed\u5217\u8868&#xff08;\u4e00\u822c\u622a\u53d6 top\u20112~top\u20114 \u9001\u5165 LLM&#xff09;<\/p>\n<p>\u6d41\u7a0b&#xff1a;<\/p>\n<li>\u4f7f\u7528 Cross\u2011Encoder \u91cd\u6392\u6a21\u578b&#xff0c;\u8f93\u5165(Query, Chunk)\u6210\u5bf9\u8f93\u5165\u6a21\u578b<\/li>\n<li>\u6a21\u578b\u8f93\u51fa\u8be5 chunk \u5bf9\u4e8e\u5f53\u524d\u95ee\u9898\u7684\u76f8\u5173\u6027\u5206\u6570<\/li>\n<li>\u6839\u636e\u5206\u6570\u91cd\u65b0\u6392\u5e8f&#xff0c;\u8fc7\u6ee4\u4f4e\u5206\u7247\u6bb5&#xff0c;\u53d6 top\u2011N<\/li>\n<ul>\n<li>\u4f18\u70b9&#xff1a;RAG \u4f18\u5316\u4e2d\u6536\u76ca\u6700\u9ad8\u7684\u624b\u6bb5&#xff0c;\u8fc7\u6ee4\u6389\u8bed\u4e49\u5411\u91cf\u76f8\u4f3c\u4f46\u5b9e\u9645\u65e0\u5173\u7684\u788e\u7247<\/li>\n<li>\u4ee3\u4ef7&#xff1a;\u989d\u5916\u6a21\u578b\u63a8\u7406&#xff0c;\u589e\u52a0\u63a8\u7406\u5ef6\u8fdf&#xff1b;\u5019\u9009\u96c6\u4e0d\u80fd\u592a\u5927&#xff0c;\u5426\u5219\u901f\u5ea6\u5f88\u6162\u3002<\/li>\n<\/ul>\n<p>\u5b9e\u8df5\u8303\u5f0f&#xff1a;\u7c97\u53ec\u56de K&#061;8\u201110 \u2192 rerank \u2192 \u7b5b\u9009 top\u20113\u20114 \u7ed9 LLM\u3002<\/p>\n<li>Embedding&#xff08;\u53cc\u7f16\u7801\u5668 Dual\u2011Encoder&#xff09;&#xff1a;Query \u548c Chunk \u5206\u5f00\u7f16\u7801&#xff0c;\u5f97\u5230\u4e24\u4e2a\u72ec\u7acb\u5411\u91cf&#xff0c;\u7b97\u4f59\u5f26\u76f8\u4f3c\u5ea6\u3002\u8bad\u7ec3\u76ee\u6807&#xff1a;\u8ba9\u76f8\u5173\u7684 pair \u5411\u91cf\u9760\u8fd1\u3001\u4e0d\u76f8\u5173\u8fdc\u79bb\u3002\n<ul>\n<li>\u4f18\u70b9&#xff1a;chunk \u53ef\u4ee5\u63d0\u524d\u5411\u91cf\u5316\u5165\u5e93&#xff1b;\u68c0\u7d22\u901f\u5ea6\u5feb\u3002<\/li>\n<li>\u7f3a\u70b9&#xff1a;query \u548c chunk \u6ca1\u6709\u4ea4\u4e92&#xff0c;\u53ea\u80fd\u7c97\u7c92\u5ea6\u8bed\u4e49&#xff0c;\u7ec6\u7c92\u5ea6\u76f8\u5173\u6027\u5224\u65ad\u5f31\u3002<\/li>\n<\/ul>\n<\/li>\n<li>Rerank \u4f7f\u7528 Cross\u2011Encoder&#xff08;\u4ea4\u53c9\u7f16\u7801\u5668&#xff09;&#xff1a;Query &#043; Chunk \u62fc\u63a5\u5728\u4e00\u8d77\u9001\u5165\u540c\u4e00\u4e2a\u6a21\u578b&#xff0c;token \u4e4b\u95f4\u4e92\u76f8\u505a\u6ce8\u610f\u529b\u4ea4\u4e92&#xff0c;\u76f4\u63a5\u8f93\u51fa\u4e00\u4e2a\u76f8\u5173\u6027\u5206\u6570\u3002<\/li>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"339\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140917-6a9ec58d3b74a.png\" width=\"578\" \/><\/p>\n<p>4. \u4e0a\u4e0b\u6587\u6784\u5efa Context Construction<\/p>\n<p>\u8f93\u5165&#xff1a;rerank \u7b5b\u9009\u540e\u7684 chunk \u7247\u6bb5 \u8f93\u51fa&#xff1a;\u7ec4\u88c5\u5b8c\u6210\u7684 Prompt \u4e0a\u4e0b\u6587<\/p>\n<li>\u5c06 chunk \u8fde\u540c\u5143\u6570\u636e&#xff08;\u6587\u6863\u6765\u6e90\u3001\u9875\u7801\u3001\u6587\u4ef6\u540d&#xff09;\u683c\u5f0f\u5316\u62fc\u63a5<\/li>\n<li>\u62fc\u63a5\u7cfb\u7edf\u6307\u4ee4\u3001\u53c2\u8003\u8d44\u6599\u5757\u3001\u7528\u6237\u539f\u59cb query&#xff0c;\u7ec4\u88c5\u5b8c\u6574 Prompt \u6a21\u677f<\/li>\n<p>\u6a21\u677f\u793a\u4f8b&#xff1a;<\/p>\n<p>\u4f60\u662f\u4e00\u4e2a\u4f01\u4e1a\u77e5\u8bc6\u5e93\u52a9\u624b\u3002\u8bf7\u6839\u636e\u4ee5\u4e0b\u8d44\u6599\u56de\u7b54\u95ee\u9898&#xff0c;\u5982\u679c\u8d44\u6599\u4e2d\u6ca1\u6709\u76f8\u5173\u4fe1\u606f&#xff0c;\u8bf7\u660e\u786e\u8bf4\u660e\u3002<\/p>\n<p>\u53c2\u8003\u8d44\u6599&#xff1a;<br \/>\n[\u6765\u6e90&#xff1a;\u4ea7\u54c1\u624b\u518c\u7b2c3\u9875]<br \/>\n\u2026\u2026chunk\u5185\u5bb9\u2026\u2026<br \/>\n[\u6765\u6e90&#xff1a;\u8d22\u52a1\u5236\u5ea6V2.0]<br \/>\n\u2026\u2026chunk\u5185\u5bb9\u2026\u2026<\/p>\n<p>\u7528\u6237\u95ee\u9898&#xff1a;\u6211\u4eec\u7684\u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48&#xff1f;<\/p>\n<p>\u26a0\ufe0f\u5173\u952e\u70b9&#xff1a;\u63a7\u5236\u603b token \u957f\u5ea6&#xff0c;\u9632\u6b62\u4e0a\u4e0b\u6587\u6ea2\u51fa&#xff1b;chunk \u4e0d\u8981\u65e0\u9650\u5236\u5806\u780c\u3002<\/p>\n<p>5. Generation LLM \u751f\u6210<\/p>\n<p>\u8f93\u5165&#xff1a;\u5b8c\u6574 Prompt \u8f93\u51fa&#xff1a;\u6700\u7ec8\u56de\u7b54\u7ed9\u7528\u6237<\/p>\n<p>\u6838\u5fc3\u7ea6\u675f\u5199\u5728 Prompt \u6307\u4ee4\u4e2d&#xff1a;<\/p>\n<li>\u4f18\u5148\u4f9d\u8d56\u7ed9\u5b9a\u53c2\u8003\u8d44\u6599\u56de\u7b54&#xff0c;\u7981\u6b62\u4f7f\u7528\u6a21\u578b\u81ea\u8eab\u7684\u5185\u90e8\u77e5\u8bc6<\/li>\n<li>\u8d44\u6599\u65e0\u4fe1\u606f\u65f6\u660e\u786e\u544a\u77e5 \u201c\u73b0\u6709\u8d44\u6599\u672a\u63d0\u53ca\u8be5\u5185\u5bb9\u201d&#xff0c;\u7981\u6b62\u5e7b\u89c9\u7f16\u9020<\/li>\n<li>\u56de\u7b54\u4e2d\u6807\u6ce8\u8d44\u6599\u6765\u6e90&#xff0c;\u65b9\u4fbf\u6eaf\u6e90\u6821\u9a8c<\/li>\n<hr \/>\n<h3 id=\"\u56db\u3001\u8fd9\u6761\u94fe\u8def\u7684\u6838\u5fc3\u8ba4\u77e5\">2.3.\u6838\u5fc3\u8ba4\u77e5<\/h3>\n<table>\n<tr>\u6838\u5fc3\u8ba4\u77e5\u8981\u70b9\u8bf4\u660e\u5b9e\u8df5\u542f\u793a<\/tr>\n<tbody>\n<tr>\n<td style=\"width:126px\">\u5404\u73af\u8282\u5bf9\u8d28\u91cf\u7684\u5f71\u54cd\u5404\u4e0d\u76f8\u540c<\/td>\n<td style=\"width:376px\">\n<p>1. Chunking&#xff1a;\u51b3\u5b9a\u80fd\u4e0d\u80fd\u68c0\u7d22\u5230\u76f8\u5173\u5185\u5bb9<\/p>\n<p>2. Embedding \u6a21\u578b&#xff1a;\u51b3\u5b9a\u8bed\u4e49\u7406\u89e3\u662f\u5426\u51c6\u786e<\/p>\n<p>3. Rerank&#xff1a;\u51b3\u5b9a\u53ec\u56de top \u7ed3\u679c\u662f\u5426\u771f\u7684\u6700\u76f8\u5173<\/p>\n<p>4. Prompt \u8bbe\u8ba1&#xff1a;\u51b3\u5b9aLLM \u80fd\u5426\u6b63\u786e\u5229\u7528\u4e0a\u4e0b\u6587<\/p>\n<\/td>\n<td style=\"width:187px\">\u4f18\u5316 RAG \u4f18\u5148\u5b9a\u4f4d\u8584\u5f31\u73af\u8282&#xff0c;\u4e0d\u8981\u6240\u6709\u73af\u8282\u76f2\u76ee\u8c03\u53c2<\/td>\n<\/tr>\n<tr>\n<td style=\"width:126px\">\u79bb\u7ebf\u2011\u5728\u7ebf\u94fe\u8def\u5fc5\u987b\u5bf9\u9f50<\/td>\n<td style=\"width:376px\">\u6587\u672c\u6e05\u6d17\u3001\u5206\u8bcd\u3001Embedding \u6a21\u578b&#xff0c;\u79bb\u7ebf\u5efa\u7d22\u5f15\u548c\u5728\u7ebf\u68c0\u7d22\u5fc5\u987b\u5b8c\u5168\u4e00\u81f4&#xff1b;\u7d22\u5f15\u7528\u6a21\u578b A&#xff0c;\u68c0\u7d22\u7528\u6a21\u578b B&#xff0c;\u5411\u91cf\u7a7a\u95f4\u4e0d\u4e00\u81f4&#xff0c;\u76f8\u4f3c\u5ea6\u8ba1\u7b97\u5931\u6548<\/td>\n<td style=\"width:187px\">\u4e0a\u7ebf\u524d\u6821\u9a8c\u9884\u5904\u7406\u94fe\u8def\u4e00\u81f4\u6027&#xff1b;\u4e0d\u8981\u968f\u610f\u66f4\u6362 embedding \u6a21\u578b<\/td>\n<\/tr>\n<tr>\n<td style=\"width:126px\">\u68c0\u7d22\u8ffd\u6c42\u7cbe\u51c6&#xff0c;\u800c\u975e\u7247\u9762\u8ffd\u6c42\u53ec\u56de\u6570\u91cf<\/td>\n<td style=\"width:376px\">\u5c11\u91cf\u9ad8\u8d28\u91cf chunk&#xff08;top\u20113&#xff09;\u4f18\u4e8e\u5927\u91cf\u6df7\u6742\u7684 top\u201120 \u7ed3\u679c&#xff1b;\u4e0a\u4e0b\u6587 token \u8d8a\u957f&#xff0c;LLM \u6ce8\u610f\u529b\u8d8a\u5206\u6563&#xff0c;\u4fe1\u566a\u6bd4\u4e0b\u964d<\/td>\n<td style=\"width:187px\">\u63a7\u5236\u7c97\u53ec\u56de\u5019\u9009\u6570\u91cf&#xff0c;\u4f9d\u9760 Rerank \u8fc7\u6ee4\u566a\u58f0&#xff0c;\u7cbe\u7b80\u9001\u5165 LLM \u7684\u4e0a\u4e0b\u6587<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"2.4.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE\" style=\"background-color:transparent\">2.4.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/h3>\n<p>Q&#xff1a;\u8bf7\u63cf\u8ff0\u4e00\u4e2a\u5b8c\u6574\u7684 RAG \u94fe\u8def\u3002<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;\u5206\u4e24\u6bb5\u56de\u7b54\u3002<\/p>\n<p>\u79bb\u7ebf\u4fa7&#xff1a;\u6587\u6863\u52a0\u8f7d \u2192 \u6e05\u6d17\u9884\u5904\u7406 \u2192 Chunking \u2192 Embedding \u5411\u91cf\u5316 \u2192 \u5b58\u5165\u5411\u91cf\u6570\u636e\u5e93&#xff08;\u540c\u65f6\u5b58\u5143\u6570\u636e&#xff09;\u3002<\/p>\n<p>\u5728\u7ebf\u4fa7&#xff1a;\u7528\u6237 Query \u2192&#xff08;\u53ef\u9009 Query \u6539\u5199&#xff09;\u2192 Query \u5411\u91cf\u5316\u2192\u5411\u91cf\u68c0\u7d22\u53ec\u56de top-K \u2192&#xff08;\u53ef\u9009\u6df7\u5408\u68c0\u7d22\u3001Rerank \u7cbe\u6392&#xff09;\u2192 \u62fc\u88c5 Context &#043; Prompt \u2192 LLM \u751f\u6210 \u2192 \u8f93\u51fa\u5e26\u6765\u6e90\u5f15\u7528\u7684\u7b54\u6848\u3002<\/p>\n<p><span style=\"color:#fe2c24\">\u5143\u6570\u636e\u6709\u4ec0\u4e48\u7528&#xff1f;<\/span><\/p>\n<p> {<br \/>\n  &#034;vector&#034;: [0.123,0.456, &#8230;],<br \/>\n  &#034;content&#034;: &#034;\u56fd\u5185\u51fa\u5dee\u4f4f\u5bbf\u6807\u51c6&#xff1a;\u4e00\u7ebf\u57ce\u5e02\u5355\u4eba\u4e0a\u9650600\u5143\/\u665a&#8230;&#034;,<br \/>\n  &#034;metadata&#034;: {<br \/>\n    &#034;doc_id&#034;: &#034;doc_005&#034;,<br \/>\n    &#034;doc_name&#034;: &#034;\u5dee\u65c5\u7ba1\u7406\u89c4\u5b9aV3.pdf&#034;,<br \/>\n    &#034;page&#034;: 4,<br \/>\n    &#034;chunk_index&#034;: 12,<br \/>\n    &#034;department&#034;: &#034;\u8d22\u52a1\u90e8&#034;,<br \/>\n    &#034;version&#034;: &#034;V3&#034;,<br \/>\n    &#034;create_time&#034;: &#034;2026\u201101\u201110&#034;<br \/>\n  }<br \/>\n}<\/p>\n<li>\u6eaf\u6e90&#xff1a;\u7ed9\u7b54\u6848\u52a0\u6765\u6e90\u51fa\u5904&#xff0c;\u4fbf\u4e8e\u6821\u9a8c&#xff1b;<\/li>\n<li>\u8fc7\u6ee4&#xff1a;\u68c0\u7d22\u65f6\u505a\u6761\u4ef6\u7b5b\u9009&#xff08;\u7248\u672c\u3001\u90e8\u95e8\u3001\u79df\u6237\u6743\u9650&#xff09;&#xff1b;<\/li>\n<li>\u8fd0\u7ef4&#xff1a;\u6309 doc_id \u6279\u91cf\u5220\u9664 \/ \u66f4\u65b0\u6587\u6863&#xff0c;\u662f\u5411\u91cf\u548c\u6e90\u6587\u6863\u7684\u6620\u5c04\u6865\u6881&#xff1b;<\/li>\n<li>\u4e1a\u52a1&#xff1a;\u5b9e\u73b0\u591a\u79df\u6237\u3001\u6743\u9650\u3001\u5206\u7c7b\u63a7\u5236\u3002<\/li>\n<p>RAG \u5f88\u591a\u7ebf\u4e0a\u95ee\u9898\u6839\u6e90\u5c31\u662f\u5143\u6570\u636e\u7f3a\u5931&#xff1a;\u6587\u6863\u66f4\u65b0\u540e\u65e7\u5411\u91cf\u6e05\u4e0d\u6389\u3001\u7b54\u6848\u65e0\u6cd5\u6eaf\u6e90\u3001\u6ca1\u6cd5\u505a\u6743\u9650\u8fc7\u6ee4\u3002<\/p>\n<p>Q&#xff1a;RAG \u91cc\u54ea\u4e9b\u73af\u8282\u6700\u5f71\u54cd\u6548\u679c&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;<\/p>\n<p>\u79bb\u7ebf\u4fa7\u6700\u5173\u952e\u7684\u662f Chunking \u7b56\u7565&#xff08;\u51b3\u5b9a\u68c0\u7d22\u7c92\u5ea6&#xff09;\u548c Embedding \u6a21\u578b\u9009\u578b&#xff08;\u51b3\u5b9a\u8bed\u4e49\u7406\u89e3\u8d28\u91cf&#xff09;\u3002<\/p>\n<p>\u5728\u7ebf\u4fa7\u6700\u5173\u952e\u7684\u662f Prompt \u8bbe\u8ba1&#xff08;\u5f15\u5bfc\u6a21\u578b\u6b63\u786e\u5229\u7528\u4e0a\u4e0b\u6587&#xff09;\u3002\u5176\u4e2d\u6587\u6863\u8d28\u91cf\u662f\u524d\u63d0&#xff0c;\u518d\u597d\u7684\u7cfb\u7edf\u4e5f\u5904\u7406\u4e0d\u597d\u4e71\u7801\u548c\u7ed3\u6784\u6df7\u4e71\u7684\u8f93\u5165\u3002<\/p>\n<p>Q&#xff1a;Embedding \u6a21\u578b\u5728\u79bb\u7ebf\u548c\u5728\u7ebf\u9700\u8981\u4fdd\u6301\u4e00\u81f4\u5417&#xff1f;\u4e3a\u4ec0\u4e48&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;\u5fc5\u987b\u4e00\u81f4\u3002<\/p>\n<p>Embedding \u6a21\u578b\u628a\u6587\u672c\u6620\u5c04\u5230\u4e00\u4e2a\u9ad8\u7ef4\u5411\u91cf\u7a7a\u95f4&#xff0c;\u4e0d\u540c\u6a21\u578b\u7684\u5411\u91cf\u7a7a\u95f4\u662f\u4e0d\u540c\u7684\u3002\u79bb\u7ebf\u7528 A \u6a21\u578b\u5efa\u7684\u7d22\u5f15&#xff0c;\u5728\u7ebf\u7528 B \u6a21\u578b\u751f\u6210 Query \u5411\u91cf&#xff0c;\u4e24\u8005\u5904\u4e8e\u4e0d\u540c\u7a7a\u95f4&#xff0c;\u4f59\u5f26\u76f8\u4f3c\u5ea6\u8ba1\u7b97\u5b8c\u5168\u5931\u53bb\u610f\u4e49&#xff0c;\u68c0\u7d22\u7ed3\u679c\u4f1a\u975e\u5e38\u6df7\u4e71\u3002<\/p>\n<h2 id=\"3.Embedding%20%E6%98%AF%E4%BB%80%E4%B9%88\">3.Embedding \u662f\u4ec0\u4e48<\/h2>\n<p>\u9762\u8bd5\u5b98&#xff1a;\u7528\u6237\u95ee\u2018\u51fa\u5dee\u80fd\u4e0d\u80fd\u62a5\u9500\u5750\u98de\u673a\u2019&#xff0c;\u4f60\u7684\u77e5\u8bc6\u5e93\u660e\u660e\u6709\u7b54\u6848&#xff0c;\u4e3a\u4ec0\u4e48\u641c\u4e0d\u51fa\u6765&#xff1f;<\/p>\n<p>\u4ed6&#xff1a;\u53ef\u80fd\u662f\u5173\u952e\u8bcd\u6ca1\u5339\u914d\u4e0a&#xff0c;\u6211\u518d\u591a\u52a0\u51e0\u4e2a\u540c\u4e49\u8bcd\u3002<\/p>\n<p>\u9762\u8bd5\u5b98&#xff1a;\u6587\u6863\u91cc\u5199\u7684\u662f\u2018\u6c11\u7528\u822a\u7a7a\u5668\u2019&#xff0c;\u4e0d\u662f\u2018\u98de\u673a\u2019&#xff0c;\u518d\u60f3\u60f3\u3002<\/p>\n<p>\u4ed6\u6c89\u9ed8\u4e86\u51e0\u79d2&#xff1a;\u662f\u4e0d\u662f\u641c\u7d22\u8bcd\u5e93\u4e0d\u591f\u5168&#xff1f;<\/p>\n<p>\u9762\u8bd5\u5b98\u6447\u6447\u5934&#xff1a;\u4f60\u52a0\u518d\u591a\u540c\u4e49\u8bcd\u4e5f\u6ca1\u7528\u3002\u4f60\u7684\u68c0\u7d22\u5230\u5e95\u5728\u5339\u914d\u4ec0\u4e48&#xff1f;\u662f\u6587\u5b57&#xff0c;\u8fd8\u662f\u8bed\u4e49&#xff1f;<\/p>\n<p>\u4ed6&#xff1a;\u6211\u5c31\u662f\u6309\u5173\u952e\u8bcd\u641c\u7d22\u554a&#8230;&#8230;<\/p>\n<p>\u9762\u8bd5\u5b98&#xff1a;\u90a3\u7528\u6237\u8bf4\u2018\u98de\u673a\u2019&#xff0c;\u4f60\u600e\u4e48\u5339\u914d\u2018\u6c11\u7528\u822a\u7a7a\u5668\u2019&#xff1f;<\/p>\n<p>\u4ed6&#xff1a;(\u0301\u25c9\u25de\u0c6a\u25df\u25c9\u2035)&#8230;&#8230;<\/p>\n<p>\u4f20\u7edf\u641c\u7d22\u5728\u62fc\u6587\u5b57&#xff0c;\u800c Embedding&#xff0c;\u5c31\u662f\u8ba9\u673a\u5668\u8bfb\u61c2\u4eba\u7c7b\u7684\u8bed\u8a00\u3002<\/p>\n<p>\u4eca\u5929\u6211\u4eec\u628a Embedding \u5411\u91cf\u68c0\u7d22&#xff0c;\u4ece\u5934\u5230\u5c3e\u62c6\u6e05\u695a\u3002<\/p>\n<p id=\"embedding-\u662f\u4ec0\u4e48-\u8bed\u4e49\u538b\u7f29\u3001\u6a21\u578b\u9009\u578b\u3001\u548c-rerank-\u7684\u533a\u522b\">\u8bed\u4e49\u538b\u7f29\u3001\u6a21\u578b\u9009\u578b\u3001\u548c Rerank \u7684\u533a\u522b<\/p>\n<p>Embedding \u662f\u4e00\u79cd\u5c06\u6587\u672c&#xff08;\u6216\u56fe\u7247\u3001\u97f3\u9891\u7b49&#xff09;\u6620\u5c04\u5230\u9ad8\u7ef4\u5411\u91cf\u7a7a\u95f4\u7684\u6280\u672f\u3002\u4e00\u4e2a\u53e5\u5b50\u7ecf\u8fc7 Embedding \u6a21\u578b\u5904\u7406\u540e&#xff0c;\u4f1a\u53d8\u6210\u4e00\u4e2a\u7531\u51e0\u767e\u5230\u51e0\u5343\u4e2a\u6d6e\u70b9\u6570\u7ec4\u6210\u7684\u6570\u7ec4&#xff0c;\u6bd4\u5982\u00a0[0.23, -0.87, 0.14, &#8230;, 0.56]&#xff08;\u7ef4\u5ea6\u901a\u5e38\u662f 384\u3001768 \u6216 1536 \u7ef4&#xff09;\u3002<\/p>\n<p>\u5173\u952e\u4e0d\u5728\u4e8e\u8fd9\u4e32\u6570\u5b57\u672c\u8eab&#xff0c;\u800c\u5728\u4e8e\u5b83\u5728\u7a7a\u95f4\u91cc\u7684\u4f4d\u7f6e&#xff1a;\u8bed\u4e49\u76f8\u4f3c\u7684\u6587\u672c&#xff0c;\u5b83\u4eec\u7684\u5411\u91cf\u5728\u8fd9\u4e2a\u9ad8\u7ef4\u7a7a\u95f4\u91cc\u5f7c\u6b64\u8ddd\u79bb\u8fd1&#xff1b;\u8bed\u4e49\u4e0d\u76f8\u5173\u7684\u6587\u672c&#xff0c;\u8ddd\u79bb\u8fdc\u3002<\/p>\n<p>\u8fd9\u662f Embedding \u7684\u6838\u5fc3\u627f\u8bfa&#xff1a;\u7528\u7a7a\u95f4\u8ddd\u79bb\u6765\u8868\u8fbe\u8bed\u4e49\u76f8\u4f3c\u5ea6\u3002<\/p>\n<p>&#xff08;\u5728\u9ad8\u7ef4 Embedding \u7a7a\u95f4&#xff0c;\u4f59\u5f26\u76f8\u4f3c\u5ea6\u8861\u91cf\u4e24\u4e2a\u5411\u91cf\u6307\u5411\u7684\u8bed\u4e49\u65b9\u5411\u6709\u591a\u63a5\u8fd1&#xff09;<\/p>\n<p>\u4e0b\u9762\u8fd9\u5f20\u56fe\u7528\u4e8c\u7ef4\u7a7a\u95f4\u6765\u76f4\u89c9\u5316\u8fd9\u4ef6\u4e8b\u3002\u771f\u5b9e\u7684\u5411\u91cf\u662f\u51e0\u767e\u5230\u51e0\u5343\u7ef4&#xff0c;\u4f46\u6295\u5f71\u5230\u4e8c\u7ef4\u5e73\u9762\u540e&#xff0c;\u8bed\u4e49\u805a\u7c7b\u7684\u6a21\u5f0f\u4ecd\u7136\u6e05\u6670\u53ef\u89c1&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"519\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140917-6a9ec58d618aa.png\" width=\"607\" \/><\/p>\n<p>\u56fe\u4e2d\u7684\u6bcf\u4e2a\u70b9\u90fd\u662f\u4e00\u6bb5\u6587\u672c\u7ecf\u8fc7 Embedding \u540e\u5728\u5411\u91cf\u7a7a\u95f4\u4e2d\u7684\u4f4d\u7f6e\u3002\u771f\u5b9e\u7ef4\u5ea6\u8fdc\u4e0d\u6b62\u4e24\u7ef4&#xff08;\u901a\u5e38\u662f\u51e0\u767e\u5230\u51e0\u5343\u7ef4&#xff09;&#xff0c;\u4f46\u8bed\u4e49\u805a\u7c7b\u7684\u89c4\u5f8b\u662f\u4e00\u81f4\u7684&#xff1a;\u51fa\u884c\u62a5\u9500\u7c7b\u7684\u6587\u6863\u5f7c\u6b64\u9760\u8fd1&#xff0c;\u52a8\u7269\u7c7b\u3001\u7f16\u7a0b\u7c7b\u5404\u81ea\u805a\u96c6\u3002<\/p>\n<p>\u7528\u6237\u7684 Query \u5411\u91cf\u5316\u540e&#xff0c;\u7cfb\u7edf\u8ba1\u7b97\u5b83\u4e0e\u6240\u6709\u6587\u6863\u5411\u91cf\u7684\u8ddd\u79bb&#xff0c;\u627e\u5230\u6700\u8fd1\u7684\u51e0\u4e2a&#xff0c;\u8fd9\u5c31\u662f\u5411\u91cf\u68c0\u7d22\u7684\u672c\u8d28\u3002<\/p>\n<h3 id=\"3.1.Embedding%20--%E5%8E%8B%E7%BC%A9%E8%AF%AD%E4%B9%89\">3.1.Embedding &#8211;\u538b\u7f29\u8bed\u4e49<\/h3>\n<p id=\"\u4e8c\u3001embedding-\u4e0d\u662f\u751f\u6210\u6587\u672c-\u662f\u5728\u538b\u7f29\u8bed\u4e49\">Embedding \u4e0d\u662f\u751f\u6210\u6587\u672c&#xff0c;\u662f\u5728\u538b\u7f29\u8bed\u4e49<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u7ecf\u5e38\u88ab\u6df7\u6dc6\u7684\u6982\u5ff5&#xff0c;\u503c\u5f97\u5355\u72ec\u8bf4\u6e05\u695a\u3002<\/p>\n<p>\u751f\u6210\u5f0f\u5927\u6a21\u578b&#xff08;\u5982 GPT\u3001Claude&#xff09;\u7684\u76ee\u6807\u662f\u8f93\u51fa\u6587\u5b57&#xff0c;\u7ed9\u4f60\u4e00\u6bb5\u8f93\u5165&#xff0c;\u751f\u6210\u4e0b\u4e00\u6bb5\u5185\u5bb9\u3002<\/p>\n<p>Embedding \u6a21\u578b\u7684\u76ee\u6807\u5b8c\u5168\u4e0d\u540c\u2014\u2014\u5b83\u7684\u8f93\u51fa\u4e0d\u662f\u6587\u5b57&#xff0c;\u800c\u662f\u4e00\u4e2a\u5411\u91cf\u8868\u793a&#xff0c;\u76ee\u7684\u662f\u628a\u4e00\u6bb5\u6587\u5b57\u7684&#034;\u8bed\u4e49&#034;\u538b\u7f29\u5230\u4e00\u4e2a\u56fa\u5b9a\u7ef4\u5ea6\u7684\u6570\u5b57\u6570\u7ec4\u91cc&#xff0c;\u4fdd\u7559\u8bed\u4e49\u4fe1\u606f&#xff0c;\u4e22\u6389\u683c\u5f0f\u548c\u63aa\u8f9e\u7ec6\u8282\u3002<\/p>\n<p>\u540c\u4e00\u4e2a\u8bed\u4e49&#xff0c;\u5373\u4f7f\u6362\u5404\u5f0f\u5404\u6837\u7684\u8bf4\u6cd5&#xff0c;\u7ecf\u8fc7\u4e00\u4e2a\u597d\u7684 Embedding \u6a21\u578b&#xff0c;\u5f97\u5230\u7684\u5411\u91cf\u5e94\u8be5\u975e\u5e38\u63a5\u8fd1\u3002\u8fd9\u5c31\u662f\u8bed\u4e49\u641c\u7d22\u80fd\u8de8\u8d8a\u63aa\u8f9e\u5dee\u5f02\u627e\u5230\u76f8\u5173\u5185\u5bb9\u7684\u6839\u672c\u539f\u56e0\u3002<\/p>\n<h3 id=\"3.2.Embedding%20%E6%A8%A1%E5%9E%8B%E6%80%8E%E4%B9%88%E9%80%89%EF%BC%9F\" style=\"background-color:transparent\">3.2.Embedding \u6a21\u578b\u600e\u4e48\u9009&#xff1f;<\/h3>\n<p>\u5728\u5b9e\u9645\u5de5\u7a0b\u4e2d\u9009 Embedding \u6a21\u578b&#xff0c;\u6709\u51e0\u4e2a\u7ef4\u5ea6\u9700\u8981\u8003\u91cf&#xff1a;<\/p>\n<p>\u5411\u91cf\u7ef4\u5ea6<\/p>\n<p>\u7ef4\u5ea6\u8d8a\u9ad8&#xff0c;\u7406\u8bba\u4e0a\u80fd\u8868\u8fbe\u7684\u8bed\u4e49\u8d8a\u7ec6\u817b&#xff0c;\u4f46\u5b58\u50a8\u5f00\u9500\u548c\u68c0\u7d22\u901f\u5ea6\u4e5f\u4f1a\u76f8\u5e94\u589e\u52a0\u3002\u5e38\u89c1\u7ef4\u5ea6\u6709 384 \u7ef4&#xff08;\u8f7b\u91cf&#xff09;\u3001768 \u7ef4&#xff08;\u5747\u8861&#xff09;\u30011536 \u7ef4&#xff08;\u9ad8\u7cbe\u5ea6&#xff09;\u3002\u5927\u591a\u6570\u4e2d\u7b49\u89c4\u6a21\u4e1a\u52a1\u9009 768 \u7ef4\u662f\u5408\u7406\u8d77\u70b9\u3002<\/p>\n<p>\u6700\u5927 token \u9650\u5236<\/p>\n<p>\u6bcf\u4e2a Embedding \u6a21\u578b\u90fd\u6709\u8f93\u5165\u957f\u5ea6\u4e0a\u9650&#xff0c;\u8d85\u8fc7\u4e0a\u9650\u7684\u5185\u5bb9\u4f1a\u88ab\u622a\u65ad\u3002\u8fd9\u4e2a\u9650\u5236\u76f4\u63a5\u7ea6\u675f\u4e86 Chunk \u7684\u6700\u5927\u5927\u5c0f\u3002\u6bd4\u5982\u00a0bge-small-zh\u00a0\u652f\u6301\u6700\u591a 512 token&#xff0c;\u90a3\u4f60\u7684 chunk \u5c31\u4e0d\u80fd\u8d85\u8fc7\u8fd9\u4e2a\u9650\u5236\u3002\u9009\u6a21\u578b\u524d\u4e00\u5b9a\u8981\u6838\u5bf9\u8fd9\u4e2a\u53c2\u6570\u3002<\/p>\n<p>\u4e2d\u6587\u652f\u6301<\/p>\n<p>\u8fd9\u662f\u4e2d\u6587 RAG \u573a\u666f\u6700\u5173\u952e\u7684\u9009\u578b\u4f9d\u636e\u3002\u901a\u7528\u7684\u82f1\u6587 Embedding \u6a21\u578b&#xff08;\u5982 OpenAI \u7684\u00a0text-embedding-ada-002&#xff09;\u5bf9\u4e2d\u6587\u7684\u652f\u6301\u8d28\u91cf\u660e\u663e\u4e0d\u5982\u4e13\u95e8\u4f18\u5316\u8fc7\u4e2d\u6587\u7684\u6a21\u578b\u3002\u76ee\u524d\u4e2d\u6587\u573a\u666f\u4e0b\u53e3\u7891\u8f83\u597d\u7684\u5f00\u6e90\u9009\u9879\u5305\u62ec BGE \u7cfb\u5217\u548c M3E \u7cfb\u5217&#xff0c;\u90fd\u5728\u8bc4\u6d4b\u699c\u4e0a\u6709\u8f83\u597d\u8868\u73b0\u3002<\/p>\n<p>\u662f\u5426\u652f\u6301\u975e\u5bf9\u79f0\u68c0\u7d22<\/p>\n<p>RAG \u91cc\u6709\u4e00\u4e2a\u5178\u578b\u7684\u975e\u5bf9\u79f0\u573a\u666f&#xff1a;Query \u662f\u4e00\u4e2a\u7b80\u77ed\u7684\u95ee\u9898&#xff08;&#034;\u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48&#034;&#xff09;&#xff0c;\u800c\u6587\u6863\u7247\u6bb5\u662f\u4e00\u6bb5\u8f83\u957f\u7684\u8bf4\u660e\u6587\u5b57\u3002\u6709\u4e9b\u6a21\u578b\u4e3a\u8fd9\u7c7b\u975e\u5bf9\u79f0\u7684 Query-Document \u5bf9\u505a\u4e86\u4e13\u95e8\u4f18\u5316&#xff0c;\u68c0\u7d22\u6548\u679c\u660e\u663e\u66f4\u597d&#xff0c;\u6bd4\u5982 BGE \u7cfb\u5217\u652f\u6301\u4e3a Query \u52a0\u7279\u6b8a\u524d\u7f00\u00a0&#034;Represent this sentence for searching relevant passages:&#034;\u00a0\u6765\u63d0\u5347\u68c0\u7d22\u6548\u679c\u3002<\/p>\n<table>\n<tr>\u9879\u76ee\u5bf9\u79f0\u68c0\u7d22 Symmetric\u975e\u5bf9\u79f0\u68c0\u7d22 Asymmetric (RAG \u5e38\u7528)<\/tr>\n<tbody>\n<tr>\n<td>\u4f7f\u7528\u573a\u666f<\/td>\n<td>\u53e5\u5bf9\u76f8\u4f3c\u5ea6\u3001\u53bb\u91cd\u3001\u95ee\u9898\u2011\u95ee\u9898\u5339\u914d<\/td>\n<td>RAG \u68c0\u7d22&#xff1a;\u77ed Query \u68c0\u7d22\u957f Passage<\/td>\n<\/tr>\n<tr>\n<td>\u8f93\u5165\u5904\u7406<\/td>\n<td>Query\u3001Passage \u5b8c\u5168\u76f8\u540c\u5904\u7406&#xff0c;\u4e0d\u52a0\u7279\u6b8a\u524d\u7f00<\/td>\n<td>Query \u52a0\u68c0\u7d22\u6307\u4ee4\u524d\u7f00&#xff1b;Passage \u76f4\u63a5\u539f\u6587&#xff0c;\u4e0d\u52a0\u524d\u7f00<\/td>\n<\/tr>\n<tr>\n<td>\u8bad\u7ec3\u6570\u636e<\/td>\n<td>(\u666e\u901a\u53e5\u5b50&#xff0c;\u666e\u901a\u53e5\u5b50)<\/td>\n<td>(\u5e26\u6307\u4ee4\u7684 query&#xff0c;\u539f\u59cb passage)<\/td>\n<\/tr>\n<tr>\n<td>\u793a\u4f8b\u8f93\u5165<\/td>\n<td>Q: \u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48P: \u9000\u6b3e\u653f\u7b56&#xff1a;xxx<\/td>\n<td>Q: Represent this sentence for searching relevant passages: \u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48P: \u9000\u6b3e\u653f\u7b56&#xff1a;xxx<\/td>\n<\/tr>\n<tr>\n<td>BGE \u6a21\u578b\u4f7f\u7528\u6a21\u5f0f<\/td>\n<td>bge\u2011small\u2011zh \u5bf9\u79f0<\/td>\n<td>bge\u2011m3\u2011zh\u3001bge\u2011v3\u652f\u6301\u975e\u5bf9\u79f0\u6a21\u5f0f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"3.3.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE\" style=\"background-color:transparent\">3.3.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/h3>\n<p>Q&#xff1a;Embedding \u6a21\u578b\u600e\u4e48\u9009&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;\u4ece\u56db\u4e2a\u7ef4\u5ea6\u56de\u7b54\u3002<\/p>\n<p>\u7b2c\u4e00&#xff0c;\u8bed\u8a00\u573a\u666f\u2014\u2014\u4e2d\u6587\u4e1a\u52a1\u4f18\u5148\u9009\u4e2d\u6587\u4f18\u5316\u6a21\u578b&#xff08;BGE\u3001M3E&#xff09;&#xff0c;\u4e0d\u8981\u76f4\u63a5\u7528\u82f1\u6587\u901a\u7528\u6a21\u578b&#xff1b;\u7b2c\u4e8c&#xff0c;\u8f93\u5165\u957f\u5ea6\u2014\u2014\u6a21\u578b\u7684\u6700\u5927 token \u9650\u5236\u76f4\u63a5\u51b3\u5b9a chunk \u5927\u5c0f\u7684\u4e0a\u9650&#xff1b;<\/p>\n<p>\u7b2c\u4e09&#xff0c;\u5411\u91cf\u7ef4\u5ea6\u2014\u2014\u6839\u636e\u5b58\u50a8\u8d44\u6e90\u548c\u7cbe\u5ea6\u8981\u6c42\u6743\u8861&#xff0c;768 \u7ef4\u901a\u5e38\u662f\u5408\u7406\u8d77\u70b9&#xff1b;<\/p>\n<p>\u7b2c\u56db&#xff0c;\u4efb\u52a1\u7c7b\u578b\u2014\u2014\u975e\u5bf9\u79f0\u68c0\u7d22&#xff08;\u77ed Query \u627e\u957f\u6587\u6863&#xff09;\u548c\u5bf9\u79f0\u68c0\u7d22&#xff08;\u76f8\u4f3c\u95ee\u9898\u5339\u914d&#xff09;\u7684\u6700\u4f18\u6a21\u578b\u4e0d\u540c&#xff0c;\u8981\u770b\u5177\u4f53\u4e1a\u52a1\u573a\u666f\u3002<\/p>\n<p>Q&#xff1a;Embedding \u548c Rerank \u6709\u4ec0\u4e48\u533a\u522b&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;Embedding&#xff08;\u53cc\u5854\/Bi-Encoder&#xff09;\u5bf9 Query \u548c\u6587\u6863\u5206\u522b\u72ec\u7acb\u7f16\u7801\u6210\u5411\u91cf&#xff0c;\u901a\u8fc7\u5411\u91cf\u76f8\u4f3c\u5ea6\u53ec\u56de&#xff0c;\u4f18\u70b9\u662f\u6587\u6863\u5411\u91cf\u53ef\u79bb\u7ebf\u9884\u8ba1\u7b97\u3001\u68c0\u7d22\u6781\u5feb&#xff0c;\u53ef\u5904\u7406\u767e\u4e07\u91cf\u7ea7&#xff0c;\u9002\u5408\u7c97\u7b5b&#xff1b;<\/p>\n<p>Rerank&#xff08;Cross-Encoder&#xff09;\u628a Query \u548c\u6bcf\u4e2a\u5019\u9009\u6587\u6863\u62fc\u63a5\u540e\u8054\u5408\u8f93\u5165&#xff0c;\u76f4\u63a5\u8f93\u51fa\u76f8\u5173\u6027\u5206\u6570&#xff0c;\u6a21\u578b\u80fd\u770b\u5230\u4e24\u8005\u7684\u6df1\u5ea6\u4ea4\u4e92&#xff0c;\u7cbe\u51c6\u5ea6\u66f4\u9ad8&#xff0c;\u4f46\u65e0\u6cd5\u9884\u8ba1\u7b97\u3001\u9700\u9010\u5bf9\u63a8\u7406&#xff0c;\u53ea\u9002\u5408\u5bf9\u5c11\u91cf\u5019\u9009\u505a\u7cbe\u6392\u3002\u4e24\u8005\u662f\u6d41\u6c34\u7ebf\u5173\u7cfb&#xff1a;Embedding \u7c97\u7b5b\u53ec\u56de\u5019\u9009\u6c60&#xff0c;Rerank \u7cbe\u6392\u8fc7\u6ee4\u51fa\u6700\u7ec8\u4f20\u7ed9 LLM \u7684\u4e0a\u4e0b\u6587\u3002<\/p>\n<h2 id=\"4.%E5%90%91%E9%87%8F%E6%95%B0%E6%8D%AE%E5%BA%93\">4.\u5411\u91cf\u6570\u636e\u5e93<\/h2>\n<p>\u4f60\u505a\u4e86\u4e00\u4e2a RAG \u7cfb\u7edf&#xff0c;\u6709 100 \u4e07\u4e2a\u6587\u6863 chunk&#xff0c;\u6bcf\u4e2a chunk \u90fd\u7ecf\u8fc7 Embedding \u53d8\u6210\u4e86\u4e00\u4e2a 768 \u7ef4\u7684\u5411\u91cf\u3002<\/p>\n<p>\u73b0\u5728\u7528\u6237\u63d0\u4e86\u4e00\u4e2a\u95ee\u9898&#xff0c;\u4f60\u628a\u8fd9\u4e2a\u95ee\u9898\u4e5f\u5411\u91cf\u5316\u4e86\u3002\u63a5\u4e0b\u6765\u4f60\u8981\u505a\u7684\u4e8b\u60c5\u662f&#xff1a;\u627e\u5230 100 \u4e07\u4e2a\u5411\u91cf\u91cc&#xff0c;\u548c\u8fd9\u4e2a Query \u5411\u91cf\u6700\u76f8\u4f3c\u7684 top-5 \u4e2a\u3002<\/p>\n<p>\u542c\u8d77\u6765\u4e0d\u96be&#xff0c;\u5b9e\u9645\u505a\u8d77\u6765\u5f88\u9ebb\u70e6\u3002<\/p>\n<p>\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u662f&#034;\u66b4\u529b\u641c\u7d22&#034;&#xff1a;\u628a Query \u5411\u91cf\u548c\u5168\u90e8 100 \u4e07\u4e2a\u5411\u91cf\u9010\u4e00\u8ba1\u7b97\u4f59\u5f26\u76f8\u4f3c\u5ea6&#xff0c;\u6392\u5e8f&#xff0c;\u53d6 top-5\u3002\u5728\u4e00\u53f0\u666e\u901a\u670d\u52a1\u5668\u4e0a&#xff0c;\u8fd9\u4e2a\u64cd\u4f5c\u5927\u6982\u9700\u8981\u51e0\u767e\u6beb\u79d2\u5230\u51e0\u79d2\u2014\u2014\u5bf9\u4e8e\u5b9e\u65f6\u5bf9\u8bdd\u573a\u666f\u6765\u8bf4\u5b8c\u5168\u4e0d\u53ef\u63a5\u53d7\u3002<\/p>\n<p>\u800c\u4e14&#xff0c;\u5f53\u5411\u91cf\u6570\u91cf\u589e\u957f\u5230 1000 \u4e07\u30011 \u4ebf\u65f6&#xff0c;\u66b4\u529b\u641c\u7d22\u7684\u8017\u65f6\u7ebf\u6027\u589e\u957f&#xff0c;\u6839\u672c\u65e0\u6cd5\u7528\u4e8e\u751f\u4ea7\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u5411\u91cf\u6570\u636e\u5e93\u8981\u89e3\u51b3\u7684\u6838\u5fc3\u95ee\u9898&#xff1a;<span style=\"color:#fe2c24\">\u5728\u6d77\u91cf\u9ad8\u7ef4\u5411\u91cf\u4e2d&#xff0c;\u5982\u4f55\u5728\u6beb\u79d2\u7ea7\u5185\u627e\u5230\u6700\u76f8\u4f3c\u7684\u7ed3\u679c&#xff1f;<\/span><\/p>\n<h3 id=\"4.1.MySQL%20%E4%B8%8D%E8%A1%8C\"><span style=\"color:null\">4.1.MySQL \u4e0d\u884c<\/span><\/h3>\n<p>\u8fd9\u662f\u9762\u8bd5\u91cc\u6700\u5e38\u95ee\u7684\u95ee\u9898\u4e4b\u4e00\u3002\u7b54\u6848\u4e0d\u53ea\u662f&#034;MySQL \u4e0d\u652f\u6301&#034;&#xff0c;\u800c\u662f\u6709\u672c\u8d28\u7684\u6280\u672f\u539f\u56e0\u3002<\/p>\n<p>\u4f20\u7edf\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u67e5\u8be2\u672c\u8d28\u4e0a\u662f\u7cbe\u786e\u5339\u914d\u6216\u8303\u56f4\u626b\u63cf\u2014\u2014\u6bd4\u5982\u00a0WHERE age &gt; 25 AND city &#061; &#039;\u5317\u4eac&#039;&#xff0c;\u901a\u8fc7 B-Tree \u7d22\u5f15\u53ef\u4ee5\u5feb\u901f\u5b9a\u4f4d\u5230\u7b26\u5408\u6761\u4ef6\u7684\u884c\u3002<\/p>\n<p>\u5411\u91cf\u76f8\u4f3c\u5ea6\u641c\u7d22\u5b8c\u5168\u4e0d\u540c\u3002\u4f60\u4e0d\u662f\u5728\u95ee&#034;\u54ea\u4e9b\u5411\u91cf\u7b49\u4e8e\u67d0\u4e2a\u503c&#034;&#xff0c;\u800c\u662f\u5728\u95ee&#034;<span style=\"color:#fe2c24\">\u54ea\u4e9b\u5411\u91cf\u548c\u6211\u7684\u67e5\u8be2\u5411\u91cf\u6700\u63a5\u8fd1<\/span>&#034;\u2014\u2014\u8fd9\u662f\u4e00\u4e2a\u5728\u9ad8\u7ef4\u8fde\u7eed\u7a7a\u95f4\u91cc\u7684\u51e0\u4f55\u95ee\u9898\u3002<\/p>\n<p>\u4f20\u7edf\u6570\u636e\u5e93\u7684\u7d22\u5f15\u7ed3\u6784&#xff08;B-Tree\u3001Hash Index&#xff09;\u5bf9\u8fd9\u7c7b\u95ee\u9898\u5b8c\u5168\u65e0\u6548&#xff0c;\u56e0\u4e3a\u5b83\u4eec\u8bbe\u8ba1\u4e4b\u521d\u6ca1\u6709\u8003\u8651&#034;\u9ad8\u7ef4\u51e0\u4f55\u76f8\u4f3c\u5ea6&#034;\u8fd9\u4e2a\u7ef4\u5ea6\u3002\u5373\u4fbf PostgreSQL \u7684 pgvector \u6269\u5c55\u652f\u6301\u5411\u91cf\u5b58\u50a8&#xff0c;\u5728\u5927\u89c4\u6a21\u573a\u666f\u4e0b\u7684\u6027\u80fd\u4ecd\u7136\u8fdc\u4e0d\u5982\u4e13\u95e8\u7684\u5411\u91cf\u6570\u636e\u5e93\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"365\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140917-6a9ec58d91655.png\" width=\"519\" \/><\/p>\n<h3 id=\"4.2.%E5%90%91%E9%87%8F%E7%B4%A2%E5%BC%95%EF%BC%9AANN%E5%BE%88%E5%BF%AB\">4.2.\u5411\u91cf\u7d22\u5f15&#xff1a;ANN\u5f88\u5feb<\/h3>\n<p>\u8981\u5728\u767e\u4e07\u91cf\u7ea7\u5411\u91cf\u4e2d\u505a\u6beb\u79d2\u7ea7\u68c0\u7d22&#xff0c;\u5173\u952e\u662f\u5411\u91cf\u7d22\u5f15\u3002\u5411\u91cf\u6570\u636e\u5e93\u4e0d\u505a\u66b4\u529b\u5168\u91cf\u8ba1\u7b97&#xff0c;\u800c\u662f\u9884\u5148\u6784\u5efa\u4e00\u4e2a\u7279\u6b8a\u7684\u7d22\u5f15\u7ed3\u6784&#xff0c;\u8ba9\u68c0\u7d22\u65f6\u53ea\u9700\u8bbf\u95ee\u4e00\u5c0f\u90e8\u5206\u5411\u91cf\u5c31\u80fd\u627e\u5230\u8fd1\u4f3c\u7684\u6700\u8fd1\u90bb\u2014\u2014\u8fd9\u5c31\u662f ANN&#xff08;Approximate Nearest Neighbor&#xff0c;\u8fd1\u4f3c\u6700\u8fd1\u90bb\u641c\u7d22&#xff09;\u3002<\/p>\n<p>&#034;\u8fd1\u4f3c&#034;\u4e24\u5b57\u9700\u8981\u6ce8\u610f\u3002ANN \u4e0d\u4fdd\u8bc1\u627e\u5230\u7edd\u5bf9\u6700\u8fd1\u90bb&#xff0c;\u4f46\u5728\u5b9e\u8df5\u4e2d\u627e\u5230\u7684\u7ed3\u679c\u7cbe\u51c6\u5ea6\u8db3\u591f\u9ad8&#xff08;\u901a\u5e38 95%&#043;&#xff09;&#xff0c;\u800c\u901f\u5ea6\u63d0\u5347\u662f\u6570\u91cf\u7ea7\u7684\u3002<\/p>\n<p>\u76ee\u524d\u6700\u4e3b\u6d41\u7684\u4e24\u7c7b\u5411\u91cf\u7d22\u5f15\u7b97\u6cd5\u662f&#xff1a;<\/p>\n<p>HNSW&#xff08;Hierarchical Navigable Small World&#xff09;<\/p>\n<p>HNSW \u6784\u5efa\u4e86\u4e00\u4e2a\u5c42\u7ea7\u7ed3\u6784\u7684\u56fe&#xff1a;\u6700\u9876\u5c42\u662f\u5c11\u91cf\u8282\u70b9&#xff0c;\u5f62\u6210&#034;\u9ad8\u901f\u516c\u8def&#034;&#xff1b;\u5e95\u5c42\u662f\u6240\u6709\u8282\u70b9&#xff0c;\u5f62\u6210&#034;\u8857\u9053\u7f51\u7edc&#034;\u3002\u68c0\u7d22\u65f6\u4ece\u9876\u5c42\u5165\u53e3\u8fdb\u5165&#xff0c;\u6cbf\u56fe\u4e2d\u7684\u90bb\u5c45\u8fb9\u5feb\u901f\u5bfc\u822a&#xff0c;\u9010\u5c42\u4e0b\u964d&#xff0c;\u50cf GPS \u5bfc\u822a\u4e00\u6837\u8d8a\u6765\u8d8a\u7cbe\u7ec6&#xff0c;\u6700\u7ec8\u5b9a\u4f4d\u5230\u76ee\u6807\u9644\u8fd1\u7684\u6700\u8fd1\u90bb\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"384\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140917-6a9ec58da8f1e.png\" width=\"509\" \/><\/p>\n<p>HNSW \u7684\u4f18\u52bf\u662f\u67e5\u8be2\u901f\u5ea6\u6781\u5feb\u3001\u7cbe\u5ea6\u9ad8&#xff0c;\u662f Milvus\u3001Qdrant\u3001Weaviate \u7b49\u4e3b\u6d41\u5411\u91cf\u6570\u636e\u5e93\u7684\u9ed8\u8ba4\u7d22\u5f15\u3002\u4ee3\u4ef7\u662f\u6784\u5efa\u7d22\u5f15\u65f6\u5185\u5b58\u5360\u7528\u8f83\u5927\u3002<\/p>\n<p>IVF&#xff08;Inverted File Index&#xff09;<\/p>\n<p>IVF \u5148\u5bf9\u6240\u6709\u5411\u91cf\u505a K-Means \u805a\u7c7b&#xff0c;\u628a\u76f8\u4f3c\u7684\u5411\u91cf\u5206\u7ec4\u5230\u540c\u4e00\u4e2a&#034;\u8d27\u67b6&#034;\u91cc\u3002\u68c0\u7d22\u65f6\u5148\u627e\u5230 Query \u5411\u91cf\u6700\u8fd1\u7684\u51e0\u4e2a\u8d27\u67b6&#xff0c;\u53ea\u5728\u8fd9\u4e9b\u8d27\u67b6\u5185\u505a\u7cbe\u7ec6\u67e5\u627e&#xff0c;\u800c\u4e0d\u662f\u5168\u91cf\u626b\u63cf\u3002<\/p>\n<p>IVF \u7684\u4f18\u52bf\u662f\u5185\u5b58\u5360\u7528\u8f83\u4f4e&#xff0c;\u9002\u5408\u8d85\u5927\u89c4\u6a21\u6570\u636e\u96c6\u3002\u7f3a\u70b9\u662f\u5982\u679c Query \u5411\u91cf\u6070\u597d\u843d\u5728\u4e24\u4e2a\u8d27\u67b6\u7684\u8fb9\u754c&#xff0c;\u53ef\u80fd\u4f1a\u6f0f\u6389\u4e00\u4e9b\u76f8\u5173\u7ed3\u679c&#xff08;\u8fb9\u754c\u6548\u5e94&#xff09;\u3002<\/p>\n<h3 id=\"4.3.%E5%90%91%E9%87%8F%E6%95%B0%E6%8D%AE%E5%BA%93%E5%8A%9F%E8%83%BD\">4.3.\u5411\u91cf\u6570\u636e\u5e93\u529f\u80fd<\/h3>\n<p>\u5411\u91cf\u6570\u636e\u5e93\u4e0d\u53ea\u662f&#034;\u5b58\u5411\u91cf\u3001\u641c\u5411\u91cf&#034;\u8fd9\u4e48\u7b80\u5355&#xff0c;\u5b83\u8fd8\u6709\u51e0\u4e2a\u5728 RAG \u5de5\u7a0b\u91cc\u975e\u5e38\u91cd\u8981\u7684\u80fd\u529b&#xff1a;<\/p>\n<p>\u5143\u6570\u636e\u8fc7\u6ee4&#xff08;Metadata Filtering&#xff09;<\/p>\n<p>\u6bcf\u4e2a\u5411\u91cf\u53ef\u4ee5\u9644\u5e26\u7ed3\u6784\u5316\u7684\u5143\u6570\u636e&#xff0c;\u6bd4\u5982\u6587\u6863\u6765\u6e90\u3001\u521b\u5efa\u65f6\u95f4\u3001\u90e8\u95e8\u5f52\u5c5e\u3001\u6587\u6863\u7c7b\u578b\u7b49\u3002\u68c0\u7d22\u65f6\u53ef\u4ee5\u5728\u5411\u91cf\u76f8\u4f3c\u5ea6\u641c\u7d22\u7684\u540c\u65f6\u9644\u52a0\u5143\u6570\u636e\u6761\u4ef6\u2014\u2014\u6bd4\u5982&#034;\u53ea\u5728\u6700\u8fd1\u4e09\u4e2a\u6708\u7684\u6587\u6863\u91cc\u641c\u7d22&#034;\u3001&#034;\u53ea\u641c\u7d22\u4ea7\u54c1\u90e8\u95e8\u7684\u6587\u6863&#034;\u3002\u8fd9\u8ba9 RAG \u7cfb\u7edf\u53ef\u4ee5\u505a\u5230\u8bed\u4e49\u76f8\u5173 &#043; \u4e1a\u52a1\u8fc7\u6ee4\u7684\u7ec4\u5408\u67e5\u8be2\u3002<\/p>\n<p>\u6df7\u5408\u68c0\u7d22&#xff08;Hybrid Search&#xff09;<\/p>\n<p>\u4e3b\u6d41\u5411\u91cf\u6570\u636e\u5e93&#xff08;\u5982 Weaviate\u3001Elasticsearch with dense vectors&#xff09;\u652f\u6301\u540c\u65f6\u8fd0\u884c\u5411\u91cf\u641c\u7d22\u548c\u5173\u952e\u8bcd\u641c\u7d22&#xff0c;\u7136\u540e\u7528\u878d\u5408\u7b97\u6cd5&#xff08;\u5982 RRF&#xff0c;Reciprocal Rank Fusion&#xff09;\u5408\u5e76\u4e24\u8def\u7ed3\u679c\u3002\u8fd9\u5bf9\u4e2d\u6587\u4e13\u4e1a\u672f\u8bed\u573a\u666f\u5c24\u5176\u6709\u7528&#xff0c;\u56e0\u4e3a\u6709\u4e9b\u4e13\u6709\u540d\u8bcd\u7684\u8bed\u4e49\u8868\u793a\u5f88\u5f31&#xff0c;\u5fc5\u987b\u4f9d\u8d56\u5173\u952e\u8bcd\u7cbe\u786e\u5339\u914d\u3002<\/p>\n<p>\u5411\u91cf\u66f4\u65b0\u548c\u5220\u9664<\/p>\n<p>\u77e5\u8bc6\u5e93\u9700\u8981\u6301\u7eed\u66f4\u65b0\u2014\u2014\u6587\u6863\u4fee\u6539\u4e86\u3001\u5220\u9664\u4e86&#xff0c;\u5411\u91cf\u7d22\u5f15\u4e5f\u9700\u8981\u5bf9\u5e94\u66f4\u65b0\u3002\u4e0d\u540c\u5411\u91cf\u6570\u636e\u5e93\u5bf9\u8fd9\u4e2a\u64cd\u4f5c\u7684\u652f\u6301\u6210\u672c\u5dee\u5f02\u5f88\u5927&#xff0c;\u9009\u578b\u65f6\u9700\u8981\u8003\u8651\u4e1a\u52a1\u7684\u66f4\u65b0\u9891\u7387\u3002<\/p>\n<table>\n<tr>\u7c7b\u522b\u4ee3\u8868\u4ea7\u54c1\u6838\u5fc3\u7279\u70b9\u9002\u7528\u573a\u666f\u5c40\u9650<\/tr>\n<tbody>\n<tr>\n<td style=\"width:100px\">\u4e13\u7528\u5411\u91cf\u6570\u636e\u5e93<\/td>\n<td style=\"width:152px\">Milvus\u3001Qdrant\u3001Weaviate\u3001Pinecone<\/td>\n<td style=\"width:173px\">\u539f\u751f\u4ee5\u5411\u91cf\u68c0\u7d22\u4e3a\u6838\u5fc3&#xff1b;\u5b8c\u5584\u7684\u5143\u6570\u636e\u8fc7\u6ee4\u3001\u6df7\u5408\u68c0\u7d22\u3001\u5206\u7247\u6269\u5bb9&#xff1b;\u6027\u80fd\u5f3a<\/td>\n<td style=\"width:152px\">\u767e\u4e07\u53ca\u4ee5\u4e0a\u5411\u91cf&#xff0c;\u751f\u4ea7\u73af\u5883&#xff1b;\u9700\u8981\u6df7\u5408\u68c0\u7d22\u3001\u9ad8\u5e76\u53d1&#xff1b;Pinecone \u4e3a\u4e91\u7aef\u6258\u7ba1\u514d\u8fd0\u7ef4<\/td>\n<td>Pinecone \u4e3a\u6d77\u5916\u4e91\u670d\u52a1&#xff1b;\u81ea\u5efa\u9700\u8981\u8fd0\u7ef4\u90e8\u7f72\u6210\u672c<\/td>\n<\/tr>\n<tr>\n<td style=\"width:100px\">\u4f20\u7edf\u6570\u636e\u5e93\u5411\u91cf\u6269\u5c55<\/td>\n<td style=\"width:152px\">PostgreSQL&#043;pgvector\u3001Elasticsearch(dense vectors)<\/td>\n<td style=\"width:173px\">\u590d\u7528\u73b0\u6709\u6570\u636e\u5e93\u57fa\u7840\u8bbe\u65bd&#xff1b;\u652f\u6301\u5411\u91cf &#043; \u539f\u6709\u4e1a\u52a1\u67e5\u8be2&#xff1b;ES \u539f\u751f\u652f\u6301 BM25 &#043; \u5411\u91cf\u505a\u6df7\u5408\u68c0\u7d22<\/td>\n<td style=\"width:152px\">\u5df2\u6709 PG\/ES \u8fd0\u7ef4\u4f53\u7cfb&#xff0c;\u4e2d\u5c0f\u89c4\u6a21\u4e1a\u52a1<\/td>\n<td>\u767e\u4e07\u5411\u91cf\u4ee5\u4e0a&#xff0c;\u68c0\u7d22\u6027\u80fd\u5f31\u4e8e\u4e13\u7528\u5411\u91cf\u5e93&#xff1b;\u6269\u7f29\u5bb9\u590d\u6742<\/td>\n<\/tr>\n<tr>\n<td style=\"width:100px\">\u8f7b\u91cf\u7ea7\u672c\u5730\u5411\u91cf\u5e93<\/td>\n<td style=\"width:152px\">FAISS\u3001Chroma<\/td>\n<td style=\"width:173px\">FAISS&#xff1a;\u7eaf\u7d22\u5f15\u5e93&#xff0c;\u975e\u5b8c\u6574\u6570\u636e\u5e93&#xff0c;\u65e0\u6301\u4e45\u5316 \/ \u5143\u6570\u636e\u7ba1\u7406&#xff1b;Chroma&#xff1a;\u5f00\u7bb1\u5373\u7528\u8f7b\u91cf\u5e93<\/td>\n<td style=\"width:152px\">\u539f\u578b\u5f00\u53d1\u3001\u672c\u5730\u8c03\u8bd5\u3001\u5c0f\u89c4\u6a21\u6d4b\u8bd5&#xff08;\u51e0\u5341\u4e07\u5411\u91cf\u4ee5\u5185&#xff09;<\/td>\n<td>\u4e0d\u9002\u5408\u7ebf\u4e0a\u9ad8\u5e76\u53d1\u5927\u6d41\u91cf\u751f\u4ea7\u73af\u5883<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"4.4.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE\">4.4.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/h3>\n<p>Q&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u7528 MySQL \u505a\u76f8\u4f3c\u68c0\u7d22&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;\u5206\u4e24\u4e2a\u5c42\u9762\u56de\u7b54\u3002<\/p>\n<p>\u7b2c\u4e00&#xff0c;\u529f\u80fd\u5c42\u9762&#xff1a;\u4f20\u7edf\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7684\u67e5\u8be2\u6a21\u578b\u662f\u7cbe\u786e\u5339\u914d\u548c\u8303\u56f4\u626b\u63cf&#xff0c;\u57fa\u4e8e B-Tree \u7b49\u7d22\u5f15\u7ed3\u6784&#xff0c;\u8fd9\u7c7b\u7ed3\u6784\u65e0\u6cd5\u652f\u6301&#034;\u627e\u9ad8\u7ef4\u7a7a\u95f4\u4e2d\u7684\u8fd1\u4f3c\u6700\u8fd1\u90bb&#034;\u8fd9\u79cd\u51e0\u4f55\u95ee\u9898&#xff1b;<\/p>\n<p>\u7b2c\u4e8c&#xff0c;\u6027\u80fd\u5c42\u9762&#xff1a;\u5373\u4fbf\u901a\u8fc7\u6269\u5c55\u652f\u6301\u5411\u91cf\u5b58\u50a8\u548c\u8ba1\u7b97&#xff08;\u5982 pgvector&#xff09;&#xff0c;\u5728\u767e\u4e07\u7ea7\u5411\u91cf\u65f6\u5168\u91cf\u8ba1\u7b97\u4f59\u5f26\u76f8\u4f3c\u5ea6\u7684\u590d\u6742\u5ea6\u662f O(N)&#xff0c;\u8fdc\u8fdc\u65e0\u6cd5\u6ee1\u8db3\u6beb\u79d2\u7ea7\u68c0\u7d22\u9700\u6c42\u3002\u5411\u91cf\u6570\u636e\u5e93\u901a\u8fc7 HNSW\u3001IVF \u7b49\u4e13\u95e8\u7684\u8fd1\u4f3c\u7d22\u5f15\u7ed3\u6784&#xff0c;\u628a\u68c0\u7d22\u590d\u6742\u5ea6\u964d\u4f4e\u5230\u8fd1\u4f3c O(log N)\u3002<\/p>\n<p>Q&#xff1a;\u5411\u91cf\u6570\u636e\u5e93\u4e3a\u4ec0\u4e48\u80fd\u52a0\u901f\u53ec\u56de&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;\u5411\u91cf\u6570\u636e\u5e93\u7684\u6838\u5fc3\u662f ANN&#xff08;<span style=\"color:#fe2c24\">\u8fd1\u4f3c\u6700\u8fd1\u90bb\u641c\u7d22<\/span>&#xff09;&#xff0c;\u901a\u8fc7\u9884\u5148\u6784\u5efa\u5411\u91cf\u7d22\u5f15\u6765\u907f\u514d\u5168\u91cf\u8ba1\u7b97\u3002\u4ee5 HNSW \u4e3a\u4f8b&#xff0c;\u5b83\u6784\u5efa\u4e86\u5206\u5c42\u7684\u53ef\u5bfc\u822a\u5c0f\u4e16\u754c\u56fe&#xff0c;\u68c0\u7d22\u65f6\u4ece\u9876\u5c42\u7a00\u758f\u56fe\u7684\u5165\u53e3\u5feb\u901f\u5bfc\u822a&#xff0c;\u9010\u5c42\u5b9a\u4f4d\u5230\u76ee\u6807\u533a\u57df&#xff0c;\u53ea\u8bbf\u95ee\u6781\u5c11\u6570\u8282\u70b9\u5c31\u80fd\u627e\u5230\u8fd1\u4f3c\u6700\u8fd1\u90bb&#xff0c;\u901f\u5ea6\u6bd4\u66b4\u529b\u641c\u7d22\u5feb\u51e0\u4e2a\u6570\u91cf\u7ea7\u3002\u4ee3\u4ef7\u662f&#034;\u8fd1\u4f3c&#034;\u2014\u2014\u4e0d\u4fdd\u8bc1\u7edd\u5bf9\u6700\u8fd1\u90bb&#xff0c;\u4f46\u5b9e\u8df5\u4e2d recall \u7cbe\u5ea6 95%&#043; \u8db3\u4ee5\u6ee1\u8db3 RAG \u573a\u666f\u9700\u6c42\u3002<\/p>\n<h2 id=\"5.RAG%20%E5%88%87%E7%89%87%E7%AD%96%E7%95%A5\" style=\"background-color:transparent\">5.RAG \u5207\u7247\u7b56\u7565<\/h2>\n<p>\u5185\u5bb9\u6709\u70b9\u591a\u4e86&#xff0c;\u8fd9\u4e2a\u6211\u91cd\u65b0\u51fa\u4e00\u4e2a\u7ae0\u8282\u3002<\/p>\n<p>\u5207\u7247&#xff1a;\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011&#8211;RAG\u7684\u5206\u5757\u7b56\u7565-CSDN\u535a\u5ba2<\/p>\n<h3 id=\"5.1.Overlap\" style=\"background-color:transparent\">5.1.Overlap<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"256\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140917-6a9ec58ddaec5.png\" width=\"294\" \/><\/p>\n<p>\u8bb2 Chunking \u7ed5\u4e0d\u5f00\u4e00\u4e2a\u5173\u952e\u53c2\u6570&#xff1a;overlap&#xff08;\u91cd\u53e0&#xff09;\u3002<\/p>\n<p>\u8bbe\u60f3\u4e00\u6bb5\u6587\u5b57&#xff0c;\u4e2d\u95f4\u67d0\u53e5\u8bdd\u6070\u597d\u843d\u5728\u4e24\u4e2a chunk \u7684\u8fb9\u754c&#xff1a;\u524d\u534a\u53e5\u5728 chunk 1&#xff0c;\u540e\u534a\u53e5\u5728 chunk 2\u3002\u5f53\u7528\u6237\u63d0\u95ee\u8fd9\u53e5\u8bdd\u76f8\u5173\u7684\u5185\u5bb9\u65f6&#xff0c;\u5355\u72ec\u68c0\u7d22\u5230 chunk 1 \u6216 chunk 2&#xff0c;\u62ff\u5230\u7684\u90fd\u662f\u4e00\u534a&#xff0c;\u4fe1\u606f\u4e0d\u5b8c\u6574&#xff0c;\u751f\u6210\u7684\u7b54\u6848\u5c31\u4f1a\u51fa\u9519\u3002<\/p>\n<p>Overlap \u7684\u89e3\u51b3\u601d\u8def\u662f&#xff1a;\u76f8\u90bb chunk \u4e4b\u95f4\u4fdd\u7559\u4e00\u6bb5\u91cd\u53e0\u7684\u5185\u5bb9\u3002\u6bd4\u5982 chunk \u5927\u5c0f\u8bbe\u4e3a 512 token&#xff0c;overlap \u8bbe\u4e3a 64 token&#xff0c;\u90a3\u4e48 chunk 2 \u7684\u524d 64 \u4e2a token \u548c chunk 1 \u7684\u540e 64 \u4e2a token \u662f\u5b8c\u5168\u76f8\u540c\u7684\u3002<\/p>\n<p>\u8fd9\u6837&#xff0c;\u8fb9\u754c\u9644\u8fd1\u7684\u4fe1\u606f\u5728\u4e24\u4e2a chunk \u91cc\u90fd\u6709\u5907\u4efd&#xff0c;\u4e0d\u7ba1\u68c0\u7d22\u547d\u4e2d\u54ea\u4e2a&#xff0c;\u90fd\u80fd\u62ff\u5230\u5b8c\u6574\u7684\u4e0a\u4e0b\u6587\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"378\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140917-6a9ec58df18ba.png\" width=\"744\" \/><\/p>\n<\/p>\n<h3 id=\"5.2.%E9%9D%A2%E8%AF%95%E5%AE%98%E5%8F%AF%E8%83%BD%E4%BC%9A%E9%97%AE\" style=\"background-color:transparent\">5.2.\u9762\u8bd5\u5b98\u53ef\u80fd\u4f1a\u95ee<\/h3>\n<p>Q&#xff1a;\u4f60\u4eec\u9879\u76ee\u91cc chunk \u662f\u600e\u4e48\u5207\u7684&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;<\/p>\n<p>\u5148\u8bf4\u9009\u62e9\u4e86\u4ec0\u4e48\u7b56\u7565\u53ca\u539f\u56e0&#xff0c;\u518d\u8bf4\u5177\u4f53\u53c2\u6570&#xff08;chunk size\u3001overlap&#xff09;&#xff0c;\u6700\u540e\u8bf4\u662f\u5982\u4f55\u8bc4\u4f30\u548c\u8c03\u6574\u7684\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;&#034;\u6211\u4eec\u7684\u6587\u6863\u662f\u6709\u7ae0\u8282\u7ed3\u6784\u7684\u4ea7\u54c1\u624b\u518c&#xff0c;\u6240\u4ee5\u7528\u4e86\u7ed3\u6784\u611f\u77e5\u5207\u5206&#xff0c;\u6309\u4e8c\u7ea7\u6807\u9898\u5212\u5206\u3002\u6bcf\u4e2a chunk \u63a7\u5236\u5728 600 token \u4ee5\u5185&#xff0c;overlap \u8bbe\u4e86 80 token\u3002\u540e\u6765\u53d1\u73b0\u90e8\u5206\u6280\u672f\u89c4\u683c\u5185\u5bb9\u8de8\u6bb5\u843d&#xff0c;\u628a overlap \u8c03\u5927\u5230 120 token \u540e&#xff0c;\u76f8\u5173\u95ee\u9898\u7684\u53ec\u56de\u7387\u6709\u660e\u663e\u63d0\u5347\u3002&#034;<\/p>\n<p>Q&#xff1a;chunk \u8fc7\u5927\u8fc7\u5c0f\u5206\u522b\u6709\u4ec0\u4e48\u95ee\u9898&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;<\/p>\n<p>\u8fc7\u5c0f\u4f1a\u5bfc\u81f4\u8bed\u4e49\u4e0d\u5b8c\u6574&#xff0c;\u5355\u4e2a chunk \u7f3a\u4e4f\u4e0a\u4e0b\u6587&#xff0c;\u5411\u91cf\u8868\u793a\u8bed\u4e49\u6a21\u7cca&#xff0c;\u68c0\u7d22\u7cbe\u51c6\u5ea6\u4f4e\u3002<\/p>\n<p>\u8fc7\u5927\u4f1a\u5bfc\u81f4 Context \u91cc\u7684\u566a\u58f0\u589e\u591a&#xff0c;\u6a21\u578b\u6ce8\u610f\u529b\u88ab\u5206\u6563&#xff0c;\u540c\u65f6\u6bcf\u4e2a chunk \u7684\u5411\u91cf\u662f\u591a\u8bdd\u9898\u6df7\u5408\u7684\u5e73\u5747&#xff0c;\u8bed\u4e49\u5339\u914d\u53d8\u5dee\u3002\u4e24\u4e2a\u65b9\u5411\u7684\u95ee\u9898\u90fd\u76f4\u63a5\u5f71\u54cd\u6700\u7ec8\u7684\u751f\u6210\u8d28\u91cf\u3002<\/p>\n<p>Q&#xff1a;\u4e3a\u4ec0\u4e48\u8981\u8bbe\u7f6e overlap&#xff1f;<\/p>\n<p>\u53c2\u8003\u601d\u8def&#xff1a;<\/p>\n<p>overlap \u662f\u4e3a\u4e86\u9632\u6b62\u91cd\u8981\u4fe1\u606f\u843d\u5728 chunk \u8fb9\u754c\u88ab\u5272\u88c2&#xff0c;\u901a\u8fc7\u8ba9\u76f8\u90bb chunk \u5171\u4eab\u4e00\u6bb5\u5185\u5bb9\u6765\u4fdd\u8bc1\u8fb9\u754c\u9644\u8fd1\u7684\u4fe1\u606f\u5728\u4e24\u4fa7\u90fd\u80fd\u88ab\u5b8c\u6574\u68c0\u7d22\u5230\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u6709\u4e86\u5927\u6a21\u578b\u8fd8\u9700\u8981RAG&#xff1f;\u5e7b\u89c9\u3001\u79c1\u6709\u77e5\u8bc6\u3001\u65f6\u6548\u6027\u56db\u5927\u95ee\u9898<br \/>\n\u5047\u8bbe\u4f60\u4eec\u516c\u53f8\u6709\u51e0\u5343\u4efd\u5185\u90e8\u6587\u6863&#xff1a;\u4ea7\u54c1\u624b\u518c\u3001\u64cd\u4f5c\u89c4\u8303\u3001\u5386\u53f2\u9879\u76ee\u7ecf\u9a8c\u3001\u5ba2\u6237\u5408\u540c\u2026\u2026\u9886\u5bfc\u60f3\u505a\u4e00\u4e2a AI \u95ee\u7b54\u7cfb\u7edf&#xff0c;\u8ba9\u5458\u5de5\u968f\u65f6\u53ef\u4ee5\u95ee\\&#8221;\u6211\u4eec\u7684\u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48\\&#8221;\u3001\\&#8221;\u8fd9\u4e2a\u5ba2\u6237\u7b7e\u4e86\u54ea\u4e9b\u6761\u6b3e\\&#8221;&#xff0c;\u7cfb\u7edf\u80fd\u76f4\u63a5\u7ed9\u51fa\u51c6\u786e\u7b54\u6848\u3002<br \/>\n\u4f60\u76f4\u63a5\u7528\u5927\u6a21\u578b\u6765\u505a&#xff0c;\u7b2c\u4e00\u8f6e\u6d4b\u8bd5\u6548\u679c\u8fd8\u4e0d\u9519\u2014\u2014\u4f46\u5f88\u5feb\u53d1\u73b0\u51e0\u4e2a\u7ed5\u4e0d\u5f00\u7684\u95ee\u9898&#xff1a;<br \/>\n\u6a21\u578b\u5bf9\u516c\u53f8\u5185\u90e8\u6587\u6863\u4e00\u65e0\u6240\u77e5&#xff0c;\u56de\u7b54\u5168\u9760\\&#8221;\u7f16<\/p>\n","protected":false},"author":2,"featured_media":101949,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,87,190],"topic":[],"class_list":["post-101959","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-87","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011-3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/101959.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011-3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e3a\u4ec0\u4e48\u6709\u4e86\u5927\u6a21\u578b\u8fd8\u9700\u8981RAG&#xff1f;\u5e7b\u89c9\u3001\u79c1\u6709\u77e5\u8bc6\u3001\u65f6\u6548\u6027\u56db\u5927\u95ee\u9898 \u5047\u8bbe\u4f60\u4eec\u516c\u53f8\u6709\u51e0\u5343\u4efd\u5185\u90e8\u6587\u6863&#xff1a;\u4ea7\u54c1\u624b\u518c\u3001\u64cd\u4f5c\u89c4\u8303\u3001\u5386\u53f2\u9879\u76ee\u7ecf\u9a8c\u3001\u5ba2\u6237\u5408\u540c\u2026\u2026\u9886\u5bfc\u60f3\u505a\u4e00\u4e2a AI \u95ee\u7b54\u7cfb\u7edf&#xff0c;\u8ba9\u5458\u5de5\u968f\u65f6\u53ef\u4ee5\u95ee&quot;\u6211\u4eec\u7684\u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48&quot;\u3001&quot;\u8fd9\u4e2a\u5ba2\u6237\u7b7e\u4e86\u54ea\u4e9b\u6761\u6b3e&quot;&#xff0c;\u7cfb\u7edf\u80fd\u76f4\u63a5\u7ed9\u51fa\u51c6\u786e\u7b54\u6848\u3002 \u4f60\u76f4\u63a5\u7528\u5927\u6a21\u578b\u6765\u505a&#xff0c;\u7b2c\u4e00\u8f6e\u6d4b\u8bd5\u6548\u679c\u8fd8\u4e0d\u9519\u2014\u2014\u4f46\u5f88\u5feb\u53d1\u73b0\u51e0\u4e2a\u7ed5\u4e0d\u5f00\u7684\u95ee\u9898&#xff1a; \u6a21\u578b\u5bf9\u516c\u53f8\u5185\u90e8\u6587\u6863\u4e00\u65e0\u6240\u77e5&#xff0c;\u56de\u7b54\u5168\u9760&quot;\u7f16\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/101959.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-07T14:09:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140916-6a9ec58c0d182.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101959.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/101959.html\",\"name\":\"\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011-3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-07T14:09:19+00:00\",\"dateModified\":\"2026-09-07T14:09:19+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/101959.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/101959.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/101959.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011--3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011-3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/101959.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011-3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e3a\u4ec0\u4e48\u6709\u4e86\u5927\u6a21\u578b\u8fd8\u9700\u8981RAG&#xff1f;\u5e7b\u89c9\u3001\u79c1\u6709\u77e5\u8bc6\u3001\u65f6\u6548\u6027\u56db\u5927\u95ee\u9898 \u5047\u8bbe\u4f60\u4eec\u516c\u53f8\u6709\u51e0\u5343\u4efd\u5185\u90e8\u6587\u6863&#xff1a;\u4ea7\u54c1\u624b\u518c\u3001\u64cd\u4f5c\u89c4\u8303\u3001\u5386\u53f2\u9879\u76ee\u7ecf\u9a8c\u3001\u5ba2\u6237\u5408\u540c\u2026\u2026\u9886\u5bfc\u60f3\u505a\u4e00\u4e2a AI \u95ee\u7b54\u7cfb\u7edf&#xff0c;\u8ba9\u5458\u5de5\u968f\u65f6\u53ef\u4ee5\u95ee\"\u6211\u4eec\u7684\u9000\u6b3e\u653f\u7b56\u662f\u4ec0\u4e48\"\u3001\"\u8fd9\u4e2a\u5ba2\u6237\u7b7e\u4e86\u54ea\u4e9b\u6761\u6b3e\"&#xff0c;\u7cfb\u7edf\u80fd\u76f4\u63a5\u7ed9\u51fa\u51c6\u786e\u7b54\u6848\u3002 \u4f60\u76f4\u63a5\u7528\u5927\u6a21\u578b\u6765\u505a&#xff0c;\u7b2c\u4e00\u8f6e\u6d4b\u8bd5\u6548\u679c\u8fd8\u4e0d\u9519\u2014\u2014\u4f46\u5f88\u5feb\u53d1\u73b0\u51e0\u4e2a\u7ed5\u4e0d\u5f00\u7684\u95ee\u9898&#xff1a; \u6a21\u578b\u5bf9\u516c\u53f8\u5185\u90e8\u6587\u6863\u4e00\u65e0\u6240\u77e5&#xff0c;\u56de\u7b54\u5168\u9760\"\u7f16","og_url":"https:\/\/www.wsisp.com\/helps\/101959.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-07T14:09:19+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260907140916-6a9ec58c0d182.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/101959.html","url":"https:\/\/www.wsisp.com\/helps\/101959.html","name":"\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011-3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-07T14:09:19+00:00","dateModified":"2026-09-07T14:09:19+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/101959.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/101959.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/101959.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010LLM&amp;&amp;AI\u5e94\u7528\u5f00\u53d1 \u516b\u80a1\u6587\u3011--3.1.RAG\u68c0\u7d22\u589e\u5f3a\uff08\u4e0a\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/101959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=101959"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/101959\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/101949"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=101959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=101959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=101959"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=101959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}